mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2025-12-27 03:27:55 -05:00
Add cost price column to item summary report (#3495)
This commit is contained in:
@@ -231,6 +231,7 @@ class Reports extends Secure_Controller
|
||||
$tabular_data[] = $this->xss_clean(array(
|
||||
'item_name' => $row['name'],
|
||||
'category' => $row['category'],
|
||||
'cost_price' => $row['cost_price'],
|
||||
'unit_price' => $row['unit_price'],
|
||||
'quantity' => to_quantity_decimals($row['quantity_purchased']),
|
||||
'subtotal' => to_currency($row['subtotal']),
|
||||
|
||||
@@ -9,6 +9,7 @@ class Summary_items extends Summary_report
|
||||
return array(
|
||||
array('item_name' => $this->lang->line('reports_item')),
|
||||
array('category' => $this->lang->line('reports_category')),
|
||||
array('cost_price' => $this->lang->line('reports_cost_price'), 'sorter' => 'number_sorter'),
|
||||
array('unit_price' => $this->lang->line('reports_unit_price'), 'sorter' => 'number_sorter'),
|
||||
array('quantity' => $this->lang->line('reports_quantity'), 'sorter' => 'number_sorter'),
|
||||
array('subtotal' => $this->lang->line('reports_subtotal'), 'sorter' => 'number_sorter'),
|
||||
@@ -25,6 +26,7 @@ class Summary_items extends Summary_report
|
||||
$this->db->select('
|
||||
MAX(items.name) AS name,
|
||||
MAX(items.category) AS category,
|
||||
MAX(items.cost_price) AS cost_price,
|
||||
MAX(items.unit_price) AS unit_price,
|
||||
SUM(sales_items.quantity_purchased) AS quantity_purchased
|
||||
');
|
||||
|
||||
Reference in New Issue
Block a user