This commit is contained in:
chunter2
2022-04-29 14:33:21 -04:00
committed by Steve Ireland
parent eaeabd8850
commit fec5c92b15
2 changed files with 3 additions and 0 deletions

View File

@@ -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']),

View File

@@ -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
');