From 14b9fe75476f910c21dccfcf56f60b39d4567b4e Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 26 Oct 2021 15:22:24 +0200 Subject: [PATCH] Bug 4530. Customers with 0 left to allocate shown on Customer Allocations when using Journal Entry for paying. Fixed. --- sales/includes/db/custalloc_db.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sales/includes/db/custalloc_db.inc b/sales/includes/db/custalloc_db.inc index 6dc3ee04..1fa6995a 100644 --- a/sales/includes/db/custalloc_db.inc +++ b/sales/includes/db/custalloc_db.inc @@ -121,7 +121,7 @@ function get_allocatable_from_cust_sql($customer_id, $settled) ." WHERE trans.debtor_no=debtor.debtor_no AND (((type=".ST_CUSTPAYMENT." OR type=".ST_BANKDEPOSIT.") AND (trans.ov_amount > 0)) OR (type=".ST_CUSTCREDIT. " AND (ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount)>0) - OR (type=".ST_JOURNAL. " AND (trans.ov_amount < 0)))"; + OR (type=".ST_JOURNAL. " AND (trans.ov_amount > 0)))"; if (!$settled) $sql .= " AND (round(abs(ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount-alloc),6) > 0)"; -- 2.30.2