noalyss Version-9
tax_summary_display.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11
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
21// Copyright Author Dany De Bontridder danydb@noalyss.eu
22
23/**
24 * @file
25 * @brief display the tax summary result
26 * @see Tax_Summary
27 *
28 */?>
29<div class="content">
30<h2><?php echo _("Vente")?></h2>
31
32<?php
33bcscale(4);
34$array=$this->get_row_sale();
39
40for ($i=0;$i < $nb_array;$i++):
41
42 if ( $ledger != $array[$i]['jrn_def_name']):
43 if ( $ledger != "") :
44 // last row with total
45 echo '<tr class="highlight">';
46 echo td();
47 echo td();
48 echo td(nbm($tot_wovat),' class="num" ');
49 echo td(nbm($tot_vat),' class="num" ');
50 echo td(nbm($tot_sided),' class="num" ');
51 echo '</tr>';
52 echo '</table>';
54 $ledger=$array[$i]['jrn_def_name'];
55 //reinitialize sum
57
58 printf("<h3>%s</h3>",$ledger);
59 echo '<table class="result">';
60 echo '<tr>';
61 echo th(_("Code TVA"));
62 echo th(_("Taux"),'class="num"');
63 echo th(_("Montant HT"),'class="num"');
64 echo th(_("Montant TVA"),'class="num"');
65 echo th(_("Montant Autoliquidation"),'class="num"');
66 echo '</tr>';
67 $r=0;
68 endif;
69 $color=($r%2==0)?"even":"odd";
70?>
71<tr class="<?php echo $color;?>">
72 <td>
73 <?=$array[$i]['tva_label']?>
74 </td>
75 <td>
76 <?=$array[$i]['tva_rate']*100?>%
77 </td>
78 <td class="num">
79 <?=nbm($array[$i]['amount_wovat'])?>
80 </td>
81 <td class="num">
82 <?=nbm($array[$i]['amount_vat'])?>
83 </td>
84 <td class="num">
85 <?=nbm($array[$i]['amount_sided'])?>
86 </td>
87</tr>
88 <?php
89 $tot_vat=bcadd($tot_vat,$array[$i]['amount_vat']);
90 $tot_wovat=bcadd($tot_wovat,$array[$i]['amount_wovat']);
91 $tot_sided=bcadd($tot_sided,$array[$i]['amount_sided']);
92
93 ?>
94<?php endfor;?>
95<?php
96if ( $nb_array > 0):
97// last row with total
98 echo '<tr class="highlight">';
99 echo td();
100 echo td();
101 echo td(nbm($tot_wovat),' class="num" ');
102 echo td(nbm($tot_vat),' class="num" ');
103 echo td(nbm($tot_sided),' class="num" ');
104 echo '</tr>';
105else:
106 echo _("Aucune donnée");
107endif;
108 echo '</table>';
109?>
110<h3><?=_("Résumé tous les journaux de vente")?></h3>
111<?php
112$a_sum=$this->get_summary_sale();
113?>
114<table class="result">
115 <tr>
116 <th>
117 <?=_("Code TVA")?>
118 </th>
119 <th>
120 <?=_("Taux")?>
121 </th>
122 <th class="num">
123 <?=_("Montant HT")?>
124 </th>
125 <th class="num">
126 <?=_("Montant TVA")?>
127 </th>
128 <th class="num">
129 <?=_("Montant Autoliquidation")?>
130 </th>
131 </tr>
132 <?php
135
136 for ($e=0;$e < $nb_sum ; $e++):
137 $tot_vat=bcadd($tot_vat,$a_sum[$e]['amount_vat']);
138 $tot_wovat=bcadd($tot_wovat,$a_sum[$e]['amount_wovat']);
139 $tot_sided=bcadd($tot_sided,$a_sum[$e]['amount_sided']);
140
141 ?>
142 <tr>
143
144 <td>
145 <?=$a_sum[$e]['tva_label']?>
146 </td>
147 <td class="num">
148 <?=$a_sum[$e]['tva_rate']*100?>%
149 </td>
150 <td class="num">
151 <?=nbm($a_sum[$e]['amount_wovat'])?>
152 </td>
153 <td class="num">
154 <?=nbm($a_sum[$e]['amount_vat'])?>
155 </td>
156 <td class="num">
157 <?=nbm($a_sum[$e]['amount_sided'])?>
158 </td>
159 </tr>
160<?php
161 endfor;
162
163 echo '<tr class="highlight">';
164 echo td();
165 echo td();
166 echo td(nbm($tot_wovat),' class="num" ');
167 echo td(nbm($tot_vat),' class="num" ');
168 echo td(nbm($tot_sided),' class="num" ');
169 echo '</tr>';
170 ?>
171</table>
172<?php
173$array = $this->get_summary_sale();
174
175
176?>
177<hr>
178<h2><?php echo _("Achat")?></h2>
179<?php
180$array=$this->get_row_purchase();
181$nb_array=count($array);
182$ledger="";
183$r=0;
185for ($i=0;$i < $nb_array;$i++):
186
187 if ( $ledger != $array[$i]['jrn_def_name']):
188 if ( $ledger != "") :
189 // last row with total
190 echo '<tr class="highlight">';
191 echo td();
192 echo td();
193 echo td(nbm($tot_wovat),' class="num" ');
194 echo td(nbm($tot_private),' class="num" ');
195 echo td(nbm($tot_vat),' class="num" ');
196 echo td(nbm($tot_sided),' class="num" ');
197 echo td(nbm($tot_noded_amount),' class="num" ');
198 echo td(nbm($tot_noded_tax),' class="num" ');
199 echo td(nbm($tot_noded_return),' class="num" ');
200 echo '</tr>';
201 echo '</table>';
202 endif;
203 $ledger=$array[$i]['jrn_def_name'];
204 //reinitialize sum
206
207 printf("<h3>%s</h3>",$ledger);
208 echo '<table class="result">';
209 echo '<tr>';
210 echo th(_("Code TVA"));
211 echo th(_("Taux"),'class="num"');
212 echo th(_("Montant HT"),'class="num"');
213 echo th(_("Privée"),'class="num"');
214 echo th(_("Montant TVA"),'class="num"');
215 echo th(_("Montant Autoliquidation"),'class="num"');
216 echo th(_("Montant Non Déd"),'class="num"');
217 echo th(_("TVA Non Déd"),'class="num"');
218 echo th(_("TVA Non Déd & récup"),'class="num"');
219 echo '</tr>';
220 $r=0;
221 endif;
222 $color=($r%2==0)?"even":"odd";
223 ?>
224 <tr class="<?php echo $color;?>">
225 <td>
226 <?=$array[$i]['tva_label']?>
227 </td>
228 <td>
229 <?=$array[$i]['tva_rate']*100?>%
230 </td>
231 <td class="num">
232 <?=nbm($array[$i]['amount_wovat'])?>
233 </td>
234 <td class="num">
235 <?=nbm($array[$i]['amount_private'])?>
236 </td>
237 <td class="num">
238 <?=nbm($array[$i]['amount_vat'])?>
239 </td>
240 <td class="num">
241 <?=nbm($array[$i]['amount_sided'])?>
242 </td>
243 <td class="num">
244 <?=nbm($array[$i]['amount_noded_amount'])?>
245 </td>
246 <td class="num">
247 <?=nbm($array[$i]['amount_noded_tax'])?>
248 </td>
249 <td class="num">
250 <?=nbm($array[$i]['amount_noded_return'])?>
251 </td>
252 </tr>
253 <?php
254 $tot_vat=bcadd($tot_vat,$array[$i]['amount_vat']);
255 $tot_wovat=bcadd($tot_wovat,$array[$i]['amount_wovat']);
256 $tot_sided=bcadd($tot_sided,$array[$i]['amount_sided']);
257 $tot_noded_amount=bcadd($tot_noded_amount,$array[$i]['amount_noded_amount']);
258 $tot_noded_tax=bcadd($tot_noded_tax,$array[$i]['amount_noded_tax']);
259 $tot_noded_return=bcadd($tot_noded_return,$array[$i]['amount_noded_return']);
260 $tot_private=bcadd($tot_private,$array[$i]['amount_private']);
261
262 ?>
263<?php endfor;?>
264<?php
265// last row with total
266 if ( $nb_array > 0):
267 echo '<tr class="highlight">';
268 echo td();
269 echo td();
270 echo td(nbm($tot_wovat),' class="num" ');
271 echo td(nbm($tot_private),' class="num" ');
272 echo td(nbm($tot_vat),' class="num" ');
273 echo td(nbm($tot_sided),' class="num" ');
274 echo td(nbm($tot_noded_amount),' class="num" ');
275 echo td(nbm($tot_noded_tax),' class="num" ');
276 echo td(nbm($tot_noded_return),' class="num" ');
277 echo '</tr>';
278else:
279 echo _("Aucune donnée");
280endif;
281echo '</table>';
282?>
283<h3><?=_("Résumé tous les journaux d'achat")?></h3>
284<?php
285$a_sum=$this->get_summary_purchase();
286?>
287<table class="result">
288 <tr>
289 <th>
290 <?=_("Code TVA")?>
291 </th>
292 <th>
293 <?=_("Taux")?>
294 </th>
295 <th class="num">
296 <?=_("Montant HT")?>
297 </th>
298 <th class="num">
299 <?=_("Privée")?>
300 </th>
301 <th class="num">
302 <?=_("Montant TVA")?>
303 </th>
304 <th class="num">
305 <?=_("Montant Autoliquidation")?>
306 </th>
307 <th class="num">
308 <?=_("Montant Non Déd")?>
309 </th>
310 <th class="num">
311 <?=_("TVA Non Déd")?>
312 </th>
313 <th class="num">
314 <?=_("TVA Non Déd & récup")?>
315 </th>
316 </tr>
317 <?php
318 $nb_sum=count($a_sum);
320
321 for ($e=0;$e < $nb_sum ; $e++):
322
323 ?>
324 <tr>
325
326 <td>
327 <?=$a_sum[$e]['tva_label']?>
328 </td>
329 <td class="num">
330 <?=$a_sum[$e]['tva_rate']*100?>%
331 </td>
332 <td class="num">
333 <?=nbm($a_sum[$e]['amount_wovat'])?>
334 </td>
335 <td class="num">
336 <?=nbm($a_sum[$e]['amount_private'])?>
337 </td>
338 <td class="num">
339 <?=nbm($a_sum[$e]['amount_vat'])?>
340 </td>
341 <td class="num">
342 <?=nbm($a_sum[$e]['amount_sided'])?>
343 </td>
344 <td class="num">
345 <?=nbm($a_sum[$e]['amount_noded_amount'])?>
346 </td>
347 <td class="num">
348 <?=nbm($a_sum[$e]['amount_noded_tax'])?>
349 </td>
350 <td class="num">
351 <?=nbm($a_sum[$e]['amount_noded_return'])?>
352 </td>
353 </tr>
354 <?php
355 $tot_vat=bcadd($tot_vat,$a_sum[$e]['amount_vat']);
356 $tot_wovat=bcadd($tot_wovat,$a_sum[$e]['amount_wovat']);
357 $tot_sided=bcadd($tot_sided,$a_sum[$e]['amount_sided']);
358 $tot_noded_amount=bcadd($tot_noded_amount,$a_sum[$e]['amount_noded_amount']);
359 $tot_noded_tax=bcadd($tot_noded_tax,$a_sum[$e]['amount_noded_tax']);
360 $tot_noded_return=bcadd($tot_noded_return,$a_sum[$e]['amount_noded_return']);
361 $tot_private=bcadd($tot_private,$a_sum[$e]['amount_private']);
362
363 endfor;
364
365 echo '<tr class="highlight">';
366 echo td();
367 echo td();
368 echo td(nbm($tot_wovat),' class="num" ');
369 echo td(nbm($tot_private),' class="num" ');
370 echo td(nbm($tot_vat),' class="num" ');
371 echo td(nbm($tot_sided),' class="num" ');
372 echo td(nbm($tot_noded_amount),' class="num" ');
373 echo td(nbm($tot_noded_tax),' class="num" ');
374 echo td(nbm($tot_noded_return),' class="num" ');
375 echo '</tr>';
376 ?>
377</table>
378</div>
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
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
$all table