Fix controllo totale fattura

This commit is contained in:
MatteoPistorello 2022-08-02 13:12:40 +02:00
parent 90a4a3c6eb
commit addbdce33c
1 changed files with 1 additions and 11 deletions

View File

@ -245,19 +245,9 @@ switch (post('op')) {
} catch (Exception $e) { } 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([ echo json_encode([
'stored' => round($totale_documento,2), 'stored' => round($totale_documento,2),
'calculated' => round($calculated,2), 'calculated' => round($fattura->netto,2),
]); ]);
break; break;