From ff30021d3588a9971f3c9e8613d4b1e79abe449c Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 30 Nov 2020 16:50:12 +0100 Subject: [PATCH] =?UTF-8?q?Close=20#15307=20Encours=20dpass=C3=A9=20with?= =?UTF-8?q?=20eldy=20suggestions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/boxes/box_customers_outstanding_bill_reached.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index f3c358d2335..24690895ff5 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -103,6 +103,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $sql .= " AND s.entity IN (".getEntity('societe').")"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($user->socid) $sql .= " AND s.rowid = $user->socid"; + $sql .= " AND s.outstanding_limit > 0"; + $sql .= " AND s.rowid IN (SELECT fk_soc from ".MAIN_DB_PREFIX."facture as f WHERE f.fk_statut = 1 and f.fk_soc = s.rowid)"; $sql .= " ORDER BY s.tms DESC"; $sql .= $this->db->plimit($max, 0);