Urgent ... Weird behaviour when incrementing system variable

Yes, here is how it looks like when ordered by time (settled time):

(don’t look at the waiters, these are TU, not PU)

Yes Kendash, I was thinking of that or even changing the order of the action in my rule, like:

  • Tag ticket
  • Print
  • SerialNumber++

That might change this erratic behaviour, I might have less double but I’ll never be sure that it works the way I expect.

That’s quite a thing. I’ll make a try.

???

Sorting Rules works. It can be important in some cases that some Rules are fired before others. That is what the Sort Rules feature is designed for.


Well, yes they do. That is why it is importatnt to put Actions in the correct order, depending on what you are trying to achieve.


Good idea and something I would definitely try. However, I don’t think that will solve the issue here. Something else is getting in the way or executing out-of-order.

Hold on, so your running sambapos twice on the same machine?
I thought you were meaning two terminals…

These are on two users so is this an RDP type setup?

RDP on tablet, wifi,
I personally am on a PC wired

Both SambaPOS run in their own memory space.
Global/local vocabulary applies to 1 instance of SambaPOS, there is no such thing as “global variable” between 2 instances of a program, there is communication instead (pipes, database, …) that’s why I prefer when @QMcKay talks about “SQL Stored”.

If you look at the “time” report above it really looks like that each instance works independently and that for unknown reason the SerialNumber has not updated the database.


I added terminal name on my report, right now all ok but the second waiter clocks in in 2 hours.
The lines without SerialNumbers are the “open tables”.

You havent edited actions while in use in a rule have you?
Your actions are all defined in action not rule, just thinking maybe if you have edited action and not removed, save and added back in to rule it hasnt refreshed the action parameters causing a flow which isnt doing what you think it is.
This is why I generally use [:xxx] for all action values I need and set in rule as updating/changing is easier and you can see all your peramiters within the rule rather than keep switching between rule and actions to see whats happening.

1 Like

I know I did take the actions out and back again but I am not 100 % sure I did it for all actions, I do it know, disconnect all terminal, restart the server.

ok I did it.

Still doubles + SerialNumber not updated in DB.

Interesting

Looks like SerialNumber (on DB) is now only updated by Celia (new clocked-in waiter)
Nope … not the case.

TKarina = terminal Karina
TCelia = terminal Celia

13:11

13:15

How is the number increasing if its not updated in database?

That’s the question.

In that report, I got the database SerialNumber with:

[SerialNumber:1, 3, 5]
{REPORT SQL DETAILS:
SELECT Id,Value,Name
FROM ProgramSettingValues
WHERE Id = '23'
:F.Id,F.Value,F.Name} 

How can I answer?
I did not develop SambaPOS

What happens if for X or Y reason the database is not “responding”
No error message trowned out
What happen if Action SerialNumber ++ finishes with a non zero error code?
Is the SerialNumber variable kept and update ?

I don’t know.

Show your actions/rules again now you removed/put back etc.

Did you try q’s suggestion of updating using formula rather than increase?

Thats how I would have done it as never used the increase option.

You hard-coded the Actions for creating the Serial Number. I told you to not do that.

Use [:variable] for all Parameters in the Action definition, and set the parameters in the Rule.

Once you have the Action defined properly, and have removed it from the Rules and Saved, and re-added to the Rules and Saved, be sure to restart all your RDP sessions. In fact, shut them all down before-hand.

Done.

Let’s wait …

Ok. Show the Rules now.

Too fast … no time to think … don’t know what you mean by variable with or without []

here they are but now not working at all (same Serial number printed again and again …)

Now I am lost … I don’t know what I am doing

Also for setting value “1” ?

I did

Your now trying to set the setting name using the setting value.
Using [:xxx] allows you to set the action field within the rule.
So in that shot your trying to set the setting name in the udate setting action using {GLOBAL SETTING:SerialNumber}
Not going to work.

Then set the values within the rule in the same was as you would have in a fixed action.

1 Like

Thanks JTRTech …

Lunch time is over … waitress 1 out, only waitress 2 in.
I also received 130kg of vegetable and meat (by plane) that I had to check and weight and finally trying the changes in SambaPOS - while I had the 2 waitresses working together, so that was a bit chaotic.

Now it will be quiet till 6pm when waitress 3 enters.

I’ll make your change.

Finally the 114! :slight_smile:

Around 7pm I’ll know if it work.

Marc