I’m scared of custom constraints haha. I don’t know how they work together. But you know… I know this is possible but I simply can’t seem to get my head around how to get it to work. If I could Ideally get the Ticket tag to automatically set itself based on the entity screen selection in my other post, Then I would probably remove both those buttons, create that one ticket tag, and with help make it do exactly what I want it to do outlined in this post at the same time.
Because this is just one part of the equation. After setting this up perfectly, my next step would be to tie it all together. Oh boy would I be happy then. It seems so easy to do, but for me, it would definitely be a new personal accomplishment.
Could you show me how to constrain something like that to entity which is a table selection.
Coz the user would press Dine In first, then they have to select a table, its when a table is selected that the Dine In tag should be applied automatically.
When a table is selected, it should tag it with Dine in. In the case that customer changes mind to take away, instead of going back to entity screen to pick take away, the user clicks take away button, and that button clears any tags and retags it with take away.
That is what I’m trying to achieve.
If take away is selected, by default the Auto command is “Add Ticket” in widget settings, so maybe I could make a rule, so when Add ticket command is executed, it clears any tags, and puts take away tag.
So see my image - what you are saying is Ticket Entity Changed i.e. Blank -> Tables or Customer ->+ Tables. All are Entity Changes not Ticket Tag Changes/Selected. Of course you can do it that way but if you use Entity Change Event it 1 Rule with 1 Action.
Ticket Entity Changed Event -> Use Action to then Update Tag to DineIN
So Customer still on Ticket? Therefore no Entity Change or will you remove Table?
If there is no change in a Entity assigned to Ticket then yes you will use your tag setup.
If you remove the Table (Entity) then the same Rule can be used to call Action Update Tag to Takeaway.
Thinking it would be easy to remove Table then the flow is simple - but required user to use Select Entity Table and Remove. You can also use an Automation button to remove Entity Table just like you remove Tags - call Update Ticket Entity with a Blank Entity for Tables.
Hey @Shivan 11.44pm need to get some sleep, gluck.
Haha sorry Paul. Thanks for the help. That Ticket Entity Changed did the trick. When a table is selected it puts Dine in Tag straight away. When I close ticket or cancel order, and click Take away, there is no ticket tag. Ok great, we are getting somewhere.
I think I was really confusing myself or making things more complicated than it really seemed.
I think I’ll just make the flow simple, If customer chose dine in then decided they wanted take away, then user just cancels order and re inserts it under take away. Likewise if customer chose take away, then decided they want to dine in, just cancel order and choose a table.
Anything more than that would just complicate things in my opinion.
Then in your Rules, you can specify the Tag Name an Tag Value.
FYI, this screenshot you showed having blank Tag Name will do nothing, or might cause the crash you were experiencing. Leaving the Tag Name blank is not going to work to remove all Ticket Tags. SambaPOS won’t know what to do with this action…
No, that is what I m saying. Leaving the Tag Name empty does not clear all Ticket Tags. The action is useless in that case (the one shown above above). You need to tell the Action which Ticket Tag you are trying to update.
Thanks QMcKay… I managed to get the ticket tags working. Except now when a table is selected, the Order No ticket tag still shows with Dine In tag. Order No tag shows when take away is pressed and Dine In tag is auto removed, but when table is selected, Order No is still showing even though in my rule it set to clear it.
However, If only one Clear All Tags is put instead of 2, it only clears one of them, not both. If I put to clear the tag for Order No only, TAKEAWAY still remains, if I do TAKEAWAY only Order No still remains. If I put both in the rule like the screenshot, TAKEAWAY is cleared, but Order No still remains when table is selected.
I cannot tell you what is happening, because I don’t know how the various Actions you configured are working. That is, I don’t know what actions or parameters they are configured to use because you hard-coded them instead of parameterized them.
That said, there are obvious problems with your setup.
Dine In / Take Away should be a single Ticket Tag. The Tag Name should be something like TA and then you set the Tag Value to either Dine In or Take Away
Your constraint for both Rules is the same. They need to be different. Change the Take Away Rule to use Not Matches instead of Matches.
Your Rules should probably look something like this:
OMG Yes! Thank you so very kindly QMcKay. I knew I was making it more complicated than it was. I think due to my lack of full understandings the capabilities of the program, I ended up doing more than it was necessary to do something so simple.
The constraint I had for take away originally did say “Execute rule if “MATCHES”” but I had the constraint as Entity Type Name “NOT EQUAL” Tables. I thought that worked the same way as the way you mentioned. Guess I was wrong.
But yes I did have my actions hard coded because It was the only way I knew of doing it. Thanks for showing me something new. It finally does exactly what I want it to do.
Now onto my 2nd last milestone before the setup is complete :D.
I don’t know what you are using for generation of the Order Number (ON), but you should get the idea of how the Rules should be configured to handle adding or removing a Table Entity, how to set the Constraints, and how to set the Tags.
I basically followed a guide that was posted on a questions I asked LONG time ago.
After pretty much restructuring everything the way you mentioned, I’ve began to understand, even if a little bit, how rules should be configured when handling the removal or adding entities like you mentioned. The constraints I have still yet to fully get the gist of, but what I did understand from it is that, by creating a Generic ticket tag, and setting custom values in actions, allows you to make custom changes according to what you want it to do.
The only thing I need to learn more and experiment more on is to understand which event is suitable to use based on what you want samba to do, and understand more on the “Execute rule if” .
Thank you for all your input and help. Not just you, but everyone who contributed. It means a great deal to me, and because of everyone here and the developer himself, I am able to really push Samba into POS market here and it’s taking off really well so far :). It means I can help donate more to the project and keep it continuously running better and better :).
I intend to write my first tutorial based on my setup for anyone who may find use for it as I did. That is once I finally feel it’s ready.