Task #1762 , printtva peut mettre donner les totaux de tva

suivant l'exigibilité configuré par Code TVA , par date de paiement
ou par date d'opération
This commit is contained in:
Dany De Bontridder 2019-11-12 21:13:47 +01:00
parent 6b96cb0a44
commit 096169b987
39 changed files with 694 additions and 228 deletions

View file

@ -174,7 +174,7 @@ for ($i = 0; $i < $nb_sale; $i++) {
}
$pdf->line_new();
$nb_array = count($array);
$nb_array = count($a_sum);
// initialize totals
for ($e=2;$e<$nb_col;$e++){
$a_tot[$a_col[$e]]=0;
@ -187,14 +187,14 @@ for ($i = 0; $i < $nb_array; $i++) {
$colname=$a_col[$e];
if ( $e ==0 ) {
// first column TVA_LABEL
$pdf->write_cell(40, 5, $array[$i][$colname], 1, 0, 'L');
$pdf->write_cell(40, 5, $a_sum[$i][$colname], 1, 0, 'L');
} elseif ($e == 1 ){
// Secund col. tva rate
$pdf->write_cell(40, 5, nbm($array[$i][$colname]*100), 1, 0, 'R');
$pdf->write_cell(40, 5, nbm($a_sum[$i][$colname]*100), 1, 0, 'R');
}else {
// Other cols,display amount and compute total
$a_tot[$colname] = bcadd($a_tot[$colname], $array[$i][$colname]);
$pdf->write_cell(40, 5, nbm($array[$i][$colname]), 1, 0, 'R');
$a_tot[$colname] = bcadd($a_tot[$colname], $a_sum[$i][$colname]);
$pdf->write_cell(40, 5, nbm($a_sum[$i][$colname]), 1, 0, 'R');
}
}
$pdf->line_new();
@ -328,6 +328,7 @@ for ($e=0;$e<$nb_col;$e++){
}
$pdf->line_new();
$array=$tax_summary->get_summary_purchase();
$nb_array = count($array);
// initialize totals
for ($e=2;$e<$nb_col;$e++){