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'), 'style="text-align:right"');
00054                 echo th(_('TVAC'), 'style="text-align:right"');
00055         }else
00056                 echo th(_('Total'), 'style="text-align:right"');
00057 
00058         echo '</tr>';
00059         for ($e = 0; $e < count($obj->det->array); $e++)
00060         {
00061                 $row = '';
00062                 $q = $obj->det->array[$e];
00063                 $fiche = new Fiche($cn, $q['qp_fiche']);
00064                 $view_card_detail = HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE), "", ' class="line" ');
00065                 $row = td($view_card_detail);
00066                 $sym_tva = '';
00067 
00068                 if ($g_parameter->MY_TVA_USE == 'Y' && $q['qp_vat_code'] != '')
00069                 {
00070                         /* retrieve TVA symbol */
00071                         $tva = new Acc_Tva($cn, $q['qp_vat_code']);
00072                         $tva->load();
00073                         $sym_tva = h($tva->get_parameter('label'));
00074                 }
00075                 $input = new ISpan("e_march" . $q['j_id'] . "_label");
00076                 $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
00077                 $input->value = $fiche->strAttribut(ATTR_DEF_NAME);
00078                 $row.=td($input->input() . $hidden);
00079                 $row.=td($sym_tva, 'style="text-align:center"');
00080                 $pu = 0;
00081                 if ($q['qp_quantite'] != 0)
00082                         $pu = bcdiv($q['qp_price'], $q['qp_quantite']);
00083                 $row.=td(nbm($pu), 'class="num"');
00084                 $row.=td(nbm($q['qp_quantite']), 'class="num"');
00085 
00086                 $no_ded = $q['qp_nd_amount'];
00087                 $row.=td(nbm($q['qp_dep_priv']), 'style="text-align:right"');
00088                 $row.=td(nbm($no_ded), ' style="text-align:right"');
00089                 $htva = $q['qp_price'];
00090 
00091 
00092                 $row.=td(nbm($htva), 'class="num"');
00093                 $tvac = bcadd($htva, $q['qp_vat']);
00094                 $tvac = bcadd($tvac, $q['qp_nd_tva']);
00095                 $tvac = bcadd($tvac, $q['qp_nd_tva_recup']);
00096 
00097 
00098                 if ($g_parameter->MY_TVA_USE == 'Y')
00099                 {
00100                         $tva_amount = bcadd($q['qp_vat'], $q['qp_nd_tva']);
00101                         $tva_amount = bcadd($tva_amount, $q['qp_nd_tva_recup']);
00102                         $class = "";
00103                         if ($q['qp_vat_sided'] <> 0)
00104                         {
00105                                 $class = ' style="text-decoration:line-through"';
00106                                 $tvac = bcsub($tvac, $q['qp_vat']);
00107                         }
00108                         $row.=td(nbm($tva_amount), 'class="num" ' . $class);
00109                         $row.=td(nbm($tvac), 'class="num"');
00110                 }
00111                 $total_tvac+=$tvac;
00112                 $total_htva+=$htva;
00113                 echo tr($row);
00114         }
00115         if ($g_parameter->MY_TVA_USE == 'Y')
00116                 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;width:auto" colspan="6"');
00117         else
00118                 $row = td(_('Total'), ' style="font-style:italic;text-align:right;font-weight: bolder;width:auto" colspan="6"');
00119         $row.=td(nbm($total_htva), 'class="num" style="font-style:italic;font-weight: bolder;"');
00120         if ($g_parameter->MY_TVA_USE == 'Y')
00121                 $row.=td("") . td(nbm($total_tvac), 'class="num" style="font-style:italic;font-weight: bolder;"');
00122         echo tr($row);
00123         ?>
00124 </table>
 All Data Structures Namespaces Files Functions Variables Enumerations