Mysqli errors: Trying to access array offset on value of type bool. Fixed. Please...
[fa-stable.git] / sales / includes / db / cust_trans_db.inc
index 888181ebae9b811a4b04c863364e5a488d8879ad..a68063b8ff8f0cc315c0ddd09911e79b8c5bced5 100644 (file)
@@ -125,6 +125,7 @@ function get_customer_trans($trans_id, $trans_type, $customer_id=null)
        $sql = "SELECT trans.*,"
                ."ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total,"
                ."cust.name AS DebtorName, cust.address, "
+               ."cust.debtor_ref, "
                ."cust.curr_code, "
                ."cust.tax_id,
                trans.prep_amount>0 as prepaid,"
@@ -243,7 +244,7 @@ function get_customer_trans_order($type, $type_no)
 
        $row = db_fetch_row($result);
 
-       return $row[0];
+       return is_array($row) ? $row[0] : false;
 }
 
 //----------------------------------------------------------------------------------------