Sales report per user


#1

The customer asks to make a report, which will show which user has sold products for how many. For example, User Mark sold 10 burgers, 5 drinks, 1 American coffee.


#2

So using the existing report look how users are reported on wp report with an @{report xxx} type line.
This gives you a list of users you can feed into another report.
Then take the item sales report and using the users list from above as a user constraint to the report line so it also reports based on order user.
You may want to add a $ number as a header to show the user name.


#3

Hm, whats a problem?
reports

[Продажи по официантам:1, 1]
{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum}
@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,}

[Settled by $1:1, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent,O.ExactTotal.Sum:(ODI=True,PU=$1)}
Total||{REPORT ORDER DETAILS:ExactTotal.Sum:(ODI=True,PU=$1)}


#4

This should be (ODI=True) and (PU=$1)


#5

This did not fix my problem.


#6

Show us your report syntax now.


#7
[Продажи по официантам:1, 1] 
{REPORT ORDER DETAILS:O.User,O.ExactTotal.Sum}
@{REPORT PAYMENT DETAILS:P.User,P.Amount.Sum::{0}:,} 

[Settled by $1:1, 1, 1] 
{REPORT ORDER DETAILS:O.MenuItemName:(ODI=True)(PU=$1)}
Total||{REPORT ORDER DETAILS:ExactTotal.Sum:(ODI=True)(PU=$1)}

#8

Missing the AND between (ODI=True)(PU=$1) it should be (ODI=True) AND (PU=$1) which is what Emre said and you didn’t follow


#9

It’s my wrong, I fixed it, but it still doesn’t work. And I tried using this solution: Item sales report by user but is the same.


#10

Showing your result and explaining what’s unexpected would be helpful.


#11

First option:

[Settled by $1:1, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName:(ODI=True) AND (PU=$1)}
Total||{REPORT ORDER DETAILS:ExactTotal.Sum:(ODI=True) AND (PU=$1)}

First result:
empty1

Second option:

[Settled by $1:1, 1, 1]
{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.Percent,O.ExactTotal.Sum:(ODI=True) AND (PU=$1)}
Total||{REPORT ORDER DETAILS:ExactTotal.Sum:(ODI=True) AND (PU=$1)}

Second result:
empty1

Thrid option:

[Sales by User:5, 2, 2,1]
@{REPORT ORDER DETAILS:O.User.asc:(ODI=True):,}
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True) and (OU=$1):{0}:,}
>>$1
>{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and (OU=$1) and O.MenuItemName="$2"}
{REPORT ORDER DETAILS:’ '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and (OU=$1) and O.MenuItemName="$2":2}

Thrid result:
empty2

All options had the same problem.
I think if I made 2 menu - is can be the problem?


#12

Where to begin.
I presume on the first two there is a @ defined above the title that your not showing?


#13

Next is the use of PU on order report. This won’t work, payments and orders have no direct link so payment user is not available to an order report. Why not just report payments by user?


#14

Because my client wants the report to be “item sales per user”, not only payments. And I had a problem with this syntax because I didn’t find instructions about reports programming in sambapos. I don’t understand, how it works and trying to use examples.


#15

You can find all report syntax and very good instructions at kb.sambapis.com