From 36b0b281090d4c7e134478acb96896b322e2a6e3 Mon Sep 17 00:00:00 2001 From: Carl Hunter Date: Mon, 2 Nov 2020 16:15:15 -0500 Subject: [PATCH] Add Retail Price to Items Summary Report --- application/controllers/Reports.php | 1 + application/models/reports/Summary_items.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 600b1cd34..d303f0ed6 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -228,6 +228,7 @@ class Reports extends Secure_Controller { $tabular_data[] = $this->xss_clean(array( 'item_name' => $row['name'], + 'unit_price' => $row['unit_price'], 'quantity' => to_quantity_decimals($row['quantity_purchased']), 'subtotal' => to_currency($row['subtotal']), 'tax' => to_currency_tax($row['tax']), diff --git a/application/models/reports/Summary_items.php b/application/models/reports/Summary_items.php index b74339f9f..5b0b7bded 100644 --- a/application/models/reports/Summary_items.php +++ b/application/models/reports/Summary_items.php @@ -8,6 +8,7 @@ class Summary_items extends Summary_report { return array( array('item_name' => $this->lang->line('reports_item')), + array('unit_price' => $this->lang->line('reports_unit_price'), 'sorter' => 'number_sorter'), array('quantity' => $this->lang->line('reports_quantity')), array('subtotal' => $this->lang->line('reports_subtotal'), 'sorter' => 'number_sorter'), array('tax' => $this->lang->line('reports_tax'), 'sorter' => 'number_sorter'), @@ -22,6 +23,7 @@ class Summary_items extends Summary_report $this->db->select(' MAX(items.name) AS name, + MAX(items.unit_price) AS unit_price, SUM(sales_items.quantity_purchased) AS quantity_purchased '); }