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]
>User|Item|Quantity|
{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]
>User|Item|Quantity|
{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.
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…
Example:’
@Jesse,JTR
[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}
[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) }
[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) }
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.
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.