EDIT: This has now been solved by @emre. Scroll down to see the final report I used.
Sometimes a customer will buy several things at once. Different staff might have sold each thing, therefore my commissions are assigned at the ORDER level instead of at the TICKET level.
I have an Order Tag Group called commissions, which can be assigned to items that have been sold. Sometimes, multiple members of the team can be involved in the sale of just one item (and they all should get some commission), therefore it is possible to select multiple people.
Using these tags I have been able to produce the following report:
Youâll notice that the âcommisionable amountâ is sometimes less than the base price of the item sold. This is because I remove any item discounts applied and I remove a proportion of the total ticket discount, before finally multiplying the commision-able amount by the employees particular commission rate.
My question
I need to make two small tweaks to this report.
- Need to add commission totals per person (where indicated by $#/## in the screenshot above). These values are the result of a lot of calculations, so I wasnât sure if and how I can use some .sum commands to provide a total.
- Need to divide the âcommissionable amountâ by the number of people involved in the sale. You can see in the âstaffâ column we have a list of the names of people involved in the sale. I couldnât work out how to convert this to a number.
This is the current reportâŠ
[Commissions:.8,1.5,1,1,1,1.5,1.5,1,1,1,1,1,1]
@Caro,Kim,Nati,Matt
>>Ticket#|Date|Total|Discount|Customer|Staff|Item|Item price|Item Disc|Ticket disc|Commissionable|Commission Rate|Commission
> $1
{REPORT ORDER DETAILS:T.TicketNumber.asc,T.Date,T.TotalAmount,CA.Discount,EN.Customers,OT.Commission,O.MenuItemName,O.Price,OTP.Discounts,=[CA.Discount]*(([O.Price]+[OTP.Discounts])/([T.TotalAmount]-[CA.Discount])),=([O.Price]+[OTP.Discounts])+[CA.Discount]*(([O.Price]+[OTP.Discounts])/([T.TotalAmount]-[CA.Discount])):(OT.Commission=$1):{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{REPORT ENTITY DETAILS:EC.DiveCommission:(ET=Employees) AND (EN=$1)}|[=F({10}*{REPORT ENTITY DETAILS:EC.DiveCommission:(ET=Employees) AND (EN=$1)})]}
> |||||||||||Total for $1| $#.##