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

If your asking a question like that I strongly suggest you DO NOT change anything in database.
Values like that are relational and if you could changing your potentially corrupt or at least screw up your database.
Ticket ID is referenced in probably a dozen tables which link all the data together.

i try now but Ticket ID (in database is TransactionDocument_Id) is not work fine because when merge couple of tikets add a new TransactionDocument_Id and in database not skip number but if use this make a skip in bill/invoice and is the same problem… i try other options if the police not come before

Ticket id and transaction document Id are not the same thing, at least to my knolage,
Am stifling to follow, is you issue ticket id or transaction document???

If you so worried about the police, which personally find doubtful, follow up on WA sugestion about generating you own unique reference using program setting value and ticket tag, has been discussed many times of forum by people with similar consern as you.

They are not the same thing. Check the [Tickets] table …

DBfield                   Tag
------------------------  --------------
[Id]                      {TICKET ID}
[TicketNumber]            {TICKET NO}
[TransactionDocument_Id]  (no valid tag)

Now you might be looking at this and wonder why the [TicketNumber] is jumping around. This is because I have more than 1 Ticket Type, and they each use a different Number Generator. I did this to keep Staff and Quote Tickets out of regular Customer Sale Tickets.

Personally, I use {TICKET NO} ([TicketNumber]) as do most others.

ok i serius now… in resume i need a unique correlative,not skiped diferent of ticket id/no because is a legal document (invoice/bill) and it’s not possible skip any number by tax law, this number is “created/asigned” when full payment its done (one document by one payment complete). you can sugest the best option to make this operation? i review many many help forum but nothink have a solution finished, unknow if just my have problem with this because many countrys tax law need this type of number correlativve.

i try to pay for support but all say “it’s really easy just do youself”… and i have 12 days without a solution …

Ok, here you go …

Voiding Orders, Moving Orders and/or Merging Tickets should not affect this number, which I have named TID and applied it to the Ticket as a Ticket Tag, accessed by {TICKET TAG:TID}. This is because the TID is generated and applied to the Ticket when the Ticket is PAID in FULL.

##Ticket Tag


##Actions

##TID Update Invoice ID [Update Program Setting] (Action)##

Action Name: TID Update Invoice ID
Action Type: Update Program Setting
###Parameters:###
Setting Name: TID
Setting Value: [:TIDvalue]
Update Type: [:updateType]
Is Local: False

##TID Assign Invoice ID [Update Ticket Tag] (Action)##

Action Name: TID Assign Invoice ID
Action Type: Update Ticket Tag
###Parameters:###
Tag Name: TID
Tag Value: [:TIDvalue]

##Rule

##TID Update and Assign Invoice ID [Before Ticket Closing] (Rule)##

Rule Name: TID Update and Assign Invoice ID
Event Name: Before Ticket Closing
Rule Tags:
Custom Constraint List (1):
Execute Rule if: Matches
Remaining AmountEquals0

##Actions (2):##

TID Update Invoice ID

Constraint: (none)

TIDvalue: 1
updateType: Increase
TID Assign Invoice ID

Constraint: (none)

TIDvalue: {SETTING:TID}

##Mappings##

Mappings
Terminal User Role Department Ticket Type
****

You can have this print on your Tickets using: {TICKET TAG:TID}

2 Likes

ok this is exactly what I needed, works perfect, just a little problem (i workin on) because when print invoice the " Invoice: {TICKET TAG:TID} " print first time in blank (null) and after the reprint (after finish) print with number (correct numbert and all ok), I think is in rule"print bill" the first action is print and after make the other flow instructions… working on

It won’t generate TicketIds until ticket is closed. So if you press print before ticket closed it won’t show.

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…