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:
parent
6de1dc9c72
commit
6dc29b3392
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user