Data export Service Charge

Hi,

I followed this guide to add the service charge:
https://kb.sambapos.com/en/5-1-4-a-how-to-add-service-charge-to-ticket/

How is it possible to export this information with data exports? Sadly calculating it isn’t woorking as the value is wrong when there is no service charge. I’d love to have the data tag if possible. Can someone help? Thanks :slight_smile:

Here’s the actual script:

Group,Name,Quantity,Price,Service Charge (3%),HH/Void/Extra,ExactTotal
[Report:1,1,1,1,1,1,1]
@Asian Dishes,Beers,Buffet,Burger,Desserts,extra,Foodpanda,Fruit Shakes,Potato,Salads,Sandwiches,Soft Drinks,

{REPORT ORDER DETAILS:
O.ItemGroup,
O.MenuItemName.asc,
O.Quantity.sum,
O.Price,
([O.Price.sum]*3/100),
([O.Price.sum]-[O.ExactTotal.sum]),
O.ExactTotal.sum,
:(MG=$1)
:“{0}”,“{1}”,“{2}”,“{3}”,“{4}”,“{5}”,“{6}”}
,=SUM(G2:G)

Few things to note here, I am using some extra expressions and Ive separated very similar report into two sections. One which will give me details where there is no service charge and one where there is service charge with few minor changes.

Expressions used

(MG=$1)			-- where category equals $1 which is given by list @
and (ODI=True)		-- order decreased inventory, normally true for all orders except Void
and (OCP=True)		-- order calcuate price, normally false for both Void & Gift, so we skip both
and !(CA=Service Charge)-- where ticket calculation IS NOT Service charge
and (CA=Service Charge)	-- where ticket calculation IS Service charge

Syntax

[Export:0]
Group,Name,Quantity,Price,Service Charge (3%),HH/Void/Extra,ExactTotal
@{REPORT ORDER DETAILS:O.ItemGroup,O.ExactTotal.sum.desc:(ODI=True) AND (OCP=True):{0}:,}

{REPORT ORDER DETAILS:
O.ItemGroup,
O.MenuItemName.asc,
O.Quantity.sum,
O.Price,
([O.Price.sum]*3/100),
([O.ExactTotal.sum]-[O.Price.sum]),
O.ExactTotal.sum
:(MG=$1) and (ODI=True) and (OCP=True) and (CA=Service Charge)
:"{0}","{1}","{2}","{3}","{4}","{5}","{6}"}


{REPORT ORDER DETAILS:
O.ItemGroup,
O.MenuItemName.asc,
O.Quantity.sum,
O.Price,
([O.Price.sum]*0/100),
([O.ExactTotal.sum]-[O.Price.sum]),
O.ExactTotal.sum
:(MG=$1) and (ODI=True) and (OCP=True) and !(CA=Service Charge)
:"{0}","{1}","{2}","{3}","{4}","{5}","{6}"}

Total,,=SUM(C2:C<row-1>),=SUM(D2:D<row-1>),=SUM(E2:E<row-1>),=SUM(F2:F<row-1>),=SUM(G2:G<row-1>)

2 Likes

Hello,

I really appreciate that you took the time to test and answer.

This solution works perfectly :slight_smile:

Thank you very much for your help.

1 Like