Ticket Number skip but Ticket ID is not what would cause this

i have the action print invoice when press close button on payment screen… i test on some rules/actions to print after all process is done.

Add Save Ticket Action before print

(S)He is not using Ticket ID or Ticket No. (S)He is using a custom Program setting and Ticket Tag ({TICKET TAG:TID}), which is updated and applied via Automation. So any Ticket operations (ie. Save/Close) will have no effect unless they are configured to update the Ticket Tag.

What I have shown only applies the TID when the Ticket is Paid in full, but you need to do more in order to control the TID update and application. It becomes more complex, but is still doable.

Knowing more about the setup will help.

  • You need the TID generated on Bill Print
  • You need the TID generated on Ticket Close, because it invokes Bill Print
  • Do you have more than 1 Ticket Type? If so, should the TID apply to all Ticket Types, or only a specific Ticket Type? Maybe we need other numbers in addition to TID for different Ticket Types…

You will need to show every Rule that invokes the Execute Print Bill Job Action.

1 Like

So for example, you need to change the Rule in my prior post to Constrain the Actions to check whether or not the TID has been applied yet via some other operation so that we don’t re-update it and re-apply with an overwrite. We do this with an Action Constraint as such …

'{TICKET TAG:TID}' == ''

And in the Rules where you execute the Print Bill Job, you should add the same TID update/apply Actions, just before the Print Bill Action … this is an example, and I have cropped out some of the other Actions that are in this Rule, but you should get the idea …

Here is another example, which updates and assigns the TID when the Ticket is Closed via the “Close” button …

There very may well be other Rules (Events) that you need to add to or change for this to work flawlessly for your setup, but without knowing exactly what you have implemented, it is impossible for me to say which Rules you need to modify.

1 Like

OK i test with many options and work fine in most situation, in some times skip number (pass from 2 to 4 and unknow the problem), aditional add this rule to seattle because if not close ticket before the print not show the TID. I review the database and the “[{“TN”:“TID”,“TT”:1,“TV”:“33”}]” is create with ticket and not after close / full payment. the problem is because if make 2 diferents tickets in one table skip many (and very rare) numbers (pass from 32 to 61 and after to 33), i think is a great solution and think creat a button with the action to “create document until full payment manualy”. now try to test this solution with variants to review the final solution.

tanks for help.

I cannot see how that is possible, unless you have some other Rules or processing that is using a Program Setting or (more likely) Ticket Tag of the same name as TID. Are you sure that is not the case? It must be the case, since there is no other way that this would be possible.

I mean, how in the world would TID go from 32 to 61 then back to 33 ? The Program Setting {SETTING:TID} is set to increment by 1 and the Ticket Tag {TICKET TAG:TID} subsequently uses that Program Setting.

Your screenshot clearly shows the TID Ticket Tag being set to 61 out of virtually nowhere, then it goes back to using the incremental setting. There must be an Action in one of the Rules that caused this, perhaps from a prior implementation or flow trial.

Something else must be going on… there is a conflict with the TID Ticket Tag assignment. Maybe change the Name of the Ticket Tag to something else, like BID or BILLID, and for good measure, change the Name of Program Setting to BID/BILLID to match the Ticket Tag Name as well.

Once you have done that, test it all out again. If you experience the same issue, you need to have a clear way to reproduce it, so we can fix it or work around it.

hi, no, i use clear data / app to test,

THE PROBlem is because the rule are “Before ticket closing” and the ticket is close if move from one table to anoter and merge the tickets (create a new ticket and increase 1 per ticket merged), but the solution is use event “payment process” because is triger until payment is done and not befor ticket close, because is just 1 time executed using payment process the “ticket tag” is null (correct null of course) and the increase maintance correct.

one question more: how change the TID number just because correlative are diferent and need begin the TID with a specific number (and increment 1 by 1 after of course). PD. Every time clear all database the TID use same correlative like the increment number is localy or someting, if you se the data are clear (ticket number) but ticket tag no rebuild numbers of TID (rare)

tanks

What if you have two payments on a ticket?

So sorry, I am having great difficulty understanding what you are trying to say due to the language barrier.

To change the Program Setting, you can do it 2 ways:

  1. Fire an Action to Update Program Setting, with Update Type set to Update, and value set to the number you want.

  1. Program Settings, when set to Is Local = False are stored in the DB, in the table called [ProgramSettingValues]. You can run an UPDATE statement to alter the appropriate Setting …


It all depends on how you want the flow to operate for your needs. When you are satisfied with the way it works, it will be a good idea to post screen shots of your setup (Actions/Rules) for others to learn by.


Should not matter, so long as you Constrain the Actions as I previously showed. That way, we are certain the Program Setting update and Ticket Tag assignment only occurs once per valid/real Ticket.

@Jesse

I have a coney island that has 2 stations and complained about ticket numbers missing in their ticket pile at the end of the day. They never merge tickets. Could it be if they start a ticket in one terminal and then start a ticket in another terminal and then cancel the ticket on the first terminal leaving that ticket number empty (missing)?

Ticket number but not ticket id, ticket number is available before ticket close id is only available on ticket closing (submission to database)
Or they could be neglecting to take in to account ticket which have been completly voided maybe.

WOW… I take it back. I see what it is doing when Merging Tickets! It combines Ticket Tags of the same name, effectively summing the TIDs in our case.

Look at the DB …

When Tickets are Merged, it combines the Ticket Tags of all of the Tickets. So this explains why it is adding the TIDs together. Having trouble thinking of a way to work around this…

Work fine, i try up to 4 types of payment in one ticket and not have problem … i deep testing now…

@Hasa ticket numbers skipping can and does happen for various confirmed and expected reasons. I am not talking about ticket number I am referring to ticket id. There has only been one instance of ticket id skipping that I know of and it was not Sambapos related it was a SQL server bug.

PS yes that would cause it.

1 Like

STATES ! So this overcomes the issue of the Ticket Tags adding together…

But it does not solve the fact that BILLID 10 and 11 become empty/invalid Tickets because they were Merged to BILLID 12 …

just as a note… in sql server the identity is not ever continuos/secuential because the identity create a id by transaction lock but if have a lock in 2 transactions and one transaction is not completed the number asigned to first is skip but is normal in Database like SQL, the incremental is (in fact) a id number (not random but not estrictly secuential), the only option to make a estrict secuential (in sql server of course) is make you own secuence with a triguer and manage lock options (lock transactions options), but in this options if 2 client try to take same number the database block one until the other is complete… this is not a problem in 10 users but in 100000 transaction is not viable and use incremental secuence (identity)… postgres SQL and oracle have similar structure… in resume this function is not a bug, is a feature.

1 Like

You are absolutely correct the bug I was referring too was something specific with @QMcKay system that happened a while back and it should not have happened. {TICKET ID} is a specific number tag I am referring too it is the SQL Row ID and its not the same as {TICKET NO}.

Hello,

I totally agreed the number is assigned when full payment is done and without a skip.
I follow this Tutorial to set the TID number running and its works.

But I don’t know how to have a sales report by SQL, which is the supporting document for a period Sales.
I want a report as following
Select Date period
TID number / Ticket ID/ Date and time / Total Sales / Tax total / Grand Total / Payment .

Would you help me to work it out?
Thanks.

That part should be pretty simple… your issue I think will be payment, multiple payments on a ticket will most likely cause multiple likes unless you .SUM the ticket payments but then total should == payments LOL unless you ass a discout/calculation column.

Hello JTRTech,
Many thanks for your kind response.
Would you kindly teach me how and show me the SQL script cause I am new in SQL.
Appreciate !!!