Miglioria stampa liquidazione iva #1281

This commit is contained in:
Pek5892 2023-04-13 10:56:14 +02:00
parent 0631684dbd
commit 0f1cf8bc2a
1 changed files with 11 additions and 3 deletions

View File

@ -45,6 +45,9 @@ $totale_iva_periodo_precedente = $totale_iva_vendite_periodo_precedente - $total
$totale_iva = $totale_iva_esigibile - $totale_iva_detraibile;
if ($periodo['valore'] == 'Trimestrale' && $totale_iva > 0) {
if ($totale_iva_periodo_precedente < 25.82 && $totale_iva_periodo_precedente > 0) {
$totale_iva += $totale_iva_periodo_precedente;
}
$maggiorazione = $totale_iva * 0.01;
$totale_iva_maggiorata = $totale_iva + $maggiorazione;
}
@ -258,7 +261,7 @@ echo '
</tr>
<tr>
<td>TOTALE IVA DETRAIBILI</td>
<td class=text-right>'.moneyFormat($totale_iva_detraibile, 2).'</td>
<td class=text-right>'.(empty($totale_iva_nondetraibile) ? '' : moneyformat($totale_iva_detraibile - $totale_iva_nondetraibile, 2)).'</td>
</tr>
<tr>
<td>VARIAZIONE DI IMPOSTA RELATIVE A PERIODI PRECEDENTI</td>';
@ -313,8 +316,13 @@ echo '
<tr>
<td>IMPORTO DA VERSARE</td>';
if ($totale_iva > 25.82) {
echo'
<td class=text-right>'.($periodo['valore'] == 'Mensile' ? moneyFormat($totale_iva, 2) : moneyFormat($totale_iva_maggiorata, 2)).'</td>';
if ($periodo['valore'] == 'Mensile' || ($totale_iva_periodo_precedente < 25.82 && $totale_iva_periodo_precedente > 0)) {
echo'
<td class=text-right>'.moneyFormat($totale_iva, 2).'</td>';
} else {
echo'
<td class=text-right>'.moneyFormat($totale_iva_maggiorata, 2).'</td>';
}
} else {
echo'
<td class=text-right></td>';