From 0fc702627ed7ed03967411b58909ce3d08049155 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 27 Aug 2018 23:52:58 +0200 Subject: [PATCH] Fix detailed reports (#68) --- application/models/Sale.php | 1 - application/models/reports/Detailed_receivings.php | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/application/models/Sale.php b/application/models/Sale.php index 95f320094..244050924 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -1192,7 +1192,6 @@ class Sale extends CI_Model MAX(' . $this->Item->get_item_name() . ') AS name, MAX(items.item_number) AS item_number, MAX(items.category) AS category, - MAX(definition_name) AS definition_name, MAX(items.supplier_id) AS supplier_id, MAX(sales_items.quantity_purchased) AS quantity_purchased, MAX(sales_items.item_cost_price) AS item_cost_price, diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index da25d0283..2b1eee10f 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -97,11 +97,9 @@ class Detailed_receivings extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, item_number, category, definition_name, quantity_purchased, serialnumber, total, discount_percent, item_location, receivings_items_temp.receiving_quantity'); + $this->db->select('name, item_number, category, quantity_purchased, serialnumber, total, discount_percent, item_location, receivings_items_temp.receiving_quantity'); $this->db->from('receivings_items_temp'); $this->db->join('items', 'receivings_items_temp.item_id = items.item_id'); - $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id', 'left'); - $this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'GROUP\'', 'left'); $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); $data['details'][$key] = $this->db->get()->result_array(); }