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'), 'style="text-align:right"');
00046   echo th(_('TVAC'), 'style="text-align:right"');
00047 } else
00048   echo th(_('Total'), 'style="text-align:right"');
00049 
00050 
00051 echo '</tr>';
00052   for ($e=0;$e<count($obj->det->array);$e++) {
00053     $row='';
00054     $q=$obj->det->array[$e];
00055     $fiche=new Fiche($cn,$q['qs_fiche']);
00056         $view_card_detail=HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE),"", ' class="line" ');
00057         $row.=td($view_card_detail);
00058         $input = new ISpan("e_march" . $q['j_id'] . "_label");
00059         $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
00060         $input->value = $fiche->strAttribut(ATTR_DEF_NAME);
00061 
00062     $row.=td($input->input().$hidden);
00063     $sym_tva='';
00064         $pu=0;
00065         if ($q['qs_quantite'] != 0)     $pu=bcdiv($q['qs_price'],$q['qs_quantite']);
00066     $row.=td(nbm($pu),'class="num"');
00067     $row.=td(nbm($q['qs_quantite']),'class="num"');
00068         $sym_tva='';
00069    if ( $g_parameter->MY_TVA_USE=='Y' && $q['qs_vat_code'] != '') {
00070      /* retrieve TVA symbol */
00071      $tva=new Acc_Tva($cn,$q['qs_vat_code']);
00072      $tva->load();
00073      $sym_tva=(h($tva->get_parameter('label')));
00074      //     $sym_tva=$sym
00075    }
00076 
00077    $row.=td($sym_tva,'style="text-align:center"');
00078 
00079     $htva=$q['qs_price'];
00080 
00081     $row.=td(nbm($htva),'class="num"');
00082     $tvac=bcadd($htva,$q['qs_vat']);
00083     if ($g_parameter->MY_TVA_USE=='Y')
00084       {
00085                 $class="";
00086                 if ($q['qs_vat_sided'] != 0) {
00087                         $class=' style="text-decoration:line-through"';
00088                         $tvac=bcsub($tvac,$q['qs_vat']);
00089                 }
00090                 $row.=td(nbm($q['qs_vat']),'class="num"'.$class);
00091                 $row.=td(nbm($tvac),'class="num"');
00092       }
00093     $total_tvac=bcadd($total_tvac,$tvac);
00094     $total_htva=bcadd($total_htva,$htva);
00095     echo tr($row);
00096 
00097   }
00098   if ($g_parameter->MY_TVA_USE=='Y')
00099         $row= td(_('Total'),' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
00100   else
00101         $row= td(_('Total'),' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
00102 $row.=td(nbm($total_htva),'class="num" style="font-style:italic;font-weight: bolder;"');
00103 if ($g_parameter->MY_TVA_USE=='Y')
00104   $row.=td("").td(nbm($total_tvac),'class="num" style="font-style:italic;font-weight: bolder;"');
00105 echo tr($row);
00106 ?>
00107 </table>
 All Data Structures Namespaces Files Functions Variables Enumerations