Changed all numeric constants to the new defined constants. A huge task.
[fa-stable.git] / sales / includes / db / custalloc_db.inc
index addb867e50d1f04b9c61d8ad1c1b10c0c0fa46f3..9152a3f41142dbba608c1a3117168bb525c57673 100644 (file)
@@ -139,7 +139,7 @@ function get_allocatable_from_cust_sql($customer_id, $settled)
                $cust_sql = " AND trans.debtor_no = $customer_id";
 
        $sql = get_alloc_trans_sql("round(ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount-alloc,6) <= 0 AS settled",
-               "(type=12 OR type=11 OR type=2) AND (trans.ov_amount > 0) " . $settled_sql . $cust_sql);
+               "(type=".ST_CUSTPAYMENT." OR type=".ST_CUSTCREDIT." OR type=".ST_BANKDEPOSIT.") AND (trans.ov_amount > 0) " . $settled_sql . $cust_sql);
 
        return $sql;
 }
@@ -160,10 +160,10 @@ function get_allocatable_to_cust_transactions($customer_id, $trans_no=null, $typ
        else
        {
                $sql = get_alloc_trans_sql(null, "round(ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount-alloc,6) > 0
-                       AND trans.type != " . ST_CUSTPAYMENT . "
-                       AND trans.type != " . ST_BANKDEPOSIT . "
-                       AND trans.type != 11
-                       AND trans.type != 13
+                       AND trans.type <> " . ST_CUSTPAYMENT . "
+                       AND trans.type <> " . ST_BANKDEPOSIT . "
+                       AND trans.type <> " . ST_CUSTCREDIT . "
+                       AND trans.type <> " . ST_CUSTDELIVERY . "
                        AND trans.debtor_no=$customer_id");
        }