noalyss  Version-9
operation_detail_ven.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * NOALYSS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with NOALYSS; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 /* $Revision$ */
21 
22 // Copyright Author Dany De Bontridder danydb@aevalys.eu
23 
24 /**
25  * @file
26  * @brief show detail of a operation of sale
27  *
28  */
29 global $g_parameter;
30 ?>
31 <table class="result">
32 <?php
33  bcscale(2);
35  echo th(_('Quick Code'));
36 echo th(_('Description'));
37 echo th(_('Prix/Un'), 'style="text-align:right"');
38 echo th(_('Quantité'), 'style="text-align:right"');
39 if ( $g_parameter->MY_TVA_USE == 'Y')
40  echo th(_('Taux TVA'), 'style="text-align:right"');
41 else
42  echo th('');
43 if ( $g_parameter->MY_TVA_USE == 'Y') {
44  echo th(_('HTVA'), 'style="text-align:right"');
45  echo th(_('TVA NP'), 'style="text-align:right"');
46  echo th(_('TVA'), 'style="text-align:right"');
47  echo th(_('TVAC'), 'style="text-align:right"');
48 } else
49  echo th(_('Total'), 'style="text-align:right"');
50 
51 
52 echo '</tr>';
53  for ($e=0;$e<count($obj->det->array);$e++) {
54  $row='';
55  $q=$obj->det->array[$e];
56  $fiche=new Fiche($cn,$q['qs_fiche']);
57  $view_card_detail=HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE),"", ' class="line" ');
59  $input = new ISpan("e_march" . $q['j_id'] . "_label");
60  $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
61  $input->value = $fiche->strAttribut(ATTR_DEF_NAME);
62 
63  $row.=td($input->input().$hidden);
64  $sym_tva='';
65  $pu=0;
66  if ($q['qs_quantite'] != 0) $pu=bcdiv($q['qs_price'],$q['qs_quantite']);
67  $row.=td(nbm($pu),'class="num"');
68  $row.=td(nbm($q['qs_quantite']),'class="num"');
69  $sym_tva='';
70  if ( $g_parameter->MY_TVA_USE=='Y' && $q['qs_vat_code'] != '') {
71  /* retrieve TVA symbol */
72  $tva=new Acc_Tva($cn,$q['qs_vat_code']);
73  $tva->load();
74  $sym_tva=(h($tva->get_parameter('label')));
75  // $sym_tva=$sym
76  }
77 
78  $row.=td($sym_tva,'style="text-align:center"');
79 
80  $htva=$q['qs_price'];
81 
82  $row.=td(nbm($htva),'class="num"');
83  $tvac=bcadd($htva,$q['qs_vat']);
84  if ($g_parameter->MY_TVA_USE=='Y')
85  {
86  $class="";
87  if ($q['qs_vat_sided'] != 0) {
88  $class=' style="text-decoration:line-through"';
89  $tvac=bcsub($tvac,$q['qs_vat']);
90  }
91  $row.=td(nbm($q['qs_vat_sided']),'class="num"');
92  $row.=td(nbm($q['qs_vat']),'class="num"'.$class);
93  $row.=td(nbm($tvac),'class="num"');
94  }
95  $total_tvac=bcadd($total_tvac,$tvac);
96  $total_htva=bcadd($total_htva,$htva);
97  echo tr($row);
98 
99  }
100  if ($g_parameter->MY_TVA_USE=='Y')
101  $row= td(_('Total'),' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
102  else
103  $row= td(_('Total'),' style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
104 $row.=td(nbm($total_htva),'class="num" style="font-style:italic;font-weight: bolder;"');
105 if ($g_parameter->MY_TVA_USE=='Y')
106  $row.=td("").td(nbm($total_tvac),'class="num" style="font-style:italic;font-weight: bolder;"');
107 echo tr($row);
108 ?>
109 </table>
nbm
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:137
$class
$class
Definition: cfgplugin.inc.php:128
h
h( $row[ 'oa_description'])
Definition: ajax_anc_detail_operation.php:46
$e
$e
Definition: result_cat_card_summary.php:26
$q
$q
Definition: ajax_add_concerned_card.php:58
$row
else $row
Definition: operation_detail_ven.php:103
$g_parameter
global $g_parameter
Definition: operation_detail_ven.php:29
$total_htva
$total_htva
Definition: operation_detail_ven.php:34
$fiche
$fiche
Definition: ajax_add_concerned_card.php:98
tr
tr($p_string, $p_extra='')
Definition: ac_common.php:88
Acc_Tva
Acc_Tva is used for to map the table tva_rate parameter are.
Definition: acc_tva.class.php:36
ISpan
Html Input.
Definition: ispan.class.php:31
$total_tvac
$total_tvac
Definition: operation_detail_ven.php:34
Fiche
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:37
$obj
$obj
Definition: ajax_accounting.php:43
$view_card_detail
$view_card_detail
Definition: ledger_detail_ach.php:52
$cn
$cn
Definition: ajax_anc_accounting.php:30
$input
$input
Definition: ajax_anc_plan.php:32
table
$all table
Definition: company.inc.php:138
ATTR_DEF_QUICKCODE
const ATTR_DEF_QUICKCODE
Definition: constant.php:227
$hidden
$hidden
Definition: impress_rapport.inc.php:236
th
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
td
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
ATTR_DEF_NAME
const ATTR_DEF_NAME
Definition: constant.php:206
HtmlInput\hidden
static hidden($p_name, $p_value, $p_id="")
Definition: html_input.class.php:218
HtmlInput\card_detail
static card_detail($p_qcode, $pname='', $p_style="", $p_nohistory=false)
show the detail of a card
Definition: html_input.class.php:565