From 37189ba1f317d6403b5718f2a8341fe2841cb08d Mon Sep 17 00:00:00 2001 From: PICCORO Lenz McKAY Date: Mon, 2 Sep 2019 22:34:30 -0430 Subject: [PATCH] added category column to the inventory summary report due huge product data closes https://github.com/opensourcepos/opensourcepos/issues/2526 --- application/controllers/Reports.php | 1 + application/models/reports/Inventory_summary.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index aba08ca7f..044329c3c 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1547,6 +1547,7 @@ class Reports extends Secure_Controller $tabular_data[] = $this->xss_clean(array( 'item_name' => $row['name'], 'item_number' => $row['item_number'], + 'category' => $row['category'], 'quantity' => to_quantity_decimals($row['quantity']), 'low_sell_quantity' => to_quantity_decimals($row['low_sell_quantity']), 'reorder_level' => to_quantity_decimals($row['reorder_level']), diff --git a/application/models/reports/Inventory_summary.php b/application/models/reports/Inventory_summary.php index 2a88c6074..e8bc5dde1 100644 --- a/application/models/reports/Inventory_summary.php +++ b/application/models/reports/Inventory_summary.php @@ -8,6 +8,7 @@ class Inventory_summary extends Report { return array(array('item_name' => $this->lang->line('reports_item_name')), array('item_number' => $this->lang->line('reports_item_number')), + array('category' => $this->lang->line('reports_category')), array('quantity' => $this->lang->line('reports_quantity')), array('low_sell_quantity' => $this->lang->line('reports_low_sell_quantity')), array('reorder_level' => $this->lang->line('reports_reorder_level')), @@ -19,7 +20,7 @@ class Inventory_summary extends Report public function getData(array $inputs) { - $this->db->select($this->Item->get_item_name('name') . ', items.item_number, item_quantities.quantity, (item_quantities.quantity * items.qty_per_pack) as low_sell_quantity, items.reorder_level, stock_locations.location_name, items.cost_price, items.unit_price, (items.cost_price * item_quantities.quantity) AS sub_total_value'); + $this->db->select($this->Item->get_item_name('name') . ', items.item_number, items.category, item_quantities.quantity, (item_quantities.quantity * items.qty_per_pack) as low_sell_quantity, items.reorder_level, stock_locations.location_name, items.cost_price, items.unit_price, (items.cost_price * item_quantities.quantity) AS sub_total_value'); $this->db->from('items AS items'); $this->db->join('item_quantities AS item_quantities', 'items.item_id = item_quantities.item_id'); $this->db->join('stock_locations AS stock_locations', 'item_quantities.location_id = stock_locations.location_id');