More php8 deprecation fixes about required parameters following optional parameters.
[fa-stable.git] / sales / includes / db / custalloc_db.inc
index ec7c3afbea4a45d4de7be743f8a8a2f9dcc7329e..6dc3ee0423dc359d65edd5c29e41470227ce70ff 100644 (file)
@@ -98,7 +98,7 @@ function clear_cust_alloctions($type, $type_no, $person_id=null, $date="")
 }
 //-------------------------------------------------------------------------------------------------------------
 
-function get_allocatable_from_cust_sql($customer_id=null, $settled)
+function get_allocatable_from_cust_sql($customer_id, $settled)
 {
        $sql = "SELECT
                trans.type,
@@ -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);