Order Number Update with Multiple POS


I have two cashiers with two POSs and both of them are connected to the same database. Everything is working fine. However, I implemented an order number using tags according to the link (https://forum2.sambapos.org/index.php/topic,97.msg671.html#msg671) which resets whenever I close the work period.

Now the problem I have is that two orders from the the different POS are assigned the same counter (counter tag) sometimes. They are assigned different system order number, but the counter tag doesn’t always get updated according to the orders from the other POS.

How can I overcome this problem?


The first:

The second:

You need to make sure you are using Global Settings and not Local Settings, for example {GLOBAL SETTING:ORDERNUMBER}.

I had the same problem and made a few changes to the setup posted on the forum, here are screenshots from this setup I did which works perfectly on a multi terminal setup with 5 terminals.




Thank you markjw. I still have the same problem even though I have exactly the same settings as your pictures.

The first time I open the POS screen it works fine.

Like in POS 1 the first order will be 1
POS 2 the first order will be 2

Then they will have the same numbers

POS 1:

POS 2:

If I log out then login again after every order, it works fine, but the order numbers get mixed up if I don’t log out.

Any idea?

Did you double check, because if you just followed a tutorial on the forum, I am sure you do not have the same settings as I have. I had exactly the same issue as you and I solved it by making the changes I did that I posted above.

Please double check, especially you have to understand that {GLOBAL SETTING:ORDERNUMBER} (which I use) is NOT the same as {SETTING:ORDERNUMBER}.

Using {GLOBAL SETTING:ORDERNUMBER} forces it to save the setting to the database, which is what you need for multi terminal setups. Just using {SETTING:ORDERNUMBER} will generally make it a local setting, which is stored in memory only. That should work fine on a single terminal setup but obviously as it is per terminal, is useless for multi terminal setups.


Thank you markjw. Yes I am using global setting. I changed it after I saw your previous post, but still the same problem. I am using SQLExpress. What database version are you using?

The order number is stored in the database otherwise it wouldn’t get incremented in the second terminal when I logout and then login again. What is bugging me is that I need to log out and login after every order (in both terminals) to get the correct sequence.

There is bug in setting was discussed here. Actually GLOBAL SETTING:X might not read from database too read detail here

1 Like

Same. You have to use sql express (sql server) for multi terminal setups. This has nothing to do with the database though.

I can’t say regarding log out / login. I use this setup for a number of clients since I had this problem with the first one. Nobody has reported continued problems.

Can you post screenshots of all actions and rules related to this in your setup?

Sure. I am also using SambaPOS V 5.1.62.

I don’t think I messed up anything. Any idea?

Thanks for helping.

I am facing the same problem as well. Sometimes it works sometimes it duplicates the order number. Did you manage to fix this @thepirate89?


I am also facing the same issue on multiple POS. I tried with changing the update setting action with increase to update with the formul [=TN(’{GLOBAL SETTING:Order number}’)+1] and still cant figure out. If you have solved, please help

It can happen if both tickets are created at the same time. It could be a caching issue too. Can you tell us when it happens are the tickets created close to the same time?

Yes its not occuring every time. We have 3 Terminals (2 in ground floor and 1 in First floor) As a Token system is in place we need a automatic resetting numbering system. This duplication makes confusion in the kitchen (6 kitchens) . How can i get a resolution .

So the issue is if two tickets are opened close to same time. Maybe ticket created is not the best event to use. Perhaps use ticket closed event. Chances of that happening at same time is much slimmer.

It also would be more accurate ticket timing. If customer A took longer than customer B to finish their order you would want customer B ticket to be numbered before customer A

I mean update it on ticket created but tag it on ticket closed.

1 Like

Actually that would generate skipped numbers. Hmm there may not be a best answer. You can try updating and tagging on ticket closed. I think closing tickets would be much more rare to happen at same time.

Or try putting tag action in separate rule. Use execute command action in update rule.that delay may prevent duplicate.

Can you please elaborate.

I tried with Ticked Closed and that creates much more problem. If we reopen the ticket and add additional items a new order number is genarated

Yes you would need to constrain it somehow with a state.

Followed several methods and instructions found on the forum but still have problem with duplicating numbers. Even when a ticket is started and not closed in one terminal and at that time another new ticket is created on another terminal, both gets the same order number. Please if anyone has implemented in without duplication let me know possibly with the steps

I thought there was a known issue with using the increase option on that action, maybe a while ago.
Many people have similar requirement without issue.
I have implimented a daily ticket number for kitchen orders rather than have massing 6 digit numbers.
Id suggest trying a math method update to increase.
This is mu setup;