@emre am just wondering if it might be possible to set a calculation method of rate based on a report expression amount.
My discounts setup has gotten quite confusing in its automation to refresh the shown discount given several senarios where sometimes ticket refresh is required and others where its not and then working arround autoselect and the reset ticket for update calculation causing drop of the autoselect.
Just working on a service charge calculation and notice that a basic rate on ticket total refreshes without issue on portion change etc and no effect on autoselect.
Was wondering is it might be feasible to ad a field for a custom amount to calculate rate on?
So rate would be say 10% and method would be rate from custom expression then in the expression field you could use report expression to calculate the total amount to base the rate on. In my case {TICKET ORDER TOTAL EXP:
[=Math.floor((TN(’{TICKET ORDER TOTAL EXP:(OS.NewBook GLA=2101)&&(ODI=True)&&(OS.GStatus= )}’)*0.1)/0.05)*0.05]
Is my update calculation amount formula for 10% off drinks (newbook gla 2101) rounded to 5p
Fixed amount doesnt update.
Custom does nothing.
Thats what I was getting at is you can set a rate which auto updates but rate alone doesnt work as its rate on just drinks.
Long time ago 2015 we had a discussion in v4 for some reason I never forgot it so anytime someone mentions custom calculation it always pops in my head. [Resolved] Rounding by Ticket Total Exactly Type!
They predated custom reports. So it was some early expressions. Custom Reports kinda made them obsolete. Heck try using some modern expressions with custom reports and set handle as mentioned above… that may just work i Dunno.
Hmmm, may need some input from @emre
Without reference for whatever format that is I can only take wild guesses.
Tested using a simple {TICKET TOTAL} as;
result = {TICKET TOTAL} * 0.1
result = TN(’{TICKET TOTAL}’) * 0.1
result = [=TN(’{TICKET TOTAL}’)] * 0.1
Emre is very busy I wouldnt expect a response from him for a while. But I can say that tags like that probably wont work. We are dealing with scripts. Any tags need to be fed into it from sambapos side.
But without a function how would you pass variables? Even if that were the case it would feed the value as apposed to the expression.
This ill just have to wait till emre gets time to elaborate.
Searched sugest that Fluentscript might be a key term which comes from v3 by looks of it.