X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=sales%2Fincludes%2Fdb%2Fcustomers_db.inc;h=3f16159e46ddc434fe45048405ca60005e89fab7;hb=df671df0181c7b578bb75e07e581c5e9878e2aaa;hp=f9b111a0b70445160b0ec3612f357576d664bfec;hpb=2f3375b4493c1b1e0b17c2801298275f22f8d76e;p=fa-stable.git diff --git a/sales/includes/db/customers_db.inc b/sales/includes/db/customers_db.inc index f9b111a0..3f16159e 100644 --- a/sales/includes/db/customers_db.inc +++ b/sales/includes/db/customers_db.inc @@ -132,7 +132,7 @@ function get_customer_name($customer_id) $row = db_fetch_row($result); - return $row[0]; + return is_array($row) ? $row[0] : false; } function get_customer_habit($customer_id) @@ -165,6 +165,8 @@ function get_current_cust_credit($customer_id) { $custdet = get_customer_details($customer_id); + if (!is_array($custdet)) + return 0; return $custdet['credit_limit']-$custdet['Balance']; }