mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Fix controllo totale fattura
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user