Calculation Rate based on Report Expression

What function name would you use?

This is the only example ive found of a custom calcluation script.

result = 0.05 - ((Ticket.PSum + Ticket.PreSum + Ticket.Tax) % 0.05)

Where did you find that?
This might be what im after…

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!

In fact I think it was just few days before you joined forum lol

Thanks, will have a play in a second

You show example also here

What are those value expressions, they are different to report values…

Its some hardcoded hidden stuff. Havnt used it in years so dont ask me lol May need to explore it.

1 Like

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.

1 Like

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

Without any luck.

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.

Ticket.X seems to be something…

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.

1 Like

Yes these were from older version specifically v3 it predated a lot of the printer tags etc. Early in v4 we used to see them used in some automation’s. Eventually printer tags and report tags replaced them.

Looking of v3 forum for ideas.
Order.Price seems to be one.

1 Like

Either way I dont think these options will provide enough complexity to be equivalent of;

{TICKET ORDER TOTAL EXP:(OS.NewBook GLA=2101)&&(ODI=True)&&(OS.GStatus= )}

1 Like

You mean it does update but the ticket wont reflect it unless you refresh right?

No I mean you have set a fixed amount do adding orders/change of total wouldnt cause a recalculation anyway surely since its a ‘fixed amount’ rather than a calculated calculation like a rate is.

If this custom method would support report expressions it could be so much more powerful and resolve my niggles with the update calculation action for rate calculations based on non ticket total amount.

You can force recalculation by putting it on an order added event. Using Update ticket calculation action. Or you can use Ticket Total Changed event.