Edit Report:Online Sales by Day
Menu Anchors
'customers', 'orders', 'sales', 'payables', 'warehouse', 'dispatching', 'receivables', 'payables-dash', 'inventory', 'purchases', 'generallendger', 'users',--Online Sales by Day
-- VARIABLE: {
-- name: "range",
-- display: "Report Range",
-- type: "daterange",
-- default: { start: "first day of last month", end: "yesterday" }
-- }
-- CHART: {
-- "columns": ["DATE","NETSALES"],
-- "type": "ColumnChart",
-- "title": "Online Sales by Day",
-- }
-- VARIABLE: {
-- name: "groupby",
-- display: "Group By",
-- type: "select",
-- multiple: false,
-- options: [{display: 'Day', value:'DATE(trandate)'},{display: 'Month', value:'MONTHNAME(trandate)'}],
-- }
SELECT
YEAR(trandate),
DAYNAME( trandate ) as 'DAY',
{{ groupby }} as 'DATE',
CAST(sum(- 1 * discountedlinetotal ) as DECIMAL(10,2)) as NETSALES
FROM
stocktrans
WHERE
trandate between '{{ range.start }}' and '{{ range.end }}'
and placedfrom = 4
GROUP BY
YEAR(trandate) , {{ groupby }}
order by trandate asc