mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-25 01:28:44 -04:00
Fix error message when searching for non existing customer in sales (#430)
This commit is contained in:
1 parent
d996ff29cb
commit
7d9013cb2d
1 file changed
+5
-3
@@ -147,8 +147,10 @@ class Sales extends Secure_area
|
||||
function select_customer()
|
||||
{
|
||||
$customer_id = $this->input->post('customer');
|
||||
$this->sale_lib->set_customer($customer_id);
|
||||
|
||||
if ($this->Customer->exists($customer_id))
|
||||
{
|
||||
$this->sale_lib->set_customer($customer_id);
|
||||
}
|
||||
$this->_reload();
|
||||
}
|
||||
|
||||
@@ -497,7 +499,7 @@ class Sales extends Secure_area
|
||||
{
|
||||
// substitute customer info
|
||||
$customer_id = $this->sale_lib->get_customer();
|
||||
if($customer_id != -1 && $cust_info != '')
|
||||
if($customer_id != -1 && $cust_info != '' && $cust_info->last_name != '' && $cust_info->first_name != '')
|
||||
{
|
||||
$text = str_replace('$CU',$cust_info->first_name . ' ' . $cust_info->last_name,$text);
|
||||
$words = preg_split("/\s+/", trim($cust_info->first_name . ' ' . $cust_info->last_name));
|
||||
|
||||
Reference in new issue
Block a user