Forcing the user to choose Invoice type and customer

Hello friends,
I am trying to force to user system to choose invoice type and customer before go to payment screen. So I has been created a action: Show message.
And two rules:

  • First rule with condition: {ENTITY NAME: Customer} is Null , => Show message.
  • And second rule with condition: {ENTITY NAME: Invoice type } is Null, => then Show message.

Which is the problem?
Good question. When I donĀ“t choose Invoice type and customer, I should not continue to payment screen.
But in this case, if I chose invoice type and I click in Settle, it show payment screen.
However, If I chose in first moment to customer, I donĀ“t have this problem.

Video demostration: https://youtu.be/szxj6a72xpY

Watching the video the customer one is wrong as shows after selecting, make sure itā€™s correct entity type name (including case sensitive).

Also you need to combine the rules or have one trigger the other via execute automation command rather than both off settle button.
Thatā€™s why selecting one still goes to payment screen but with message for the other.

2 Likes

Hey, thanks for your reply. :grinning:
Previously, I changed entity name to my native language. For this reason I has been indicated Cliente and Comprobante.
image
image

I has been changed entity names to english name, so we can help us (well, you to me :relaxed:)
image

I did that, and now I can get one message in each request(click to Settle button), nice.
image
I was in an error, I always thinked that entity name is ā€œEntity nameā€ in Entity Types.
However, If I define in Custom Constraint {ENTITY NAME:Customer}, then, it does not work. But with {ENTITY NAME:Customers}, then, it works.
Is this correct?

is this possible? Being able to do that is simply awesome. I created my trigger, but Iā€™m newbie with SambaPOS and I could not go any further.
Even with this information I coud not :frowning:: How to disable Settle button for some users/waiters

Now rules works very well, if you have free time and you can make a tutorial about how turn off settle button, I would be so grateful: :heart::heart: :heart::heart::heart::heart::heart::heart::heart: to you.

Thanks.

In some cases it does not matter which one you use, but rule of thumb is to always use the Entity Type Name instead of the Entity Name ā€¦


You donā€™t really want a Trigger. What JTRTech meant by this was to fire another Action that triggers another Event that will be picked up by another Rule. Most of the time if we want to trigger an arbitrary Event, we use the Action for Execute Automation Command.

So in your first Rule, you add an Action for Execute Automation Command and supply the AMC name (and optionally AMC value).

Then you create another Rule for Automation Command Executed which is constrained for the the AMC Name that you fired in the first Rule.


The Settle button is simply an Automation Command button. The Visible and Enabled properties are controlled by States in the AMC Mapping.

So in order to ā€œturn offā€ the Settle button, you need to use the AMC mapping to be constrained for a specific Enabled State.

You can control States through Automation, and in your case, you probably want to control a custom Ticket State, so you would use the Update Ticket State Action to do so.

The Automation for setting the State would involve checking for existence of both your Entity Types, and then set your State to ā€œOKā€ only if both are selected. But you need more than that, like setting the State to ā€œNOTokā€ when the Ticket is Created and when the Ticket is Closed. All of this Automation is probably more hassle than it is worth, so instead do something more simple ā€¦

Constrain the Display Payment Screen Action in the Settle Rule to only fire when both your Entity Types are not empty, something like this ā€¦

1 Like

Qs example is how I would do it, you still get specific messages for each validation and is under a single rule.
I would have done this anyway rather than two rules as try to keep things clear to view so wherever possible automation command rules will always start from a single rule with action constraints rather than multiple rules with separate constraints.

Yes but its not triggers, there is an action of ā€˜Execute Automation Commandā€™ which is useful in many senarios.
Sometimes you need to have a ā€˜stop gapā€™ in your automation to allow fresh constraints based on updated values from actions in the same flow, since action constraints are validated on rule begin and not as they fire.
It also allows you to create automation ā€˜snippetsā€™ that can be reused or executed following sets of other automation rather than duplicating actions.
Also using command value you can pass value through into the automation rules from the first one.
Here is part of my list of automation command rules;


The flow is such that it goes from one rule to the other with validations/constraints at different parts.

1 Like