From df6f118a798dd53a860ef326ea495f3053e748dc Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Tue, 5 Jul 2016 21:51:15 +0100 Subject: [PATCH] Fixed search customer bug in sales Takings (#654) --- application/controllers/Sales.php | 2 +- application/models/Sale.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index e046058e7..828cc0e23 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -65,7 +65,7 @@ class Sales extends Secure_Controller $sort = $this->input->get('sort'); $order = $this->input->get('order'); - $is_valid_receipt = isset($search) ? $this->sale_lib->is_valid_receipt($search) : FALSE; + $is_valid_receipt = !empty($search) ? $this->sale_lib->is_valid_receipt($search) : FALSE; $filters = array('sale_type' => 'all', 'location_id' => 'all', diff --git a/application/models/Sale.php b/application/models/Sale.php index ffe12547e..24c65f9b2 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -81,12 +81,12 @@ class Sale extends CI_Model $this->db->group_by('sale_id'); $this->db->order_by($sort, $order); - + if($rows > 0) { $this->db->limit($rows, $limit_from); } - + return $this->db->get(); }