Skip to content

Commit 33f784b

Browse files
committed
fix: valori iva in stampa fattura
1 parent 1171364 commit 33f784b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

templates/fatture/body.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131

3232
// Calcolo ottimizzato delle righe da sottrarre
3333
$c = 0;
34-
foreach ($v_iva as $desc_iva => $tot_iva) {
35-
++$c;
36-
}
3734

3835
// Calcolo ottimizzato delle righe intestazione
3936
if ($f_sitoweb || $f_pec) {
@@ -102,9 +99,9 @@
10299
++$num;
103100
$r = $riga->toArray();
104101

105-
$v_totale[$r['desc_iva']] = sum($v_totale[$r['desc_iva']], $riga->totale_imponibile + $riga->rivalsainps);
102+
$v_totale[$r['desc_iva']] += $riga->totale_imponibile + $riga->rivalsainps;
106103
$aliquota = $database->fetchOne('SELECT percentuale FROM co_iva WHERE id = '.prepare($riga->idiva))['percentuale'];
107-
$v_iva[$r['desc_iva']] = sum($v_iva[$r['desc_iva']], $v_totale[$r['desc_iva']] * $aliquota / 100);
104+
$v_iva[$r['desc_iva']] += ($riga->totale_imponibile + $riga->rivalsainps) * $aliquota / 100;
108105

109106
echo '
110107
<tr>

0 commit comments

Comments
 (0)