Skip to content

Commit e532c63

Browse files
committed
fix: miglioria stampa fattura
1 parent bad1805 commit e532c63

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

templates/fatture/body.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,33 @@
2727

2828
// Creazione righe fantasma ottimizzata
2929
$autofill = new Util\Autofill(6, 70);
30-
if ($fattura_accompagnatoria) {
31-
$autofill->setRows(21, 0, 35);
32-
} else {
33-
$autofill->setRows(26, 0);
34-
}
30+
$rows_per_page = 25;
3531

3632
// Calcolo ottimizzato delle righe da sottrarre
3733
$c = 0;
3834
foreach ($v_iva as $desc_iva => $tot_iva) {
3935
++$c;
4036
}
4137

38+
// Calcolo ottimizzato delle righe intestazione
39+
if ($f_sitoweb || $f_pec) {
40+
++$c;
41+
}
42+
if ($destinazione) {
43+
$c += 2;
44+
}
45+
4246
// Gestione ottimizzata destinazione
4347
if ($destinazione) {
4448
$c += $codice_destinatario ? 2 : 1;
4549
}
4650

4751
// Diminuisco le righe disponibili per pagina
48-
$autofill->setRows($rows_per_page - $c, 0);
52+
if ($fattura_accompagnatoria) {
53+
$autofill->setRows(20 - $c, 0, 35);
54+
} else {
55+
$autofill->setRows($rows_per_page - $c, 0, 30);
56+
}
4957

5058
// Intestazione tabella per righe
5159
echo "

0 commit comments

Comments
 (0)