Edit Report:Summit Total Sales
Menu Anchors
'customers', 'orders', 'sales', 'payables', 'warehouse', 'dispatching', 'receivables', 'payables-dash', 'inventory', 'purchases', 'generallendger', 'users',-- Summit Total Sales
-- Enter Date Range.
-- ^Monthly Reports
-- VARIABLE: {
-- name: "range",
-- display: "Report Range",
-- type: "daterange",
-- default: { start: "first day of last month", end: "yesterday" }
-- }
SELECT
CAST(
SUM(
CASE WHEN supplierno IN ('GK', 'KS', 'KM', 'VA') THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Kao GK All Sales',
CAST(
SUM(
CASE WHEN supplierno = 'GK' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Goldwell Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'KS' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Kerasilk Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'KM' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'KMS Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'VA' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Varis Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'AH' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'K18 Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'OR' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Oribe Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'MN' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Maria Nila Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'RK' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Redken Total Sales',
CAST(
SUM(
CASE WHEN supplierno = 'CBB' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Bob Total Sales',
CAST(
SUM(
CASE WHEN supplierno <> '' THEN (discountedlinetotal * -1) ELSE 0 END
) AS DECIMAL (10, 2)
) AS 'Summit Total Sales'
FROM
stocktrans s
inner join debtorsmaster d on s.debtorno = d.debtorno
WHERE
trandate BETWEEN '{{ range.start }}' AND '{{ range.end }}'
and d.typeid NOT IN ('6', '8','10','21')