From 87f8e80fb96e292d1f343d254a37374be54daa33 Mon Sep 17 00:00:00 2001 From: Bacca97 Date: Tue, 17 Apr 2018 18:24:02 +0200 Subject: [PATCH] Bugfix: sistemato calcolo stato fattura in aggiunta prima nota --- modules/primanota/actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/primanota/actions.php b/modules/primanota/actions.php index 5fda2c3f7..f76fbf2d0 100644 --- a/modules/primanota/actions.php +++ b/modules/primanota/actions.php @@ -61,7 +61,7 @@ switch (post('op')) { $rs = $dbo->fetchArray($query); // Aggiorno lo stato della fattura - if ($rs[0]['tot_pagato'] == $rs[0]['tot_da_pagare']) { + if (abs($rs[0]['tot_pagato']) == abs($rs[0]['tot_da_pagare'])) { $dbo->query("UPDATE co_documenti SET idstatodocumento=(SELECT id FROM co_statidocumento WHERE descrizione='Pagato') WHERE id=".prepare($iddocumento)); } else { $dbo->query("UPDATE co_documenti SET idstatodocumento=(SELECT id FROM co_statidocumento WHERE descrizione='Parzialmente pagato') WHERE id=".prepare($iddocumento));