noalyss Version-9
acc_ledger_history_purchase_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<table class="result">
30 <tr>
31 <th>
32 <?=_('Date')?>
33 </th>
34 <th>
35 <?=_('Date paiement')?>
36 </th>
37 <th>
38 <?=_('Pièce')?>
39 </th>
40 <th>
41 <?=_('Interne')?>
42 </th>
43 <th>
44 <?=_('Client')?>
45 </th>
46 <th>
47 <?=_('Description')?>
48 </th>
49 <th class="num">
50 <?=_('Devise TVAC')?>
51 </th>
52 <th class="num">
53 <?=_('HTVA')?>
54 </th>
55 <th class="num">
56 <?=_('TVA')?>
57 </th>
58 <th class="num">
59 <?=_('TVAC')?>
60 </th>
61 </tr>
62<?php
63$nb_data=count($this->data);
67for ($i=0;$i<$nb_data;$i++):
68 $odd=' class="odd" ';
69 $tot_amount_novat=bcadd($tot_amount_novat,$this->data[$i]['novat']);
70 $tot_amount_vat=bcadd($tot_amount_vat,$this->data[$i]['vat']);
71 $tot_amount_vat=bcsub($tot_amount_vat,$this->data[$i]['tva_sided']);
72 $tot_amount_tvac=bcadd($tot_amount_tvac,$this->data[$i]['tvac']);
73 $supp_tax=$this->data[$i]['supp_tax'];
74 $tot_other_tax=array_sum(array_column($supp_tax,'j_montant'));
75 $all_tax=bcadd($tot_other_tax,$this->data[$i]['vat']);
76?>
77 <tr <?=$odd?> >
78 <td>
79 <?=$this->data[$i]['str_date']?>
80 </td>
81 <td>
82 <?=$this->data[$i]['str_date_paid']?>
83 </td>
84 <td>
85 <?=$this->data[$i]['jr_pj_number']?>
86 </td>
87 <td>
88 <?=HtmlInput::detail_op($this->data[$i]['jr_id'], $this->data[$i]['jr_internal'])?>
89 </td>
90 <td>
91 <?=HtmlInput::history_card($this->data[$i]['qp_supplier'],h($this->data[$i]['name'].' '.$this->data[$i]['first_name']))?>
92 </td>
93 <td>
94 <?=h($this->data[$i]['jr_comment'])?>
95 </td>
96 <td class="num">
97 <?php if ($this->data[$i]['currency_id'] !=0) : ?>
98 <?=nbm(bcadd($this->data[$i]['sum_oc_amount'],$this->data[$i]['sum_oc_vat_amount'],4),2)?>
99 <?=$this->data[$i]['cr_code_iso']?>
100 <?php endif;?>
101 </td>
102 <td class="num">
103 <?=nbm($this->data[$i]['novat'])?>
104 </td>
105 <td class="num">
106 <?=nbm(bcsub($all_tax,$this->data[$i]['tva_sided']),2)?>
107 </td>
108 <td class="num">
109 <?=nbm(bcadd($this->data[$i]['tvac'],$tot_other_tax))?>
110 </td>
111 <td>
112
113 <?php
114 $ret_reconcile=$this->db->execute('reconcile_date',array($this->data[$i]['jr_id']));
116 if ($max > 0) {
117 $sep="";
118 for ($e=0;$e<$max;$e++) {
120 $msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
121 echo $sep.HtmlInput::detail_op($row['jr_id'],$row['jr_date'].' '. $msg);
122 $sep=' ,';
123 }
124 } ?>
125 </td>
126 </tr>
127 <tr>
128 <td></td>
129 <td></td>
130 <td class="width:auto" colspan="8" style="border-style: solid;border-width:1px;border-color: blue">
131<?php
132 /// Detail opération
133$det=$this->db->execute("detail_purchase",array($this->data[$i]['jr_internal']));
135?>
136 <table style="width: 100%">
137 <tr>
138 <th><?=_("Item")?></th>
139 <th class="num"><?=_("Prix Unit")?></th>
140 <th class="num"><?=_("Quantité")?></th>
141 <th class="num"><?=_("HTVA")?></th>
142 <th class="num"><?=_("TVA")?></th>
143 <th class="num"><?=_("Code TVA")?></th>
144 <th class="num"><?=_("TVAC")?></th>
145 </tr>
146<?php
147$nb_detail=($a_detail == FALSE)?0 : count($a_detail);
148for ($j=0;$j<$nb_detail;$j++):
149?>
150 <tr >
151 <td><?=$a_detail[$j]['qcode']?>
152 <?=$a_detail[$j]['name']?> </td>
153 <td class="num" style="width:10%"><?=$a_detail[$j]['qp_quantite']?> </td>
154 <td class="num" style="width:10%"><?=$a_detail[$j]['qp_unit']?> </td>
155 <td class="num" style="width:10%"><?=nbm($a_detail[$j]['qp_price'])?> </td>
156 <td class="num" style="width:10%"><?=nbm($a_detail[$j]['qp_vat'])?> </td>
157 <td class="num" style="width:10%"><?=$a_detail[$j]['tva_label']?> </td>
158 <td class="num" style="width:10%"><?=nbm($a_detail[$j]['tvac'])?> </td>
159 </tr>
160<?php
162?>
163 <?php
164 // print additional tax if any
165 $nb_supp_tax=count($this->data[$i]['supp_tax']);
166 for ($j=0;$j<$nb_supp_tax;$j++):
167 ?>
168 <tr>
169 <td><?=$this->data[$i]['supp_tax'][$j]['j_poste']?>
170 <?=$this->data[$i]['supp_tax'][$j]['ac_label']?>
171 </td>
172 <td></td>
173 <td></td>
174 <td></td>
175 <td></td>
176 <td></td>
177 <td class="num"><?=nbm($this->data[$i]['supp_tax'][$j]['j_montant'])?></td>
178 </tr>
179 <?php
180 endfor;
181 ?>
182 </table>
183 </td>
184 </tr>
185<?php
186 endfor;
187?>
188 <tfoot>
189 <tr class="highlight">
190 <td>
191 <?=_("Totaux")?>
192 </td>
193 <td></td>
194 <td></td>
195 <td></td>
196 <td></td>
197 <td></td>
198 <td><?=nbm($tot_amount_novat)?></td>
199 <td><?=nbm($tot_amount_vat)?></td>
200 <td><?=nbm($tot_amount_tvac)?></td>
201 <td></td>
202 <td></td>
203 </tr>
204 </tfoot>
205</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][ 'qp_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