From b36a03c4bcd3ef1895a323de9119bbaababc71f1 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 a3a7cd0f8..fcd37d922 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -668,7 +668,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')