Edit Report:SUPPLIER SALES BY SKU
Menu Anchors
'customers', 'orders', 'sales', 'payables', 'warehouse', 'dispatching', 'receivables', 'payables-dash', 'inventory', 'purchases', 'generallendger', 'users',-- SUPPLIER SALES BY SKU
-- Select date range.
-- ^Monthly Reports
-- VARIABLE: {
-- name: "range",
-- display: "Report Range",
-- type: "daterange",
-- default: { start: "first day of last month", end: "yesterday" }
-- }
-- VARIABLE: {
-- name: "supplierno",
-- display: "Supplier Code",
-- type: "text",
-- }
-- ROLLUP: {
-- columns: {
-- "Chatters Total": "Total: {{sum}}",
-- "Tommy Guns Total": "Total: {{sum}}",
-- }
-- }
SELECT
suppliername,
stockid,
description,
sum( qty *- 1 ) AS 'qty',
sum( discountedlinetotal * - 1 ) AS 'totalsales'
FROM
stocktrans
where trandate between "{{ range.start }}" AND "{{ range.end }}"
AND supplierno like '{{ supplierno }}%'
GROUP BY
stockid
ORDER BY
qty DESC