noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
operation_detail_ach.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  */
00019 /* $Revision$ */
00020 
00021 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00022 
00023 /**
00024  * @file
00025  * @brief show detail of a operation of purchase
00026  *
00027  */
00028 global $g_parameter;
00029 ?>
00030 <table class="result" >
00031         <?php 
00032         bcscale(2);
00033         $total_htva = 0;
00034         $total_tvac = 0;
00035         echo th(_('Quick Code'));
00036         echo th(_('Description'));
00037         if ($g_parameter->MY_TVA_USE == 'Y')
00038         {
00039                 echo th(_('Taux TVA'), 'style="text-align:right"');
00040         }
00041         else
00042         {
00043                 echo th('');
00044         }
00045         echo th(_('Prix/Un.'), 'style="text-align:right"');
00046         echo th(_('Quantité'), 'style="text-align:right"');
00047         echo th(_('Personnel'), 'style="text-align:right"');
00048         echo th(_('Non ded'), 'style="text-align:right"');
00049 
00050         if ($g_parameter->MY_TVA_USE == 'Y')
00051         {
00052                 echo th(_('HTVA'), 'style="text-align:right"');
00053                 echo th(_('TVA NP'), 'style="text-align:right"');
00054                 echo th(_('TVA'), 'style="text-align:right"');
00055                 echo th(_('TVAC'), 'style="text-align:right"');
00056         }else
00057                 echo th(_('Total'), 'style="text-align:right"');
00058 
00059         echo '</tr>';
00060         for ($e = 0; $e < count($obj->det->array); $e++)
00061         {
00062                 $row = '';
00063                 $q = $obj->det->array[$e];
00064                 $fiche = new Fiche($cn, $q['qp_fiche']);
00065                 $view_card_detail = HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE), "", ' class="line" ');
00066                 $row = td($view_card_detail);
00067                 $sym_tva = '';
00068 
00069                 if ($g_parameter->MY_TVA_USE == 'Y' && $q['qp_vat_code'] != '')
00070                 {
00071                         /* retrieve TVA symbol */
00072                         $tva = new Acc_Tva($cn, $q['qp_vat_code']);
00073                         $tva->load();
00074                         $sym_tva = h($tva->get_parameter('label'));
00075                 }
00076                 $input = new ISpan("e_march" . $q['j_id'] . "_label");
00077                 $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
00078                 $input->value = $fiche->strAttribut(ATTR_DEF_NAME);
00079                 $row.=td($input->input() . $hidden);
00080                 $row.=td($sym_tva, 'style="text-align:center"');
00081                 $pu = 0;
00082                 if ($q['qp_quantite'] != 0)
00083                 $pu = bcdiv($q['qp_price'], $q['qp_quantite']);
00084                 $row.=td(nbm($pu), 'class="num"');
00085                 $row.=td(nbm($q['qp_quantite']), 'class="num"');
00086 
00087                 $no_ded = $q['qp_nd_amount'];
00088                 $row.=td(nbm($q['qp_dep_priv']), 'style="text-align:right"');
00089                 $row.=td(nbm($no_ded), ' style="text-align:right"');
00090                 $htva = $q['qp_price'];
00091 
00092 
00093                 $row.=td(nbm($htva), 'class="num"');
00094                 $tvac = bcadd($htva, $q['qp_vat']);
00095                 $tvac = bcadd($tvac, $q['qp_nd_tva']);
00096                 $tvac = bcadd($tvac, $q['qp_nd_tva_recup']);
00097 
00098 
00099                 if ($g_parameter->MY_TVA_USE == 'Y')
00100                 {
00101                         $tva_amount = bcadd($q['qp_vat'], $q['qp_nd_tva']);
00102                         $tva_amount = bcadd($tva_amount, $q['qp_nd_tva_recup']);
00103                         $class = "";
00104                         if ($q['qp_vat_sided'] <> 0)
00105                         {
00106                                 $class = ' style="text-decoration:line-through"';
00107                                 $tvac = bcsub($tvac, $q['qp_vat_sided']);
00108                         }
00109                         $row.=td(nbm($q['qp_vat_sided']),'class="num"');
00110                         $row.=td(nbm($tva_amount), 'class="num" ' . $class);
00111                         $row.=td(nbm($tvac), 'class="num"');
00112                 }
00113                 $total_tvac+=$tvac;
00114                 $total_htva+=$htva;
00115                 echo tr($row);
00116         }
00117         if ($g_parameter->MY_TVA_USE == 'Y')
00118                 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;width:auto" colspan="6"');
00119         else
00120                 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;width:auto" colspan="6"');
00121         $row.=td(nbm($total_htva), 'class="num" style="font-style:italic;font-weight: bolder;"');
00122         if ($g_parameter->MY_TVA_USE == 'Y')
00123                 $row.=td("") . td(nbm($total_tvac), 'class="num" style="font-style:italic;font-weight: bolder;"');
00124         echo tr($row);
00125         ?>
00126 </table>
 All Data Structures Namespaces Files Functions Variables Enumerations