noalyss Version-9
acc_ledger_history_sale_extended.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta 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 PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
21
22
23/**
24 * @file
25 * @brief detail of the list of operation with VAT and items
26 */
27bcscale(2);
28
29
30?>
31<table class="result" id="tb_print_ledger">
32 <tr>
33 <th>
34 <?=_('Date')?>
35 </th>
36 <th>
37 <?=_('Date paiement')?>
38 </th>
39 <th>
40 <?=_('Pièce')?>
41 </th>
42 <th>
43 <?=_('Interne')?>
44 </th>
45 <th>
46 <?=_('Client')?>
47 </th>
48 <th>
49 <?=_('Description')?>
50 </th>
51 <th class="num">
52 <?=_('Devise TVAC')?>
53 </th>
54 <th class="num">
55 <?=_('HTVA')?>
56 </th>
57 <th class="num">
58 <?=_('TVA')?>
59 </th>
60 <th class="num">
61 <?=_('TVAC')?>
62 </th>
63 </tr>
64<?php
65$nb_data=count($this->data);
69for ($i=0;$i<$nb_data;$i++):
70 $odd=' class="odd" ';
71 $tot_amount_novat=bcadd($tot_amount_novat,$this->data[$i]['novat']);
72 $tot_amount_vat=bcadd($tot_amount_vat,$this->data[$i]['vat']);
73 $tot_amount_vat=bcsub($tot_amount_vat,$this->data[$i]['tva_sided']);
74 $tot_amount_tvac=bcadd($tot_amount_tvac,$this->data[$i]['tvac']);
75 $supp_tax=$this->data[$i]['supp_tax'];
76 $tot_other_tax=array_sum(array_column($supp_tax,'j_montant'));
77 $all_tax=bcadd($tot_other_tax,$this->data[$i]['vat']);
78?>
79 <tr <?=$odd?> >
80 <td>
81 <?=$this->data[$i]['str_date']?>
82 </td>
83 <td>
84 <?=$this->data[$i]['str_date_paid']?>
85 </td>
86 <td>
87 <?=$this->data[$i]['jr_pj_number']?>
88 </td>
89 <td>
90 <?=HtmlInput::detail_op($this->data[$i]['jr_id'], $this->data[$i]['jr_internal'])?>
91 </td>
92 <td>
93 <?=HtmlInput::history_card($this->data[$i]['qs_client'],h($this->data[$i]['name'].' '.$this->data[$i]['first_name']))?>
94 </td>
95 <td>
96 <?=h($this->data[$i]['jr_comment'])?>
97 </td>
98 <td class="num">
99 <?php if ($this->data[$i]['currency_id'] !=0) : ?>
100 <?=nbm(bcadd($this->data[$i]['sum_oc_amount'],$this->data[$i]['sum_oc_vat_amount'],4),2)?>
101 <?=$this->data[$i]['cr_code_iso']?>
102 <?php endif;?>
103 </td>
104 <td class="num">
105 <?=nbm($this->data[$i]['novat'])?>
106 </td>
107 <td class="num">
108 <?=nbm(bcsub($all_tax,$this->data[$i]['tva_sided']),2)?>
109
110 </td>
111 <td class="num">
112 <?=nbm(bcadd($this->data[$i]['tvac'],$tot_other_tax))?>
113
114 </td>
115 <td>
116
117 <?php
118 $ret_reconcile=$this->db->execute('reconcile_date',array($this->data[$i]['jr_id']));
120 if ($max > 0) {
121 $sep="";
122 for ($e=0;$e<$max;$e++) {
124 $msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
125 echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
126
127 $sep=' ,';
128 }
129 } ?>
130 </td>
131 </tr>
132 <tr>
133 <td></td>
134 <td></td>
135 <td class="width:auto" colspan="8" style="border-style: solid;border-width:1px;border-color: blue">
136<?php
137 /// Detail opération
138$det=$this->db->execute("detail_sale",array($this->data[$i]['jr_internal']));
140?>
141 <table style="width: 100%">
142 <tr>
143 <th><?=_("Item")?></th>
144 <th class="num"><?=_("Prix Uni")?></th>
145 <th class="num"><?=_("Quantité")?></th>
146 <th class="num"><?=_("HTVA")?></th>
147 <th class="num"><?=_("TVA")?></th>
148 <th class="num"><?=_("Code TVA")?></th>
149 <th class="num"><?=_("TVAC")?></th>
150 </tr>
151<?php
153for ($j=0;$j<$nb_detail;$j++):
154
155
156
157?>
158 <tr>
159 <td><?=$a_detail[$j]['qcode']?>
160 <?=$a_detail[$j]['name']?> </td>
161 <td class="num" style="width:10%"><?=$a_detail[$j]['qs_quantite']?> </td>
162 <td class="num" style="width:10%"><?=$a_detail[$j]['qs_unit']?> </td>
163 <td class="num" style="width:10%"><?=nbm($a_detail[$j]['qs_price'])?> </td>
164 <td class="num" style="width:10%"><?=nbm($a_detail[$j]['qs_vat'])?> </td>
165 <td class="num" style="width:10%"><?=$a_detail[$j]['tva_label']?> </td>
166 <td class="num" style="width:10%"><?=nbm($a_detail[$j]['tvac'])?> </td>
167 </tr>
168<?php
170?>
171 <?php
172 // print additional tax if any
173 $nb_supp_tax=count($this->data[$i]['supp_tax']);
174 for ($j=0;$j<$nb_supp_tax;$j++):
175 ?>
176 <tr>
177 <td><?=$this->data[$i]['supp_tax'][$j]['j_poste']?>
178 <?=$this->data[$i]['supp_tax'][$j]['ac_label']?>
179 </td>
180 <td></td>
181 <td></td>
182 <td></td>
183 <td></td>
184 <td></td>
185 <td class="num"><?=nbm($this->data[$i]['supp_tax'][$j]['j_montant'])?></td>
186 </tr>
187 <?php
188 endfor;
189 ?>
190
191 </table>
192 </td>
193 </tr>
194<?php
195 endfor;
196?>
197 <tfoot>
198 <tr class="highlight">
199 <td>
200 <?=_("Totaux")?>
201 </td>
202 <td></td>
203 <td></td>
204 <td></td>
205 <td></td>
206 <td></td>
207 <td><?=nbm($tot_amount_novat)?></td>
208 <td><?=nbm($tot_amount_vat)?></td>
209 <td><?=nbm($tot_amount_tvac)?></td>
210 <td></td>
211 <td></td>
212 </tr>
213 </tfoot>
214</table>
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
tr($p_string, $p_extra='')
Definition: ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:137
if($max > 0) $det
Detail opération.
if( $this->data[ $i][ 'currency_id'] !=0)(bcadd( $this->data[ $i][ 'sum_oc_amount'], $this->data[ $i][ 'sum_oc_vat_amount'], 4), 2)?><? endif
for( $j=0; $j< $nb_detail; $j++)( $a_detail[ $j][ 'qs_price'])?></td >< td class endfor
h( $row[ 'oa_description'])
$opd_description style
static fetch_all($ret)
wrapper for the function pg_fetch_all
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
static detail_op($p_jr_id, $p_mesg)
return a string containing the html code for calling the modifyOperation
static history_card($f_id, $p_mesg, $p_style="", $p_exercice="")
display a div with the history of the card
$all table
$SecUser db