How to change colour of entity when in use

Ive read what i can find but im struggling to get it working, this is my flow.

Ive set up a new entity type called BAR TAB with entities Tab 01, Tab 02, Tab 03 etc. I have rules and actions setup so that when orders are added to the ticket i press the open bar tab button, this brings up my entity selection screen to select Tab 01, Tab 02 etc. This adds that entity to the ticket, i also update the ticket type to Bar Tab and update AUTOPRINT state to Bar Tab so relevant receipt prints on ticket closing. After selecting Tab 01 etc a keyboard pops up so we can type the customers name and add as a ticket tag so each bar tab will also have the customers name attached to it

This issue i have is that i cant figure out how to make the entities Tab 01, Tab 02 etc change colour when they are in use (and then change the colour back when the ticket is settled and the tab is “closed”)

Once orders were added to the ticket and the open tab button pressed i wanted to be able to select Tab 01 etc and then the ticket automatically close, but the screen switch happens and doesnt log out, its something to do with the entity being added to the ticket, so i created a second button to close the “Bar Tab”

Can someone show me how to setup the colour changes on my Tab entities?

here some screen shots

  1. Add orders to ticket and press “Open Bar Tab” button

  2. Select Bar Tab entity

  3. Enter customers Name

  4. BAR TAB: Tab 01 entity added to ticket, Status updated to Bar Tab, AUTOPRINT: Bar Tab updated, Customer Name added as a ticket tag and the Close & Update Bar Tab button appears, either add more orders or just press it to close the ticket and log out

  5. To recall bar tab to add/remove orders or settle ticket, log in to POS and select “Recall Bar Tab” button

  6. Ticket list appears to select any of the open bar tabs to edit or settle

  7. Click to open, then edit, settle or click close and update button

  8. Now the issue, as you can see i have opened a bar tab using TAB 01, so what i want now is when i open another bar tab i want TAB 01 to be a different colour so we no not to use it and to select a different entity, but currently i cant get the colour to change as below

EDIT: In fact, scrap that, ive simplified it by just having one entity called Bar Tab so every ticket gets assigned Bar Tab as the ticket entity, then a keyboard pops up to ask for customers name so each bar tab can be identified and it removes the need to have multiple entities and colour changes


BTW color changes are triggered by States. So Bar Tab Entity would need an Entity State that can change color based on availability. You added the entity but you were not giving it a state.

You are doing some amazing things with States but I would caution you to not over complicate them. I mean it might be best to not attempt to do too much with states and keep the flow simple as possible. I am not saying you did or are doing anything wrong just wanted you to think about that.

PS. It is nice to see you doing this stuff and stretching the boundaries with it. Need more people doing that and it makes Samba even better.

1 Like

Thanks, i was starting to think that i was making it too complicated, then it just came to me to use the ticket tag instead and just have the one Entity and forget all the state changes and colour changes as they actually arent really needed!

You inspired me with your use of states lol so ive been experimenting lol. my Bar Tab entity has a field called Bat Tab limit so my next step is to figure out a constraint for my bar tab rule that wont allow orders to be added if the ticket total goes above that limit. You any ideas of how best to set that up?

and i just need to crack this remove staff entity action so when my auto assign logged in cashier to ticket rule kicks in, when i open a bar tab this staff entity is removed when my Bar Tab entity is added

A practice I do is I load up a stock Database and then try a simple basic version of what I am trying to do. Example is I would load up a default database then attempt to remove entities with just a basic Table Entity and work out my rules/actions until it works. Once it works then I look and derive how to integrate it with my own custom system.

BTW it was rather tricky but here is how I did it.

SSHOTS coming

Before Entity Removal:

After Entity Removal:

BTW I found an interesting side affect by using this… it allowed me to close a ticket with no Entity and recall that same ticket using the setting :stuck_out_tongue:


thanks ill have a go at that now!!

Ive sorted my bar tab limit too here it is, (no need for using bar tab limit in bar tab entity, just use constraint in the rule) for this to work a constraint is added to the new order added rule to stop it updating order states on Bar tab states/tickets

  1. recall an open bar tab

  2. add order that total more than the limit set in the rule (50.00 in this case)

  3. press the close and update bar tab button and the following error message appears and the bar tab cannot close as the total is more than 50.00

  4. either pay bill now then open a new tab OR remove the last item to take tab back below 50.00 as below

  5. press close and update bar tab button to close tab and log out

@kendash i was nearly there with my remove entity action and rules see below

  1. Order added and Rick Entity is added to ticket

  2. press open tab button and enter customer name then this screen appears

  3. if i just press the top left arrow to go back to pos the staff entity has been removed and Bar Tab entity added

How can i do the above without the search screen appearing??? here is my rule and actions for the above process

Mine does that too but you do not see it because its imediately displaying the ticket again using the Update Program Setting to store Ticket ID and Display Ticket with that ticket ID that was stored.

The Program Setting and Display Ticket action was exactly for that :stuck_out_tongue:

that wouldnt work for me, ill try again

Your doing way too much in one rule. Instead add an execute automation command action and then have it do just the actions i listed above.

BTW you did actually type Null for Entity Name?

You should actually type Null for Entity Name do not leave it blank.

IT Works!!! Thanks again (i missed the Null out when i created a new rule oops) :slight_smile:

1 Like

I will let you in on a secret. You could have typed Donkey there and it would have worked. Just dont hire any employees named Donkey or Null or you will have a conflict :stuck_out_tongue:


haha excellent!! I thought you could just leave it blank to remove it didnt realise you could literally type anything lol

Well Bar tabs setup is complete :slight_smile:

Technically its a hack that its working lol. Its not that its removing it… it is adding an entity that does not exist.

BTW you could leave it blank to remove it… but it immediately wants you to add another or hit back button to leave it blank. I found a way around this by adding a bad entity to it. It may not be the best method but for now it works. @emre may design something later to make it easier.

PS. Technically you could use this method to auto assign at ticket create… and then you could park tickets that do not have Entities… and recall them via Ticket Id. It would be a clever hack or if you prefer a clever trick to bypass the default flow that you can not close tickets without payment that do not have Entities.

i have a parked sale system set up, and as i have the cashier auto assigned as an entity to the ticket when ticket it created i can park sales, but id do a entity change to remove the staff and add the customer anyway as i have it setup to print receipt with customer details on

nice little hack though :slight_smile:

Lol it exactly removes entity and not a hack. Might seem like a hack for staff entity case but if you use same action for coupon entities that behavior might make sense.



Sorry, just had to get that out.

1 Like