{TICKET ORDER DETAILS: equivalent

So I have asked similar before but not got very far.
Do we have anyway to get equivalent of what you would expect from a TICKET ORDER DETAILS report expression.
Closest would be REPORT ORDER DETAILS but this requires ticket id and I need to evaluate current open ticket orders for some calculations for deals and discounts that need updating on the fly as orders are added.

What expression are you looking for? {REPORT TICKET DETAILS:}

What are you trying to constrain?

I want to pass list of order detils from current ticket into a script.
Ticket would be new so cant do ticket id into report order details

Cant use the update order price/deal action as need to use calculations to show discount amounts in PMS integration.
My discounts system works well with flat % discounts using TICKET ORDER TOTAL:X in math to calculate however they want to do deals like 241 and 2 for £x on range of differently prices products so simple math doesnt cut it, need to use a script to work out the order values ascending and count up the value of discount to reduce total acordingly.

Started to think ORDER DETAILS:X might be the answer but cant get it to return anything.
Only place on forum I can find it used is
https://forum.sambapos.com/t/beta-pre-programmed-gift-card-setup-with-promo-cards-accounting/22936/5

You will have to display ticket (refresh ticket) before running the report.

Save rather than refresh since report expressions i beleive query db unlike cache based expressions.
But as I said this will be running every time applicable product is added or removed on a new ticket so dont think saving and refreshing then using report order details is going to work.

ORDER DETAILS:X doesn’t need to be saved, just the screen needs to be refreshed. I ran into that problem when I was developing the gift card. When I added a gift card item to the screen it would not show any results for the report. When I added another gift card item to the ticket, the report would show only 1. When I added a display ticket action, that fixed the problem. I was using update order to set the price and thought that would have “update the order”, but it didn’t. I had to add the display ticket.

So thinking I might have to work something out using the adjust price action and work out another way to resolve allowances in PMS accounts.

However given this;

Would you not expect this report;


To show a price for the order tag.

No because the .sum is always going to round to 0 if its negative number. You need to format the number to see a negative.

1 Like

So =F with the .sum outside brackets?

That should work try it and see

@Jesse turns out otherwise.
Only realised because had to make some tweeks to PMS intergration.
When I checked the tags table I found that the negatives from adjust price action are in a “AM”: key rather than “PR”: key as other tags, going to check if its specific to that action or because negative.
Either way the answer is T.Amount in the report…

Interestingly it looks like it might be specific to the adjust price action as a -1 value freetag shows the negative value with PR key as other tags

Adjust Price tag json data in table;
image

Thinking about it it must have to do with the use order price option as otherwise would give potential for a loop where the order total changed causeing update of adjustments etc

Why not check if AM exist in the order tag array (it isn’t always there) then check if its null or empty. If null or empty, use PR, else use AM.

I did if ! Then set 0 for each then add both, multiplied by tag qty. Similar end result.
I raised it as the report requires T.Amount which isn’t listed in the popup field values.

1 Like