Change Table color according ticket time status

Hi guys!

To follow up easier the customer orders, I wish the table colours could change automatically according the last order time.

For example: last order was 15 min ago, colour is light orange, 20 min ago, middle orange, 25 min, orange, 30 min, dark orange, 1 hour is red.

Also would helps to follow up easy how long customers wait for their food etc.

I checked already in forum and know is the relation between the STATUS, maybe I must create new Entity State Status for each time frame?
And must create Rules? Checking the wikidocumentation to this topic (https://sambapos.com/wiki/doku.php?id=states) I dint find any example how to change the status based on TIME?

Maybe you guys can give me a hand and create me an example?

Thanks in advance!

Factory47

2 Likes

This issue is very important for me as well. I’m trying to set it up now.
So let’s keep in contact.

You can color buttons depending on minutes by using Automation Scripts.

I created a script with fn handler.

function getColor(minutes){
  if(minutes > 60) 
    return 'red';
  if(minutes > 30)
    return 'coral';
  if(minutes > 15)
    return 'orange';
  return 'green';
}

… and updated State Format to call fn.getColor function to get color for specific minutes.

This is the state display format I’ve used. It both displays colors and minutes.

<background {CALL:fn.getColor('{ENTITY STATE MINUTES:Status}')}>$1<br/>{ENTITY STATE MINUTES:Status}</background>

For production use you can prefer to use this format to reduce database queries. It will only update button colors.

<background {CALL:fn.getColor('{ENTITY STATE MINUTES:Status}')}>$1</background>

If you need more info about formatting table buttons you can read this tutorial.

4 Likes

hi emre,
this script working well but there is a problem about last order time…
table color varies by opening time so i need to varies by last order time
cos when we have new order process should start over again…
i mean; colors cycle restart…
and now i realized , display isnt auto refresh,
best regards

refresh time is an option on entity screen settings.

I tried but i cant… i choose auto refresh and set up 5 again… not working :slight_smile: i m making a mistake but i dont know where?

Is message server setup and connected ok?

Message server and others setups ok…
Actually auto refresh working as change button colors on display,
when i close table (receive payment) table color have been same as last color,
i was checking amounts 0 but table looks like open :slight_smile:
button looks normal after a few minutes or when i close-open pos screen a few times…

And now; I realized when on entity screen if you do ctrl+shift+d (editing mode) page refreshing :slight_smile:

is this settings correct?

I tried everyhing many times… Entity states refreshing ok…
there is a problem when i close ticket button colors doesnt change for a few minutes…
so when i close ticket, table looks like open…

What’s that, entity grid widget options? Can’t read your language so not sure on half the settings. But I’m sure refresh rate is option on entity screen settings in the manage section rather than edit mode.

Those are automatic Entity State Updates communicated by the Message Server. It has nothing to do with SQL Server Database connectivity.

Set the Refresh Seconds to: 0

I did but unfortunately same :frowning:
when i use different code table is closing…

Show your Before Ticket Closing and Ticket Closing rules

Hi, kendash thanks for your support

Can’t see because you put arrow over the field but looks empty, total should = 0 if that’s the rule to make entity available again but hard to tell in another language with actions closed.

Hi JTRTech , thank you…
when i make this value with 0, button colors dont change…
i changed my program’s language settings now maybe you have an idea about this situationea6|690x559
ea1ea2ea3ea4


This is very hard to follow made worse by diferent language.
You have shown an update entity state action called ‘varlik durumunu degistir’ then a rule with different actions in it???
Also whenerver you post a rule you need to open the actions with the dropown arrow, there are fields within that the rule is dynamically updating because of [:fields] in the action…
You not helping us help you.

yes you are right its my fault coz i dont know this program exactly thats why i need someone’s support, if i know everthing why i would like someone’s help? i just use this program with default settings (i changed some necessary settings via sambapos knowledge manual) , if there is a problem on program maybe developers can help me of course if they want… thanks for your help until now

And you have had 3 of maybe the dozzen most active and experianced users try and help you but its hard as its a primaraly english forum and your screen shots are in your native language and your showing unrelated parts.
Were trying to help but not getting what we need to do that.

1 Like

here is a workplace, we have 80 tables and many customers…
so you wants i ll uninstall program, i ll stop our service, i ll forget customers and install this program in english…
i think better dont help me, thanks for your support…
we have to work…