noalyss Version-9
acc_ledger_history_purchase_oneline.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
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
25/**
26 * @file
27 * @brief display purchase on one line with sum of VAT, Operation, Private exp.
28 * @todo prévoir aussi pour les non assujetti : faire disparaître les montants TVA
29 */
30bcscale(2);
31$p_col=($nb_other_tax<>0)?"0,1,2,3,4,5,6,7,8,9,10,11":"0,1,2,3,4,5,6,7,8,9,10,11,12";
32echo \HtmlInput::filter_table("tb_print_ledger", $p_col, 1);
33
34?>
35<table class="result" id="tb_print_ledger">
36 <tr>
37 <th>
38 <?=_('Date')?>
39 </th>
40 <th>
41 <?=_('Date paiement')?>
42 </th>
43 <th>
44 <?=_('Pièce')?>
45 </th>
46 <th>
47 <?=_('Interne')?>
48 </th>
49 <th>
50 <?=_('Client')?>
51 </th>
52 <th>
53 <?=_('Description')?>
54 </th>
55 <th class="text-center">
56 <?=_('HTVA')?>
57 </th>
58 <th class="text-center">
59 <?=_('Non ded')?>
60 </th>
61 <th class="text-center">
62 <?=_('TVA')?>
63 </th>
64 <?php if ($nb_other_tax<>0) :?>
65 <th class="text-center">
66 <?=_('Autre Taxe')?>
67 </th>
68 <?php endif;?>
69 <th class="text-center">
70 <?=_('TVAC')?>
71 </th>
72
73 <th class="text-center">
74 <?=_('Devise')?>
75 </th>
76 <th class="text-center">
77 <?=_('Lien')?>
78 </th>
79 </tr>
80<?php
81$nb_data=count($this->data);
89for ($i=0;$i<$nb_data;$i++):
90 $odd=($i%2==0)?' class="even" ':' class="odd" ';
91 $tot_amount_novat=bcadd($tot_amount_novat,$this->data[$i]['novat']);
92 $tot_amount_vat=bcadd($tot_amount_vat,$this->data[$i]['vat']);
93 $tot_amount_vat=bcsub($tot_amount_vat,$this->data[$i]['tva_sided']);
94 $tot_amount_tvac=bcadd($tot_amount_tvac,$this->data[$i]['tvac']);
95 $tot_amount_tvac=bcadd($tot_amount_tvac,$this->data[$i]['other_tax_amount']);
96 $tot_nonded_amount=bcadd($tot_nonded_amount,$this->data[$i]['noded_amount']);
97 $tot_nonded_amount=bcadd($tot_nonded_amount,$this->data[$i]['private_amount']);
98 $tot_nonded_vat=bcadd($tot_nonded_vat, $this->data[$i]['noded_vat']);
99 $tot_other_tax=bcadd($tot_other_tax,$this->data[$i]['other_tax_amount']);
100?>
101 <tr <?=$odd?> >
102 <td>
103 <?=$this->data[$i]['str_date']?>
104 </td>
105 <td>
106 <?=$this->data[$i]['str_date_paid']?>
107 </td>
108 <td>
109 <?=$this->data[$i]['jr_pj_number']?>
110 </td>
111 <td>
112 <?=HtmlInput::detail_op($this->data[$i]['jr_id'], $this->data[$i]['jr_internal'])?>
113 </td>
114 <td>
115 <?=HtmlInput::history_card($this->data[$i]['qp_supplier'],h($this->data[$i]['name'].' '.$this->data[$i]['first_name']." [ {$this->data[$i]['qcode']} ]"))?>
116 </td>
117 <td>
118 <?=h($this->data[$i]['jr_comment'])?>
119 </td>
120 <td class="num">
121 <?=nbm($this->data[$i]['novat'])?>
122 </td>
123 <td class="num">
124 <?=nbm(bcadd($this->data[$i]['noded_amount'],$this->data[$i]['private_amount']));?>
125 </td>
126 <td class="num">
127 <?=nbm(bcsub($this->data[$i]['vat'],$this->data[$i]['tva_sided']))?>
128 </td>
129 <?php if ($nb_other_tax<>0) :?>
130 <td class="num">
131 <?=nbm($this->data[$i]['other_tax_amount'])?>
132 </td>
133 <?php endif;?>
134
135 <td class="num">
136
137 <?=nbm(bcadd($this->data[$i]['other_tax_amount'] ,$this->data[$i]['tvac']))?>
138 </td>
139 <td class="num">
140 <?php if ( $this->data[$i]['currency_id'] != '0') : ?>
141 <?=nbm ( bcadd($this->data[$i]['sum_oc_amount'],$this->data[$i]['sum_oc_vat_amount'],2),2)?>
142 <?=$this->data[$i]['cr_code_iso']?>
143 <?php endif;?>
144 </td>
145 <td>
146
147 <?php
148 $ret_reconcile=$this->db->execute('reconcile_date',array($this->data[$i]['jr_id']));
150 if ($max > 0) {
151 $sep="";
152 for ($e=0;$e<$max;$e++) {
154 $msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
155 echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
156 $sep=' ,';
157 }
158 } ?>
159 </td>
160 </tr>
161<?php
163?>
164 <tfoot>
165 <tr class="highlight">
166 <td>
167 <?=_("Totaux")?>
168 </td>
169 <td></td>
170 <td></td>
171 <td></td>
172 <td></td>
173 <td></td>
174 <td class="num"><?=nbm($tot_amount_novat)?></td>
175 <td class="num"><?=nbm($tot_nonded_amount)?></td>
176 <td class="num"><?=nbm($tot_amount_vat)?></td>
177 <?php if ($nb_other_tax>0) :?>
178 <td class="num"><?=nbm($tot_other_tax)?></td>
179 <?php endif;?>
180 <td class="num"><?=nbm($tot_amount_tvac)?></td>
181 <td></td>
182 <td></td>
183 </tr>
184 </tfoot>
185</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
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
static echo_file($msg, $print=true)
display the file
Definition: dbg.php:88
$all table
$SecUser db