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