X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fincludes%2Fdb%2Fcustalloc_db.inc;h=1fa6995acad11cb81def1701502f8518501f5adb;hb=14b9fe75476f910c21dccfcf56f60b39d4567b4e;hp=6dc3ee0423dc359d65edd5c29e41470227ce70ff;hpb=46c5dc49d75f51084402491bfddbd69c306fce2d;p=fa-stable.git 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)";