From e47f3ee5716df571318f9572b754f91362e2f09d Mon Sep 17 00:00:00 2001 From: Jeroen Peelaerts Date: Sun, 15 Nov 2020 17:01:20 +0100 Subject: [PATCH] Fix detailed sales report (#2967) --- application/models/reports/Detailed_sales.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index 307483aaf..f49dd556c 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -145,20 +145,20 @@ class Detailed_sales extends Report foreach($data['summary'] as $key=>$value) { $this->db->select(' - name, - category, - quantity_purchased, - item_location, - item_number, - description, - subtotal, - tax, - total, - cost, - profit, - discount, - discount_type, - sale_status'); + MAX(name) AS name, + MAX(category) AS category, + MAX(quantity_purchased) AS quantity_purchased, + MAX(item_location) AS item_location, + MAX(item_number) AS item_number, + MAX(description) AS description, + MAX(subtotal) AS subtotal, + MAX(tax) AS tax, + MAX(total) AS total, + MAX(cost) AS cost, + MAX(profit) AS profit, + MAX(discount) AS discount, + MAX(discount_type) AS discount_type, + MAX(sale_status) AS sale_status'); $this->db->from('sales_items_temp'); if(count($inputs['definition_ids']) > 0) {