Sales order by department

Guys i am stuck. i need to get a sales report by department this far i have tried but it shows no report. what am i doing wrong?

[Sales:5, 2, 2,1]
@{DEPARTMENT LIST}
@{TICKET TYPE LIST}
@{REPORT ORDER DETAILS:O.MenuItemName,O.ExactTotal.Sum.desc:(ODI=True):{0}:,}

Ticket Type|| $2
{REPORT ORDER DETAILS:O.MenuItemName,O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and (O.Department=$1) and (TY=$2) and O.MenuItemName=“$3”}
{REPORT ORDER DETAILS:’ '+[O.PortionName],O.Quantity.Sum.desc,O.ExactTotal.Sum.desc:(ODI=True) and (TY=$2) and O.MenuItemName=“$3”:3}
Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True) and (TY=$2)}

1 Like

Your expression format is wrong. Look at kb.sambapos.com look at reports section.

Instead of O.Department try (D=$1)

1 Like

So far i got this

@{REPORT ORDER DETAILS:O.Department::{0}:,}
[Sales by $1:1, 1, 1]
{REPORT ORDER DETAILS:O.MenuItemName.asc,O.Quantity,O.ExactTotal.Sum:(ODI=True) and (DE=$1)}
>>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True) and (DE=$1)}

but it still mixes items from different departments.

Try this:

[Sales:1, 1, 1]
@{REPORT ORDER DETAILS:O.Department::{0}:,}
>Name|Qty|Total
{REPORT ORDER DETAILS:O.MenuItemName.asc,O.Quantity,O.ExactTotal.Sum:(ODI=True) and (DE=$1)}
>>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True) and (DE=$1)}
2 Likes

Try this

[Sales:1, 1, 1]
@{REPORT ORDER DETAILS:O.Department::{0}:,}
>Name|Qty|Total
>$1
{REPORT ORDER DETAILS:O.MenuItemName.asc,O.Quantity,O.ExactTotal.Sum:(ODI=True) and (DE=$1)}
>>Total|{REPORT ORDER DETAILS:O.ExactTotal.Sum:(ODI=True) and (DE=$1)}
1 Like

i tried the above but the report still mixes items from different departments. the ones with a red line belong to a different department
Capture

Are you looking for orders issued at a different department or settled at different department?

Have you tried different terminal instead of department? Any chance you have different payment type on different terminal or department?

i am looking for orders issued at a different department. the present terminals are for waiters to post orders my payment logic is centralized not on different terminals

Try renaming your terminals if they are all set as Server or blank and use (TE=xxx) expression.

Ar you sure you have the correct terminology/definition of department?

yes i have set up departments correctly

i need a departmental sales report not one based on terminals

I only have 1 department setup so cant fully test but have tested the report by manually setting department value and works as expected which suggests your issue is elsewhere and those orders are being recorded as Bar department.
PM me a backup and will try and have a look later.

I just tried it and it seems like if you choose Department > Restaurant and put orders on ticket and then choose Department > Bar and add more orders to the table it ends in Restaurant department. If you create new ticket it will put it in the chosen department.
image

Never really used departments, was it designed to work this way or?

Thanks man for confirming my fears. i believe it should work otherwise it would be hard to combine, for example, drinks from counter A, B and foods from the kitchen into one bill and still be able to get accounting reports for the respective departments. Emree?

If i was to use custom Tags for products can i then report on the same tags for orders?

funny enough when u check the department_id for all orders they are correctly registered

If you do have issues just use a custom order state set on order adding.
I do custom states for loads of things as itemized and easy to report.

can u point me to a sample report using custom order tags

Sure you mean order tags… (modifiers)?
Do you mean Item/Product Tag?