noalyss Version-9
acc_ledger_history_sale_oneline.php
Go to the documentation of this file.
1<?php
2
3/*
4 * Copyright (C) 2018 Dany De Bontridder <dany@alchimerys.be>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program 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 this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21
22/***
23 * @file
24 * @brief
25 * @todo prévoir aussi pour les non assujetti : faire disparaître les montants TVA
26 */
27$p_col=($nb_other_tax<>0)?"0,1,2,3,4,5,6,7,8,9,10":"0,1,2,3,4,5,6,7,8,9,10,11";
28echo \HtmlInput::filter_table("tb_print_ledger", $p_col, 1);
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="text-center">
52 <?=_('HTVA')?>
53 </th>
54
55 <th class="text-center">
56 <?=_('TVA')?>
57 </th>
58<?php if ($nb_other_tax>0) :?>
59 <th class="text-center">
60 <?=_('Autre Taxe')?>
61 </th>
62<?php endif;?>
63 <th class="text-center">
64 <?=_('TVAC')?>
65 </th>
66 <th class="text-center">
67 <?=_('Devise')?>
68 </th>
69 <th class="text-center">
70 <?=_('Lien')?>
71 </th>
72 </tr>
73<?php
74$nb_data=count($this->data);
79for ($i=0;$i<$nb_data;$i++):
80 $odd=($i%2==0)?' class="even" ':' class="odd" ';
81 $tot_amount_novat=bcadd($tot_amount_novat,$this->data[$i]['novat']);
82 $tot_amount_vat=bcadd($tot_amount_vat,$this->data[$i]['vat']);
83 $tot_amount_vat=bcsub($tot_amount_vat,$this->data[$i]['tva_sided']);
84 $tot_amount_tvac=bcadd($tot_amount_tvac,$this->data[$i]['tvac']);
85 $tot_amount_tvac=bcadd($tot_amount_tvac,$this->data[$i]['other_tax_amount']);
86 $tot_other_tax=bcadd($tot_other_tax,$this->data[$i]['other_tax_amount']);
87?>
88 <tr <?=$odd?> >
89 <td>
90 <?=$this->data[$i]['str_date']?>
91 </td>
92 <td>
93 <?=$this->data[$i]['str_date_paid']?>
94 </td>
95 <td>
96 <?=$this->data[$i]['jr_pj_number']?>
97 </td>
98 <td>
99 <?=HtmlInput::detail_op($this->data[$i]['jr_id'], $this->data[$i]['jr_internal'])?>
100 </td>
101 <td>
102 <?=HtmlInput::history_card($this->data[$i]['qs_client'],h($this->data[$i]['name'].' '.$this->data[$i]['first_name']." [ {$this->data[$i]['qcode']} ]"))?>
103 </td>
104 <td>
105 <?=h($this->data[$i]['jr_comment'])?>
106 </td>
107 <td class="num">
108 <?=nbm($this->data[$i]['novat'])?>
109 </td>
110 <td class="num">
111 <?=nbm(bcsub($this->data[$i]['vat'],$this->data[$i]['tva_sided']))?>
112 </td>
113 <?php if ($nb_other_tax>0) :?>
114 <td class="num">
115 <?=nbm($this->data[$i]['other_tax_amount'])?>
116 </td>
117<?php endif;?>
118 <td class="num">
119 <?=nbm(bcadd($this->data[$i]['other_tax_amount'] ,$this->data[$i]['tvac']))?>
120 </td>
121 <td class="num">
122
123 <?php if ( $this->data[$i]['currency_id'] != '0') : ?>
124 <?=nbm ( bcadd($this->data[$i]['sum_oc_amount'],$this->data[$i]['sum_oc_vat_amount']),2)?>
125 <?=$this->data[$i]['cr_code_iso']?>
126 <?php endif;?>
127 </td>
128 <td>
129
130 <?php
131 $ret_reconcile=$this->db->execute('reconcile_date',array($this->data[$i]['jr_id']));
133 if ($max > 0) {
134 $sep="";
135 for ($e=0;$e<$max;$e++) {
137 $msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
138 echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
139 $sep=' ,';
140 }
141 } ?>
142 </td>
143
144 </tr>
145<?php
147?>
148 <tfoot>
149 <tr class="highlight">
150 <td>
151 <?=_("Totaux")?>
152 </td>
153 <td></td>
154 <td></td>
155 <td></td>
156 <td></td>
157 <td></td>
158 <td class="num"><?=nbm($tot_amount_novat)?></td>
159 <td class="num"><?=nbm($tot_amount_vat)?></td>
160 <?php if ($nb_other_tax>0) :?>
161 <td class="num"><?=nbm($tot_other_tax)?></td>
162 <?php endif;?>
163 <td class="num"><?=nbm($tot_amount_tvac)?></td>
164 <td></td>
165 <td></td>
166 </tr>
167 </tfoot>
168</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) endfor
for( $i=0; $i< $nb_data; $i++)( $i%2==0)?' class endif
h( $row[ 'oa_description'])
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