From: Joe Hunt Date: Tue, 26 Oct 2021 13:22:24 +0000 (+0200) Subject: Bug 4530. Customers with 0 left to allocate shown on Customer Allocations when using... X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=14b9fe75476f910c21dccfcf56f60b39d4567b4e Bug 4530. Customers with 0 left to allocate shown on Customer Allocations when using Journal Entry for paying. Fixed. --- 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)";