noalyss
Version-9
include
template
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
*/
27
bcscale(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);
64
$tot_amount_novat
=0;
65
$tot_amount_vat
=0;
66
$tot_amount_tvac
=0;
67
for
(
$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'
]));
115
$max
=
Database::num_row
(
$ret_reconcile
);
116
if
(
$max
> 0) {
117
$sep
=
""
;
118
for
(
$e
=0;
$e
<
$max
;
$e
++) {
119
$row
=
Database::fetch_array
(
$ret_reconcile
,
$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'
]));
134
$a_detail
=
Database::fetch_all
(
$det
);
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
);
148
for
($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
161
endfor
;
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
th($p_string, $p_extra='', $raw='')
Definition:
ac_common.php:58
tr
tr($p_string, $p_extra='')
Definition:
ac_common.php:88
td
td($p_string='', $p_extra='')
surround the string with td
Definition:
ac_common.php:83
nbm
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition:
ac_common.php:137
$sep
$sep
Definition:
acc_ledger-input_extra_info.php:52
$det
if($max > 0) $det
Detail opération.
Definition:
acc_ledger_history_purchase_extended.php:133
$tot_amount_novat
$tot_amount_novat
Definition:
acc_ledger_history_purchase_extended.php:64
$tot_other_tax
$tot_other_tax
Definition:
acc_ledger_history_purchase_extended.php:74
$supp_tax
$supp_tax
Definition:
acc_ledger_history_purchase_extended.php:73
$nb_supp_tax
$nb_supp_tax
Definition:
acc_ledger_history_purchase_extended.php:165
$nb_detail
$nb_detail
Definition:
acc_ledger_history_purchase_extended.php:147
$max
$max
Definition:
acc_ledger_history_purchase_extended.php:115
$tot_amount_vat
$tot_amount_vat
Definition:
acc_ledger_history_purchase_extended.php:65
endif
if( $this->data[ $i][ 'currency_id'] !=0)(bcadd( $this->data[ $i][ 'sum_oc_amount'], $this->data[ $i][ 'sum_oc_vat_amount'], 4), 2)?><? endif
Definition:
acc_ledger_history_purchase_extended.php:97
$all_tax
$all_tax
Definition:
acc_ledger_history_purchase_extended.php:75
$a_detail
$a_detail
Definition:
acc_ledger_history_purchase_extended.php:134
endfor
for( $j=0; $j< $nb_detail; $j++)( $a_detail[ $j][ 'qp_price'])?></td >< td class endfor
Definition:
acc_ledger_history_purchase_extended.php:158
$nb_data
$nb_data
Definition:
acc_ledger_history_purchase_extended.php:63
$ret_reconcile
$ret_reconcile
Definition:
acc_ledger_history_purchase_extended.php:114
$tot_amount_tvac
$tot_amount_tvac
Definition:
acc_ledger_history_purchase_extended.php:66
$i
$i
Definition:
action_document_type_mtable_input.php:83
h
h( $row[ 'oa_description'])
Definition:
ajax_anc_detail_operation.php:46
$row
$row
Definition:
ajax_anc_detail_operation.php:33
$msg
$msg
Definition:
ajax_create_menu.php:10
style
$opd_description style
Definition:
ajax_mod_predf_op.php:52
DatabaseCore\fetch_all
static fetch_all($ret)
wrapper for the function pg_fetch_all
Definition:
database_core.class.php:768
DatabaseCore\fetch_array
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
Definition:
database_core.class.php:757
DatabaseCore\num_row
static num_row($ret)
wrapper for the function pg_num_rows
Definition:
database_core.class.php:744
HtmlInput\detail_op
static detail_op($p_jr_id, $p_mesg)
return a string containing the html code for calling the modifyOperation
Definition:
html_input.class.php:289
HtmlInput\history_card
static history_card($f_id, $p_mesg, $p_style="", $p_exercice="")
display a div with the history of the card
Definition:
html_input.class.php:329
table
$all table
Definition:
company.inc.php:142
db
$SecUser db
Definition:
export_security_pdf.php:118
$e
$e
Definition:
result_cat_card_summary.php:26