From 76e4ba06a42e68ce5b0a5ad05bee8645235715d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 25 Dec 2013 17:36:37 +0100 Subject: [PATCH] Fix: Calulcation of oustanding amount must not include abandonned invoices. --- htdocs/societe/class/societe.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ba48e3fb2df..664be4b9a05 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2886,7 +2886,9 @@ class Societe extends CommonObject $sql = "SELECT sum(total) as amount FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE fk_soc = ". $this->id; $sql .= " AND paye = 0"; - $sql .= " AND fk_statut <> 0"; + $sql .= " AND fk_statut <> 0"; // Not a draft + //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason + $sql .= " AND fk_statut <> 3"; // Not abandonned dol_syslog("get_OutstandingBill sql=".$sql); $resql=$this->db->query($sql);