1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-23 20:30:51 +01:00

Fix controllo totali fattura elettronica

This commit is contained in:
Matteo 2022-07-25 11:28:54 +02:00
parent 6de1dc9c72
commit 6dc29b3392

View File

@ -244,10 +244,20 @@ switch (post('op')) {
}
} catch (Exception $e) {
}
$calculated = 0;
$fattura->scadenze()->each(function($scadenza) use (&$calculated) {
$calculated += abs($scadenza->da_pagare);
});
if(empty($calculated)){
$calculated = $fattura->netto;
}
echo json_encode([
'stored' => round($totale_documento,2),
'calculated' => round($fattura->totale,2),
'calculated' => round($calculated,2),
]);
break;