From a7ecec4bd331c82952865bbfc10aab436f8db79f Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 25 Mar 2018 14:39:52 +0100 Subject: [PATCH] Small code refactoring (#1896) --- application/models/reports/Summary_report.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/application/models/reports/Summary_report.php b/application/models/reports/Summary_report.php index b454757ad..a974336e4 100644 --- a/application/models/reports/Summary_report.php +++ b/application/models/reports/Summary_report.php @@ -92,39 +92,39 @@ abstract class Summary_report extends Report if($inputs['sale_type'] == 'complete') { - $this->db->where('sale_status', COMPLETED); + $this->db->where('sales.sale_status', COMPLETED); $this->db->group_start(); - $this->db->where('sale_type', SALE_TYPE_POS); - $this->db->or_where('sale_type', SALE_TYPE_INVOICE); - $this->db->or_where('sale_type', SALE_TYPE_RETURN); + $this->db->where('sales.sale_type', SALE_TYPE_POS); + $this->db->or_where('sales.sale_type', SALE_TYPE_INVOICE); + $this->db->or_where('sales.sale_type', SALE_TYPE_RETURN); $this->db->group_end(); } elseif($inputs['sale_type'] == 'sales') { - $this->db->where('sale_status', COMPLETED); + $this->db->where('sales.sale_status', COMPLETED); $this->db->group_start(); - $this->db->where('sale_type', SALE_TYPE_POS); - $this->db->or_where('sale_type', SALE_TYPE_INVOICE); + $this->db->where('sales.sale_type', SALE_TYPE_POS); + $this->db->or_where('sales.sale_type', SALE_TYPE_INVOICE); $this->db->group_end(); } elseif($inputs['sale_type'] == 'quotes') { - $this->db->where('sale_status', SUSPENDED); - $this->db->where('sale_type', SALE_TYPE_QUOTE); + $this->db->where('sales.sale_status', SUSPENDED); + $this->db->where('sales.sale_type', SALE_TYPE_QUOTE); } elseif($inputs['sale_type'] == 'work_orders') { - $this->db->where('sale_status', SUSPENDED); - $this->db->where('sale_type', SALE_TYPE_WORK_ORDER); + $this->db->where('sales.sale_status', SUSPENDED); + $this->db->where('sales.sale_type', SALE_TYPE_WORK_ORDER); } elseif($inputs['sale_type'] == 'canceled') { - $this->db->where('sale_status', CANCELED); + $this->db->where('sales.sale_status', CANCELED); } elseif($inputs['sale_type'] == 'returns') { - $this->db->where('sale_status', COMPLETED); - $this->db->where('sale_type', SALE_TYPE_RETURN); + $this->db->where('sales.sale_status', COMPLETED); + $this->db->where('sales.sale_type', SALE_TYPE_RETURN); } }