mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 17:07:01 +01:00
Fix controllo totale fattura
This commit is contained in:
parent
90a4a3c6eb
commit
addbdce33c
@ -244,20 +244,10 @@ 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($calculated,2),
|
||||
'calculated' => round($fattura->netto,2),
|
||||
]);
|
||||
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user