diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index 9bc16b3ac..2e4876523 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -30,7 +30,10 @@ class Receivings extends Secure_area function select_supplier() { $supplier_id = $this->input->post('supplier'); - $this->receiving_lib->set_supplier($supplier_id); + if ($this->Supplier->exists($supplier_id)) + { + $this->receiving_lib->set_supplier($supplier_id); + } $this->_reload(); } diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 74bde6655..b53f09d0b 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -516,7 +516,7 @@ class Sales extends Secure_area { // substitute customer info $customer_id = $this->sale_lib->get_customer(); - if($customer_id != -1 && $cust_info != '' && $cust_info->last_name != '' && $cust_info->first_name != '') + if($customer_id != -1 && $cust_info != '') { $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));