Tag Enclosed within a Ticket 'Report' Expression in Action Constraint

Working on a package (dinner/bed and breakfast system) and woundering if This should work and Im just doing it wrong.
Have a ticket tag for the number of covers/people in the package.
Already have courses states for grouping on kitchen prints etc.
So am using this to calculate if an order should be set to a PACKAGE state from which a order state changed rule makes the appropriate price adjustments.
This is one of the action constraints;
{TICKET ORDER COUNT EXP:(OS.Package=Package) && (OS.Kitchen Course=Starters)} < {TICKET TAG:Package Covers}


I was hoping to increase the flexibility of the setup should additional courses be added in the future by using the course itself as part of the TICKET ORDER COUNT.
What im asking is should something like this work?
{TICKET ORDER COUNT EXP:(OS.Package=Package) && (OS.Kitchen Course={ORDER STATE:Kitchen Course})} < {TICKET TAG:Package Covers}

Specifically this expression;
(OS.Kitchen Course={ORDER STATE:Kitchen Course})
This is in an order added rule and the {ORDER STATE:Kitchen Course} return the expected ā€˜Startersā€™ for the order tested with.

To help understand here is a recording of the process so far;

Excuse the sluggish recording, hoping its not the number of order added rules :-/
Also ignore the red ask question, is my test notification of one of the PMS scripts running on triggerā€¦

You should handle ā€œKitchen Course state updateā€ instead of ā€œorder addedā€.

1 Like

If that works would be awesome :smile: am away today so will have to try tomorrow.

Another blast from the past you were involved in @JTRTechā€¦

I am trying to do something very similar to thisā€¦

But I am trying to do it within a rule (Show Message for now)ā€¦

I have an Order State called DiverName (multiple divers are often added to one ticket) and when a new order is added I assign the diver name to the order, but when I do this I need to know if/how-many orders that diver already has in the ticket.

If I add diver ā€œMattā€ and hard-code the name as below I get the correct result:
{TICKET ORDER COUNT EXP:(OS.DiverName=Matt)}

But, if assign ā€œMattā€ and a local settting called ā€œDiverNameā€ and then use the following, I get a result of ā€œ-ā€:
{TICKET ORDER COUNT EXP:(OS.DiverName={SETTING:DiverName})}

Any idea how I can get a count of orders with a particular state, but allow the state we are searching for to be changed programatically?

Hmmm, not sure, dont think I have ever tried.
Im guessing its taking {SETTING:DiverName} as the diver name and not parsing the setting valueā€¦

Iā€™m not sure if nesting is supported in report expressions. Try putting ā€˜quotesā€™ around the setting.

I was going to suggest trying quotes.
Im sure I might have used [:CommandValue] before in a report expression.

1 Like

Sorry, no it was into a script call.

This gave me the idea of using a square bracket style value instead of a curly bracketā€¦ By chaining on to the ā€œOrder State Updatedā€ hook I was able to use [:State] and that worked perfectly :slight_smile:

1 Like