From: Janusz Dobrowolski Date: Tue, 30 Jul 2019 07:56:48 +0000 (+0200) Subject: Allocate Customer Payments or Credit Notes: fully allocated payments with discount... X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=36a48e114ff54339f3696f8d64024e9636762e90;hp=fe62f4fb15a36d7c62b2aa16acafdf8a09e4c7dc;p=fa-stable.git Allocate Customer Payments or Credit Notes: fully allocated payments with discount where still displayed even with settled option off, fixed. --- diff --git a/sales/includes/db/custalloc_db.inc b/sales/includes/db/custalloc_db.inc index ec7c3afb..a1f6a61c 100644 --- a/sales/includes/db/custalloc_db.inc +++ b/sales/includes/db/custalloc_db.inc @@ -124,7 +124,7 @@ function get_allocatable_from_cust_sql($customer_id=null, $settled) 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)"; + $sql .= " AND (round(abs(ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount-alloc),6) > 0)"; if ($customer_id != null) $sql .= " AND trans.debtor_no = ".db_escape($customer_id);