$row = db_fetch_row($result);
- return $row[0];
+ return is_array($row) ? $row[0] : false;
}
function get_customer_habit($customer_id)
{
$custdet = get_customer_details($customer_id);
+ if (!is_array($custdet))
+ return 0;
return $custdet['credit_limit']-$custdet['Balance'];
}
$result = db_query($sql, "Retreive currency of customer $customer_id");
$myrow=db_fetch_row($result);
- return $myrow[0];
+ return $myrow ? $myrow[0] : get_company_currency();
}
function get_customers_search($customer)