Entity Widget color change

I’ve followed a few tutorials but I guess I’m doing something wrong because none of these tutorials seem to actually relate to what im wanting to do…

I want to have entities widgets change color when an order is made. I managed to have colors change when an order is submitted but even when I closed it stayed that way. I understand how status works but basically let’s start from scratch here. From the time an order is made to the time it is closed via the settle > cash option we always used. I want it to stay red. I have a custom entity screen and can tell you about any custom settings. Can you just wend me a plain tutorial on what to do starting with step 1. I know I’m supposed to use the status setting which I did to… but I have removed all of these settings and reverted back to my database backup from yesterday so from step 1 can someone tell me how to have the button stay red while it’s open and change back as soon as it’s closed. Problem was samba still had closed tables status set as new. And all new tables were one color… again I have reverted back to default entity settings, so starting with step 1 what do I do?

I’ve set bill requested, available and new orders set to different colors under states. Nothing else is changed.

All tickets are closed. As you can see the computer seems to think some of these closed tickets are open. They were closed via the settle button… maybe adding a rule or action/automation button to mark the table as closed would help? Or setting up a way to make it actually close automatically would be nice. Still need help on that though. Would that fix the problem. If so How do I do that properly?


Status filter doesn’t fix the problem. I just need a tutorial on starting from scratch this is becoming very difficult and it’s a real pain not knowing which tables are open and which are closed. This program is live and the other day an order from weeks before got sent to the kitchen and cooked because the table was never properly closed. We can’t have that happen again. We need to know if the table is open or closed. Color seems to be the best way to do it since no one here really understands pos systems like I do.

There seems to be some stuff in rules and actions that relate to color change. Not sure what I can do with those.

Here’s another pic. Just please tell me what to do this is very difficult for even me and I’m very tech savvy

If I am reading this correctly, it sounds like you have some Entities stuck in States that are incorrect. This can happen when you mess around with the default State Flow, and it can be difficult to fix. You can change defined State colors, but it is best not to change default State flows.

In any case, you can run a simple SQL statement using SSMS to fix the Entity States back to the original “Available” state in one quick pass. You should do this when you are outside of a Workperiod - that is, the Workperiod should be Closed, not Open.

UPDATE [EntityStateValues] SET EntityStates = '[{"S":"Available","SN":"Status"}]' Where EntityStates like '%Status%'

Last time I ran sql to “fix” a “problem” we were on v4 and the entire system crashed and we had no backup. Afterwards we upgraded to v5. V5 was unable to recover the v4 database so we had to start over with our menu and customizations and do it all over again. Luckily v5 has an automatic backup feature so if anything happens it’s an easy restore. Even so, I’d rather not jeopardize all of our hard work. Even though we have backups of our database this should just be a simple fix that doesn’t require me to jeopodize all of our hard work. What I’m saying is I’d rather not use sql… Due to past bad experiences… is there any other way to fix this issue? Restore all states back to default so they will be in the proper state from now on.

I created a send button that sends orders to the kitchen printer maunally. It used to be when you closed it automatically sent and we didn’t like that. We have 2 send buttons. One for sending new orders the other is “send all” and it sends the entire ticket. They use whichever is appropriate depending on the order status (new or submitted) closing it tricks the system into thinking it was sent to the kitchen but it won’t actually send unless you use one of the send buttons. I remember I had to modify the close ticket rule not to print and then I made a new rule/action that was linked to my send button that tells the kitchen printer to print. I also have a rule setup that plays an mp3 sound in the kitchen to tell the cook to check the printer for a new arriving ticket. It plays whenever the send button is pressed. As far as I can tell I haven’t messed with any “states” but I can send you pictures of anything you need. Here is a picture of the send button. Everything was done and is working properly and like I said I didn’t modify anything to do with states that I can remember. I dont think this is related to my state issue (is it?) If I did do the sql thing would it mess with this configuration in any way? And if it does fix my problem but messes up this little feature I can do a backup restore right? Here’s a picture of our button setup anything else you need to see let me know. Oh and just fyi we would seriously pay money if we could finish setting up and customizing our program with the help of some phone or remote support… yeah I know this forum is our only option and where samba is free other programs cost thousands so they can provide extended support. It would just be nice to have actual support instead of it bring on this site.
sw

There’s also a close ticket button that quickly cashes out and clears the table. I didn’t have to do anything with this. I just turned on the button in program settings. it doesn’t matter how I close the table though it still thinks it’s status is new when it’s been closed so It won’t change back to grey when the table is closed. I haven’t tested to see if there is a time amount before it changes back but we need it to change colors immediately based on its status.

We are interested in Entity States, not Order States, nor Ticket States, so your screenshot in your latest post doesn’t reveal anything regarding the State of the Table Entity.

Show screenshots of all of your Entity States. The ones outlined in [color=Red]Red[/color] are the ones we are interested in:

Like this:


Please also run this query and post the results. It is non-destructive, and will not alter anything in your DB:

SELECT
sv.[Id]
, et.[Id] as [EntityTypeId]
, et.[Name] as [EntityType]
,sv.[EntityId]
,e.[Name] as [Entity]
,sv.[EntityStates]
FROM [EntityStateValues] sv
JOIN [Entities] e on e.[Id]=sv.[EntityId]
JOIN [EntityTypes] et on et.[Id]=e.[EntityTypeId]
WHERE 1=1
AND et.[Name]='Tables'
ORDER BY et.[Name], e.[Name]

Well, yes there is always another way. But it will in essence do exactly the same thing. It involves creating an Automation Command (button), an Action for Update Entity State, and a Rule to handle the click of the button to fire the Action. You would then use this automation mechanism on each Table…

  • select the Table in the “bad” State
  • click the button to reset the State

Please understand that the concept of a “default State” does not really exist, except in the case of the creation of a new Entity (V5). For example, you could create a new Table, and it will receive initial default State(s), if it is defined as part of the Entity Type. But other than that, SambaPOS has no idea what a “default State” is.

@polosrestaurant … Look what I found…

It is already a feature built in to V5 … there is your solution without using SQL or creating any automation.

Manage > Entities > Batch Entity Editor

  • Select the Tables tab
  • Refine the list using the Search box
  • Select the checkbox next to each of the “bad” Tables (or right click and choose Select All)
  • Click Update Entity State
  • Type in the box: Status=Available
  • Click Ok


The feature was introduced in 5.1.32, and I just stumbled across it while searching for something else …

3 Likes

Well I’ve tried everything and nothing fixes the issue. I haven’t ran sql because sql sms isn’t installed on this pc. We generally don’t connect this pc to the Internet so that’s another reason we want to avoid using sms… but nothing else works. Like you said it looks like some entities are stuck in different states. I’ve tried deleting all or my entities and entity screens and starting over with a new screen. Still does not fix the issue. Here is a picture of my current configuration. It shouldn’t be this difficult just to get open tables to turn red when they are opened and then turn back grey when they are available.


You don’t need to run SQL. There is a built-in tool to update Entity States in V5.

That explains the poor screenshots :stuck_out_tongue_winking_eye:

Did you try the Update Entity State link I posted above to set all Table Entities to Status=Available?

You are correct, that will do nothing to overcome the issue. In fact, deleting Entities is a very bad thing. How did you manage to do that in the first place? SambaPOS does not allow deletion of Entities once they have been used in a Ticket. Did you mean States?

Your pictures show that all your Entity States have the same color (#00FFFFFF which is Transparent), so they will not appear to change color, ever.

It isn’t difficult. You need to give each State a different color to see any changes.

  • for State New Orders, set the color to Red
  • for State Available, set the color to Grey
  • for State Bill Requested, set the color to <whatever you want, eg. Blue>

“You don’t need to run SQL. There is a built-in tool to update Entity States in V5.”

The feature you showed me did not fix my problem.

“That explains the poor screenshots”

Yeah… I could do a print screen but taking a pic and uploading with my phone seemed easier than doing a print screen and then putting it on a flash drive and uploading from a different pc with an Internet connection.

“Did you try the Update Entity State link I posted above to set all Table Entities to Status=Available?”

Yes…did not fix the problem

“How did you manage to do that in the first place? SambaPOS does not allow deletion of Entities once they have been used in a Ticket. Did you mean States?”

I deleted some of my entities (the ones it would let me) and created a brand new entity screen with new entities. When I realized that it did not fix the problem I did a database restore from one I created moments before incase I screwed up. That’s a great feature and a huge life saver.

“Your pictures show that all your Entity States have the same color (#00FFFFFF which is Transparent), so they will not appear to change color, ever.”

Yes I am aware of this. It’s what I reverted back to when the color configuration did not go as planned. Didn’t want to make it confusing for an open table to be red.

“It isn’t difficult. You need to give each State a different color to see any changes.”

I’ve done this but again… available tables and still red or whatever color I set the occupied tables to be. Apparantly the entitiys are stuck in certain states… Basically I only need two colors. Grey for available, and Dark Red for occupied. No matter what the status… if theres an order of any kind that hasn’t been closed, it should be red… if not, it should be grey. But somehow samba is confused about which state the table is actually in. It will say new but it will be the color I set the bill waiting state as. Make sense? So how can I fix this? I tried the method for resetting all states to available but it’s still same old same old with the entities. Not changing colors properly.

I really wish you offered telephone or remote support of some kind. We would gladly pay to finish setting up and customizing our system.

Well, I just tried it with a currently occupied Table (Status=New Orders, which by default is Orange). I use the tool to set that Table to Status=Available, and now it appears White, which is the default color for Available. So I do not understand what “did not fix the problem” means. The tool works. It should really only be used when the Workperiod is closed though.

Set color for the State named Available to Grey.

Set color for the State named New Orders to Dark Red.

Set color for the State named Bill Requested to Dark Red.


I am a user of SambaPOS - the same as you. I volunteer my time to help people, because I have a very good understanding of how it works. I enjoy solving problems, and the challenge of working through ways to develop setups that other people ask for.

Make a post in the Ads Category. Someone will probably PM you to help.

I’ve tried all of your suggestions and followed them exactly. Now the computer thinks occupied tables are available. Same problem but now it’s the opposite… it used to think available tables were occupied, now it thinks occupied tables are available. So same problem but opposite. Getting very frustrated at this.

This issue was never fixed, its been moved to the back burner but we would still like to have our entities widgets changing color properly. ive tried every suggestion but theres some kind of issue… somehow during configuration of the program, samba is no longer recognizing proper states. how do i fix this? it sure would be nice to have this fixed. this is our only major problem with samba… going to 3 different tables before finding the right one… please help!!

The best method for you to fix this would be to setup a new fresh database of SambaPOS and then look at its state setup and use that to fix yours. You can do this by simply changing Database in your connection string to a new database name. SambaPOS will create a new database using that name. You can switch between it and your primary database by simply changing that name in the string.

Id rather not mess with SQL seeing that it took forever to get it running on this pc, one wrong click and we would loose all of our client pc’s… but I can use one of our client pcs and disconnect from the db then do a clean install with the sample db and then compare. I will come back later with news, between now and then feel free to leave more suggestions.