Calcolo arrotondamento sull'imponibile FE se presente

This commit is contained in:
MatteoPistorello 2022-01-18 17:57:42 +01:00
parent 587e43cae2
commit 60dbabf7b7
1 changed files with 7 additions and 2 deletions

View File

@ -320,8 +320,13 @@ class FatturaOrdinaria extends FatturaElettronica
$fattura->refresh();
// Arrotondamenti differenti nella fattura XML
$totali_righe = array_column($righe, 'PrezzoTotale');
$totale_righe = sum($totali_righe, null, 2);
$dati_riepilogo = $this->getBody()['DatiBeniServizi']['DatiRiepilogo'];
if (!empty($dati_riepilogo['ImponibileImporto'])) {
$totale_righe = $dati_riepilogo['ImponibileImporto'];
} else {
$totali_righe = array_column($righe, 'PrezzoTotale');
$totale_righe = sum($totali_righe, null, 2);
}
$diff = round(abs($totale_righe) - abs($fattura->totale_imponibile), 2);
if (!empty($diff)) {