I’m trying to create a report that will show detailed tickets for all customers, that shows the ticket details (total, etc) and all the ordered items on that ticket. It’s basically to allow monthly invoices to be prepared for customer accounts.
At the moment, I have got this far - getting the ticket details and order details for tickets where a customer entity is selected:
[Customer Ticket Details:3,2,2,4,4,1, 2]
>Date|Time|Ticket|Customer|Item|Qty|Total
@{REPORT TICKET DETAILS:T.TicketNumber:(TCET=Customer):|}
{REPORT TICKET DETAILS:T.Date,T.Time,T.TicketNumber,[EN.Customer]+'-'+[EC.Customer.First Name]+' '+[EC.Customer.Last Name],'','','':T.TicketNumber=="$1"}
{REPORT ORDER DETAILS:'','','','',O.MenuItemName,O.Quantity,O.Price:T.TicketNumber=="$1"}
>||||TOTAL||{REPORT TICKET DETAILS:T.TotalAmount:T.TicketNumber=="$1"}
What I am struggling with is 2 things:
- Some orders have order tags with a price, so currently that amount is not included (it is included in the total but the order tag would need to show so things add up). I have tried to use
(REPORT ORDER TAG DETAILS:X)
tag to show these, but struggling to get it to link to the orders and show under each order in sequence. This is what I tried so far but doesn’t work:
[Customer Ticket Details:3,2,2,4,4,1, 2]
>Date|Time|Ticket|Customer|Item|Qty|Total
@{REPORT TICKET DETAILS:T.TicketNumber:(TCET=Customer):|}
@{REPORT ORDER DETAILS:O.OrderNumber:T.TicketNumber=="$1":|}
{REPORT TICKET DETAILS:T.Date,T.Time,T.TicketNumber,[EN.Customer]+'-'+[EC.Customer.First Name]+' '+[EC.Customer.Last Name],'','','':T.TicketNumber=="$1"}
{REPORT ORDER DETAILS:'','','','',O.MenuItemName,O.Quantity,O.Price:T.TicketNumber=="$1"}
{REPORT ORDER TAG DETAILS:'','','','',T.Name,T.Qty,T.Price:O.OrderNumber=="$2"}
>||||Total||{REPORT TICKET DETAILS:T.TotalAmount:T.TicketNumber=="$1"}
- I would like to only show tickets where they have been paid on customer account. Currently it shows any that are linked to a customer entity. I’m not sure how to incorporate that within the same report.
After this, I probably will need to look at including calculations so I can account for any discounts that have been applied at ticket level. But I can probably work that out once I have the 2 points above dealt with.