Custom report help - Staff sales report


I would like to be able to generate a report that details how much of a product or product group each staff member has sold within a certain time period.

We offer bonuses to the staff member who sells the most desserts during the month for example.

I have used the following tag and it almost works, but items aren’t grouping together properly.

[Staff Sales:1,3,1,1,1]
{REPORT ORDER DETAILS:O.User,O.MenuItemName,O.Quantity:(OS.Status=Submitted)}

For example, user Niv sold 4 French Toast but they are split into 2,1 and 1 for some reason.

I also tried to do it by group but that did the same thing and didn’t group properly.

[Staff Sales:1,3,1,1,1]
{REPORT ORDER DETAILS:O.User,O.ItemGroup,O.Quantity:(OS.Status=Submitted)}

Or alternatively if I could input a product name in the report and then it tells me how much of that item each staff member sold, that would be great also.


No reports pro but think that is looking at each order line in the database table. You would want something with sum or total first of all.

Ideally I would also want to grounp the list into sections for each user, this should be doable using some form of user list which I’m sure is available and adding some form of header line with $1 and changing the expression filter to include order usr = $1.

A seperate solution - you said product group is an option, might be worth looking to see what the code for the product group breakdown is on the standard work period report and see if you can enter an expression for user =
Also work period has a total payments pert user grouped by user, check the code and layout used there for some ideas.
I’m not at PC so can’t check potential solution.

Use O.Quantity.sum to sum the quantity.

1 Like

The settle by part of the work period could be handy for a layout where these counts are grouped by users;

[Settled by $1:1, 1, 1] 
{REPORT PAYMENT DETAILS:P.Name,P.Amount.Percent,P.Amount.Sum:(PU=$1)} 
>Total Income|{REPORT PAYMENT DETAILS:P.Amount.Sum:(PU=$1)}

Something like;

[ORDERED BY by $1:1, 1, 1] 
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.sum:(OU=$1)} 
>Total Income|{REPORT ORDER DETAILS:O.Quantity.Sum:(OU=$1)}

Not sure about OU= expression, would check on that.

Your missing a parameter… that is wrong syntax… remember when you use $1 or $2 in a report those are pulling defined parameters… you never defined one…


[ORDERED BY by $1:1, 1, 1] 
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.sum:(OS.Status=Submitted)} 
>Total Income|{REPORT ORDER DETAILS:O.Quantity.Sum:(OS.Status=Submitted}

AND (OS.Status=Submitted) ???

[ORDERED BY by $1:1, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.sum:(OU=$1) AND (OS.Status=Submitted) }
Total Income|{REPORT ORDER DETAILS:O.Quantity.Sum:(OU=$1) AND (OS.Status=Submitted) }

Your using $1 wrong. $1 is placeholder for @blah

So look at my example

Wasnt sure where user sales was pulling its user list from;
Would it be

@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,}


[ORDERED BY by $1:1, 1, 1]
@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,}
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.sum:(OU=$1) AND (OS.Status=Submitted) }
Total Income|{REPORT ORDER DETAILS:O.Quantity.Sum:(OU=$1) AND (OS.Status=Submitted) }

Still wrong. OU is not valid syntax. Look here for how to use Templates and valid tags.

Sorry yer, did say I wasnt sure on the OU.
Users must be tracked on order table though else O.User wouldnt work right?

It either needs to be an actual column in the table or it needs to be specifically coded by emre to work.

Your also using the templating feature wrong. $1 or $2 are placeholders for values declared after @ symbol. So if you do not declare it first then $1 does nothing.

1 Like

I have spent a crazy amount of time on emres details report tag topic this weekend.

I was trying to help, did say OU I wasnt sure on, ill but out :frowning:

Its ok I just wanted to clear up the use of templating. You had right idea just wrong implementation.

Thanks all for your help on this, I’ve got a report I can work with.
I went for
[Product Group Sales:1, 1, 1]
{REPORT ORDER DETAILS:O.User,O.ItemGroup.asc,O.Quantity.sum:(OS.Status=Submitted)}

One last question on this, can I pick a particular item group to only show up. I am most interested in Dessert sales & Wine sales. So if I can have a table that only lists dessert sales and one also for wine, that would be perfect.
Or am I asking too much? haha.


You can set multiple constraints/expressions with AND;
{REPORT ORDER DETAILS:O.User,O.ItemGroup.asc,O.Quantity.sum:(OS.Status=Submitted) AND (…)}
Just need to work out your expression.