mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-13 08:22:52 -04:00
Porting over e4ca111
This commit is contained in:
@@ -351,6 +351,7 @@ class Reports extends Secure_Controller
|
||||
$tabular_data[] = [
|
||||
'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 [
|
||||
['item_name' => lang('Reports.item')],
|
||||
['category' => lang('Reports.category')],
|
||||
['cost_price' => lang('Reports.cost_price'), 'sorter' => 'number_sorter'],
|
||||
['unit_price' => lang('Reports.unit_price'), 'sorter' => 'number_sorter'],
|
||||
['quantity' => lang('Reports.quantity'), 'sorter' => 'number_sorter'],
|
||||
['subtotal' => lang('Reports.subtotal'), 'sorter' => 'number_sorter'],
|
||||
@@ -26,6 +27,7 @@ class Summary_items extends Summary_report
|
||||
$builder->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