From 45c0163a9d4628a04f13f0028ffe82efc26ae163 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 22 Feb 2016 08:51:18 +0000 Subject: [PATCH] Fix to sales edit server error when customer is '' (#337) --- application/controllers/Sales.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 2a24ea168..3f7bd3614 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -674,7 +674,7 @@ class Sales extends Secure_area $sale_data = array( 'sale_time' => $start_date_formatter->format('Y-m-d H:i:s'), - 'customer_id' => $this->input->post('customer_id'), + 'customer_id' => $this->input->post('customer_id') != '' ? $this->input->post('customer_id') : null, 'employee_id' => $this->input->post('employee_id'), 'comment' => $this->input->post('comment'), 'invoice_number' => $this->input->post('invoice_number')