I would like to share a modified Orders by Officer report its optional but improves it. This report will work even for new Officer entities added without the need to edit report.
Report:
[Orders by Officer:2, 1, 1]
>Item|Quantity|Total
@{CALL:officers.getofficers()}
>>Orders by $1
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum,O.ExactTotal.Sum:(TEN.Officer=$1)}
>$1 Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(TEN.Officer=$1)}
Script:
function getofficers(){
var qry = "SELECT e.[Name] FROM [Entities] e JOIN [EntityTypes] et on et.[Id]=e.[EntityTypeId] WHERE et.[Name] = 'Officer' ORDER BY e.[Name]";
var r = sql.Query(qry).Join(',');
return r;
}
Wow good to know. I am trying to figure out what its doing. But thats a different conversation.
So a simpler version of what I just showed would be ignore the script completely and use this report.
[Orders by Officer:2, 1, 1]
>Item|Quantity|Total
@{REPORT ORDER DETAILS:EN.Officer,O.Quantity.Sum::{0}:,}
>>Orders by $1
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum,O.ExactTotal.Sum:(TEN.Officer=$1)}
>$1 Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(TEN.Officer=$1)}
@a.samy I think you also have a specific ticket type so you may want to include it as well. So assuming your ticket type is named as Officer Ticket, you can change expressions like…
Report with Product tag,
How to make like this
Sales item Report
Group : Food (this is product tag)
Group Code : Breakfast
Item 1 10 (sum qty) 1000(Total)
item 2
item 3
Total … 1000
Group Code : Soup
Item s1 10 (sum qty) 1000(Total)
item s2
item s3
Total … 1000
Group : Drink
Group Code : Juice
Item j1 10 (sum qty) 1000(Total)
item j2
item j3
Total … 1000