Edit Report:Store Pre-Order Report
Menu Anchors
'customers', 'orders', 'sales', 'payables', 'warehouse', 'dispatching', 'receivables', 'payables-dash', 'inventory', 'purchases', 'generallendger', 'users',-- Store Pre-Order Report
-- Active and past pre-orders
--
-- VARIABLE: {
-- name: "range",
-- display: "Report Range",
-- type: "daterange",
-- default: { start: "yesterday", end: "today" }
-- }
-- VARIABLE: {
-- name: "store",
-- display: "Store Location",
-- type: "text",
-- }
--
select pos_preorderno as 'Preorder #', date as `Date`, combined_id as 'Customer', stockid as 'Item', qty as 'Quantity', price as 'Price',
salesman as 'Employee ID', 'ACTIVE' as 'Status' from pos_preorders where date <= '{{range.end}}' and date >= '{{range.start}}'
{% if store != '' %}
and loccode = '{{store}}'
{% endif %}
UNION ALL
select pos_preorderno as 'Preorder #', date as `Date`, combined_id as 'Customer', stockid as 'Item', qty as 'Quantity', price as 'Price',
salesman as 'Employee ID', 'INACTIVE' as 'Status' from pos_preorders_history where date <= '{{range.end}}' and date >= '{{range.start}}'
{% if store != '' %}
and loccode = '{{store}}'
{% endif %}
order by 'Status' desc