Edit Report:EVO Monthly Sales by Product Line
Menu Anchors
'customers', 'orders', 'sales', 'payables', 'warehouse', 'dispatching', 'receivables', 'payables-dash', 'inventory', 'purchases', 'generallendger', 'users',-- EVO Monthly Sales by Product Line
-- Use in conjunction with Customer Sales Detail Report.
-- ^Monthly Reports
-- VARIABLE: {
-- name: "range",
-- display: "Report Range",
-- type: "daterange",
-- default: { start: "first day of last month", end: "yesterday" }
-- }
-- ROLLUP: {
-- columns: {
-- "Total Sales": "Total: {{sum}}"
-- }
-- }
SELECT
tranyear AS 'Year',
tranmnth AS 'Month',
suppliername AS 'Supplier',
(select line_description from productlines where line_field = lineid) as 'Product Line',
( SUM( discountedlinetotal )* - 1 ) AS 'Total Sales'
FROM
stocktrans
WHERE
1
AND trandate BETWEEN '{{ range.start }}' AND '{{ range.end }}'
AND supplierno = 'EV'
GROUP BY
lineid
ORDER BY
'Total Sales' DESC