From addbdce33c8f4fa15ff9c52fa2a3c5070f24f81c Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Tue, 2 Aug 2022 13:12:40 +0200 Subject: [PATCH] Fix controllo totale fattura --- modules/fatture/actions.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) 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;