diff --git a/modules/fatture/actions.php b/modules/fatture/actions.php index dd9d7a038..74fc62e89 100755 --- a/modules/fatture/actions.php +++ b/modules/fatture/actions.php @@ -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;