noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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 class="h-section"><?php echo _("Vente")?></h2>
31
32<?php
33bcscale(4);
34$array=$this->get_row_sale();
36$dossier_id=Dossier::id();
40
41for ($i=0;$i < $nb_array;$i++):
42
43 if ( $ledger != $array[$i]['jrn_def_name']):
44 if ( $ledger != "") :
45 // last row with total
46 echo '<tr class="highlight">';
47 echo td();
48 echo td();
49 echo td(nbm($tot_wovat),' class="num" ');
50 echo td(nbm($tot_vat),' class="num" ');
51 echo td(nbm($tot_sided),' class="num" ');
52 echo '</tr>';
53 echo '</table>';
55 $ledger=$array[$i]['jrn_def_name'];
56 //reinitialize sum
58
59 printf("<h3>%s</h3>",$ledger);
60 echo '<table class="result">';
61 echo '<tr>';
62 echo th(_("Code TVA"));
63 echo th(_("Taux"),'class="num"');
64 echo th(_("Montant HT"),'class="num"');
65 echo th(_("Montant TVA"),'class="num"');
66 echo th(_("Montant Autoliquidation"),'class="num"');
67 echo '</tr>';
68 $r=0;
69 endif;
70 $color=($r%2==0)?"even":"odd";
71?>
72<tr class="<?php echo $color;?>">
73 <td>
74 <?=$array[$i]['tva_label']?>
75 <?php
76 // add a link to see the detail in ajax : ajax_ledger.php
77 $js_detail = $this->build_link_detail($dossier_id, $this->date_start, $this->date_end,$array[$i]['jrn_def_id'], $array[$i]['qs_vat_code']);
78 ?>
79 <a href="javascript:void(0)" class="super" onclick="<?=$js_detail?>">Détails</a>
80 </td>
81 <td class="num">
82 <?=$array[$i]['tva_rate']*100?>%
83 </td>
84 <td class="num">
85 <?=nbm($array[$i]['amount_wovat'])?>
86 </td>
87 <td class="num">
88 <?=nbm($array[$i]['amount_vat'])?>
89 </td>
90 <td class="num">
91 <?=nbm($array[$i]['amount_sided'])?>
92 </td>
93</tr>
94 <?php
95 $tot_vat=bcadd($tot_vat,$array[$i]['amount_vat']);
96 $tot_wovat=bcadd($tot_wovat,$array[$i]['amount_wovat']);
97 $tot_sided=bcadd($tot_sided,$array[$i]['amount_sided']);
98
99 ?>
100<?php endfor;?>
101<?php
102if ( $nb_array > 0):
103// last row with total
104 echo '<tr class="highlight">';
105 echo td();
106 echo td();
107 echo td(nbm($tot_wovat),' class="num" ');
108 echo td(nbm($tot_vat),' class="num" ');
109 echo td(nbm($tot_sided),' class="num" ');
110 echo '</tr>';
111else:
112 echo _("Aucune donnée");
113endif;
114 echo '</table>';
115?>
116<h3><?=_("Résumé tous les journaux de vente")?></h3>
117<?php
118$a_sum=$this->get_summary_sale();
119?>
120<table class="result">
121 <tr>
122 <th>
123 <?=_("Code TVA")?>
124 </th>
125 <th>
126 <?=_("Taux")?>
127 </th>
128 <th class="num">
129 <?=_("Montant HT")?>
130 </th>
131 <th class="num">
132 <?=_("Montant TVA")?>
133 </th>
134 <th class="num">
135 <?=_("Montant Autoliquidation")?>
136 </th>
137 </tr>
138 <?php
141
142 for ($e=0;$e < $nb_sum ; $e++):
143 $tot_vat=bcadd($tot_vat,$a_sum[$e]['amount_vat']);
144 $tot_wovat=bcadd($tot_wovat,$a_sum[$e]['amount_wovat']);
145 $tot_sided=bcadd($tot_sided,$a_sum[$e]['amount_sided']);
146
147 ?>
148 <tr>
149
150 <td>
151 <?=$a_sum[$e]['tva_label']?>
152
153 </td>
154 <td class="num">
155 <?=$a_sum[$e]['tva_rate']*100?>%
156 </td>
157 <td class="num">
158 <?=nbm($a_sum[$e]['amount_wovat'])?>
159 </td>
160 <td class="num">
161 <?=nbm($a_sum[$e]['amount_vat'])?>
162 </td>
163 <td class="num">
164 <?=nbm($a_sum[$e]['amount_sided'])?>
165 </td>
166 </tr>
167<?php
168 endfor;
169
170 echo '<tr class="highlight">';
171 echo td();
172 echo td();
173 echo td(nbm($tot_wovat),' class="num" ');
174 echo td(nbm($tot_vat),' class="num" ');
175 echo td(nbm($tot_sided),' class="num" ');
176 echo '</tr>';
177 ?>
178</table>
179<?php
180$array = $this->get_summary_sale();
181
182
183?>
184<hr>
185<h2 class="h-section"><?php echo _("Achat")?></h2>
186<?php
187$array=$this->get_row_purchase();
188$nb_array=count($array);
189$ledger="";
190$r=0;
192for ($i=0;$i < $nb_array;$i++):
193
194 if ( $ledger != $array[$i]['jrn_def_name']):
195 if ( $ledger != "") :
196 // last row with total
197 echo '<tr class="highlight">';
198 echo td();
199 echo td();
200 echo td(nbm($tot_wovat),' class="num" ');
201 echo td(nbm($tot_private),' class="num" ');
202 echo td(nbm($tot_vat),' class="num" ');
203 echo td(nbm($tot_sided),' class="num" ');
204 echo td(nbm($tot_noded_amount),' class="num" ');
205 echo td(nbm($tot_noded_tax),' class="num" ');
206 echo td(nbm($tot_noded_return),' class="num" ');
207 echo '</tr>';
208 echo '</table>';
209 endif;
210 $ledger=$array[$i]['jrn_def_name'];
211 //reinitialize sum
213
214 printf("<h3>%s</h3>",$ledger);
215 echo '<table class="result">';
216 echo '<tr>';
217 echo th(_("Code TVA"));
218 echo th(_("Taux"),'class="num"');
219 echo th(_("Montant HT"),'class="num"');
220 echo th(_("Privée"),'class="num"');
221 echo th(_("Montant TVA"),'class="num"');
222 echo th(_("Montant Autoliquidation"),'class="num"');
223 echo th(_("Montant Non Déd"),'class="num"');
224 echo th(_("TVA Non Déd"),'class="num"');
225 echo th(_("TVA Non Déd & récup"),'class="num"');
226 echo '</tr>';
227 $r=0;
228 endif;
229 $color=($r%2==0)?"even":"odd";
230 ?>
231 <tr class="<?php echo $color;?>">
232 <td>
233 <?=$array[$i]['tva_label']?>
234 <?php
235 // add a link to see the detail in ajax : ajax_ledger.php
236 $js_detail = $this->build_link_detail($dossier_id, $this->date_start, $this->date_end,$array[$i]['jrn_def_id'], $array[$i]['qp_vat_code']);
237 ?>
238 <a href="javascript:void(0)" onclick="<?=$js_detail?>" class="super">Détails</a>
239 </td>
240 <td>
241 <?=$array[$i]['tva_rate']*100?>%
242 </td>
243 <td class="num">
244 <?=nbm($array[$i]['amount_wovat'])?>
245 </td>
246 <td class="num">
247 <?=nbm($array[$i]['amount_private'])?>
248 </td>
249 <td class="num">
250 <?=nbm($array[$i]['amount_vat'])?>
251 </td>
252 <td class="num">
253 <?=nbm($array[$i]['amount_sided'])?>
254 </td>
255 <td class="num">
256 <?=nbm($array[$i]['amount_noded_amount'])?>
257 </td>
258 <td class="num">
259 <?=nbm($array[$i]['amount_noded_tax'])?>
260 </td>
261 <td class="num">
262 <?=nbm($array[$i]['amount_noded_return'])?>
263 </td>
264 </tr>
265 <?php
266 $tot_vat=bcadd($tot_vat,$array[$i]['amount_vat']);
267 $tot_wovat=bcadd($tot_wovat,$array[$i]['amount_wovat']);
268 $tot_sided=bcadd($tot_sided,$array[$i]['amount_sided']);
269 $tot_noded_amount=bcadd($tot_noded_amount,$array[$i]['amount_noded_amount']);
270 $tot_noded_tax=bcadd($tot_noded_tax,$array[$i]['amount_noded_tax']);
271 $tot_noded_return=bcadd($tot_noded_return,$array[$i]['amount_noded_return']);
272 $tot_private=bcadd($tot_private,$array[$i]['amount_private']);
273
274 ?>
275<?php endfor;?>
276<?php
277// last row with total
278 if ( $nb_array > 0):
279 echo '<tr class="highlight">';
280 echo td();
281 echo td();
282 echo td(nbm($tot_wovat),' class="num" ');
283 echo td(nbm($tot_private),' class="num" ');
284 echo td(nbm($tot_vat),' class="num" ');
285 echo td(nbm($tot_sided),' class="num" ');
286 echo td(nbm($tot_noded_amount),' class="num" ');
287 echo td(nbm($tot_noded_tax),' class="num" ');
288 echo td(nbm($tot_noded_return),' class="num" ');
289 echo '</tr>';
290else:
291 echo _("Aucune donnée");
292endif;
293echo '</table>';
294?>
295<h3><?=_("Résumé tous les journaux d'achat")?></h3>
296<?php
297$a_sum=$this->get_summary_purchase();
298?>
299<table class="result">
300 <tr>
301 <th>
302 <?=_("Code TVA")?>
303 </th>
304 <th>
305 <?=_("Taux")?>
306 </th>
307 <th class="num">
308 <?=_("Montant HT")?>
309 </th>
310 <th class="num">
311 <?=_("Privée")?>
312 </th>
313 <th class="num">
314 <?=_("Montant TVA")?>
315 </th>
316 <th class="num">
317 <?=_("Montant Autoliquidation")?>
318 </th>
319 <th class="num">
320 <?=_("Montant Non Déd")?>
321 </th>
322 <th class="num">
323 <?=_("TVA Non Déd")?>
324 </th>
325 <th class="num">
326 <?=_("TVA Non Déd & récup")?>
327 </th>
328 </tr>
329 <?php
330 $nb_sum=count($a_sum);
332
333 for ($e=0;$e < $nb_sum ; $e++):
334
335 ?>
336 <tr>
337
338 <td>
339 <?=$a_sum[$e]['tva_label']?>
340 </td>
341 <td class="num">
342 <?=$a_sum[$e]['tva_rate']*100?>%
343 </td>
344 <td class="num">
345 <?=nbm($a_sum[$e]['amount_wovat'])?>
346 </td>
347 <td class="num">
348 <?=nbm($a_sum[$e]['amount_private'])?>
349 </td>
350 <td class="num">
351 <?=nbm($a_sum[$e]['amount_vat'])?>
352 </td>
353 <td class="num">
354 <?=nbm($a_sum[$e]['amount_sided'])?>
355 </td>
356 <td class="num">
357 <?=nbm($a_sum[$e]['amount_noded_amount'])?>
358 </td>
359 <td class="num">
360 <?=nbm($a_sum[$e]['amount_noded_tax'])?>
361 </td>
362 <td class="num">
363 <?=nbm($a_sum[$e]['amount_noded_return'])?>
364 </td>
365 </tr>
366 <?php
367 $tot_vat=bcadd($tot_vat,$a_sum[$e]['amount_vat']);
368 $tot_wovat=bcadd($tot_wovat,$a_sum[$e]['amount_wovat']);
369 $tot_sided=bcadd($tot_sided,$a_sum[$e]['amount_sided']);
370 $tot_noded_amount=bcadd($tot_noded_amount,$a_sum[$e]['amount_noded_amount']);
371 $tot_noded_tax=bcadd($tot_noded_tax,$a_sum[$e]['amount_noded_tax']);
372 $tot_noded_return=bcadd($tot_noded_return,$a_sum[$e]['amount_noded_return']);
373 $tot_private=bcadd($tot_private,$a_sum[$e]['amount_private']);
374
375 endfor;
376
377 echo '<tr class="highlight">';
378 echo td();
379 echo td();
380 echo td(nbm($tot_wovat),' class="num" ');
381 echo td(nbm($tot_private),' class="num" ');
382 echo td(nbm($tot_vat),' class="num" ');
383 echo td(nbm($tot_sided),' class="num" ');
384 echo td(nbm($tot_noded_amount),' class="num" ');
385 echo td(nbm($tot_noded_tax),' class="num" ');
386 echo td(nbm($tot_noded_return),' class="num" ');
387 echo '</tr>';
388 ?>
389</table>
390</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.
$dossier_id
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
_("actif, passif,charge,...")
$all table
for($e=2;$e< $nb_col;$e++) $a_sum