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

**URL:** <https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126>\
**Category:** V5 Question\
**Created:** [January 23, 2016, 5:11am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126 "2016-01-23T05:11:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukasem](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@sukasem](https://forum.sambapos.com/u/sukasem)\
**Post date:** [January 23, 2016, 5:11am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/1 "2016-01-23T05:11:34Z")

</div>

![](https://forum.sambapos.com/uploads/default/original/3X/e/7/e71e50ea8d396ddd8b1d2c46383a017fde8d08a1.png)

Any idea why Ticket Number skip?

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [January 23, 2016, 5:16am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/2 "2016-01-23T05:16:21Z")

</div>

Did you merge tickets?

EDIT: Sorry not merged but move?

> [@Ticket Number Configuration](https://forum.sambapos.com/t/ticket-number-configuration/2538/16):
>
> fyi: When you move orders across tickets new tickets receives new numbers and old empty tickets closes. When you list open tickets you may think numbers skipped.

It happens if orders moved to new tickets and original ticket is left with no orders.

---

<div class="post-metadata">

**Author:** ![sukasem](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@sukasem](https://forum.sambapos.com/u/sukasem)\
**Post date:** [January 23, 2016, 5:19am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/3 "2016-01-23T05:19:14Z")

</div>

> [@Jesse](#):
>
> Did you merge tickets?

Hmm, I think it left 0 amount ticket after merge.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [January 23, 2016, 5:20am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/4 "2016-01-23T05:20:31Z")

</div>

That would do it. It does this by design so you dont have empty value tickets… the new ticket takes on the ID of the old empty ticket once its closed and saved. Old empty ticket just closes.

---

<div class="post-metadata">

**Author:** ![sukasem](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/b38774/32.png) [@sukasem](https://forum.sambapos.com/u/sukasem)\
**Post date:** [January 23, 2016, 5:26am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/5 "2016-01-23T05:26:06Z")

</div>

I tried move table but ticket number have not changed (well, it just entity change, make sense to still have same ticket no). I will tried move orders in sec.

Edit: Move some orders current ticket (16389) to new ticket (16392). Then, merge it back ticket number change to 16392 and leave 16389 and 16392 empty ($0). I still see zero amount tickets.

I still can’t find how this skip. You know now we can’t move all orders in the ticket to new ticket right. After @Jesse split payment method.

---

<div class="post-metadata">

**Author:** ![ojarana](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/o/dec6dc/32.png) [@ojarana](https://forum.sambapos.com/u/ojarana)\
**Post date:** [April 1, 2016, 8:28pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/6 "2016-04-01T20:28:24Z")

</div>

I HAVE same problem and is really big problem because i use ticket number as a  
legal accounting document and have really big problem with tax, how use a diferent number or avoid ticket skip? is urgent because is on work the restaurant and cant back to old system. need a unique no skip number.

- PLEASE HELP IS URGENT \*

@Jesse

ok i think how resolve if can modify number on transaction id and use this to invoice/factura number… how change the number (or just modify on sql?) and how identify in print template this item.

 ![](https://forum.sambapos.com/uploads/default/original/3X/3/0/3040dc5f2eb1950569eaa890a4c55b501e2c3f55.png)

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [April 1, 2016, 9:32pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/7 "2016-04-01T21:32:33Z")

</div>

You should not modify those numbers in sql you will break something. So is {TICKET ID} not good enough?

{TICKET ID} is what you should use for accounting not {TICKET NO}

---

<div class="post-metadata">

**Author:** ![ojarana](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/o/dec6dc/32.png) [@ojarana](https://forum.sambapos.com/u/ojarana)\
**Post date:** [April 1, 2016, 9:53pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/8 "2016-04-01T21:53:40Z")

</div>

just need a number never skip… TransactionDocument\_Id is a number i review is identity and continuos. thicket id change and skip numbers and is a big big problem.

ok i review and noot work because Transaction Document Id is for every transaction, not only sales, and if add a inventory operation or someting modify this id, im frustrated with a big problem and unknow how make a id unike and correlative to every operation sales… ☹

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [April 1, 2016, 10:00pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/9 "2016-04-01T22:00:05Z")

</div>

Skipping canceled tickets is one thing but how can you expect it to skip all void tickets which have been created submitted then voided, do you expect that ticket number to get cleared and reused?  
You tickets would not be in sequence which tax people would not like as much as skipped.

I doubt that your financial system does not take in to account at all that a ticket can have a zero total (voided)

Any system would work like this!

If you used pen and paper on a duplicate book, what would you do if you made a mistake? Chuck the invoice but the void/mistake duplicate would still be in the book marked as void.

The skipped tickets are still recorded!!! Which is what tax people look for. Ticket Id is sequential and no skipped tickets just some tickets have 0 value

---

<div class="post-metadata">

**Author:** ![ojarana](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/o/dec6dc/32.png) [@ojarana](https://forum.sambapos.com/u/ojarana)\
**Post date:** [April 1, 2016, 10:03pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/10 "2016-04-01T22:03:16Z")

</div>

i try to use Number generator (i think is the best solution to avoid skip tickets) but can’t configure, i follow text instructions but witout print screen unknow why not work. i have a big legal problem if not resolve today this problem.

i just wait the police to go jail ☹

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [April 1, 2016, 10:38pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/11 "2016-04-01T22:38:16Z")

</div>

`{TICKET ID}` and `{TICKET NO}` are different things.

The **`{TICKET ID}`** is created automatically and is always sequential. This is handled by the SQL DBMS. It _should_ never “skip” a number. However, there are some very rare cases when it might do so, which is really a glitch in MS SQL…

The **`{TICKET NO}`** is created by the `Ticket Number Generator`, which is part of the `Ticket Type` definition/configuration. For the most part, it never “skips” either, but you _will_ have empty Tickets that are a result of Moving and/or Merging Orders/Tickets.

So take your pick. Use whichever Tag suits your needs. You can use either Tag in your Reports and Ticket (Bill) Templates.

If you really want to use another Number that you have complete control over, you could use a Program Setting.

---

<div class="post-metadata">

**Author:** ![ojarana](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/o/dec6dc/32.png) [@ojarana](https://forum.sambapos.com/u/ojarana)\
**Post date:** [April 1, 2016, 10:55pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/12 "2016-04-01T22:55:33Z")

</div>

OK {TICKET ID} aparently The solution, just try to change in database the number because need begin with a specific number and can’t change by table relational and index. but in working now…

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [April 1, 2016, 10:59pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/13 "2016-04-01T22:59:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ojarana](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/o/dec6dc/32.png) [@ojarana](https://forum.sambapos.com/u/ojarana)\
**Post date:** [April 1, 2016, 11:04pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/14 "2016-04-01T23:04:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [April 1, 2016, 11:11pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/15 "2016-04-01T23:11:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [April 1, 2016, 11:26pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/16 "2016-04-01T23:26:21Z")

</div>

> [@ojarana](#):
>
> Ticket ID (in database is TransactionDocument\_Id)

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

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

```

![](https://forum.sambapos.com/uploads/default/original/3X/a/9/a9fd05ab3a40fa740e47e6bc686ea95c67643e8a.png)

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.

---

<div class="post-metadata">

**Author:** ![ojarana](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/o/dec6dc/32.png) [@ojarana](https://forum.sambapos.com/u/ojarana)\
**Post date:** [April 1, 2016, 11:26pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/17 "2016-04-01T23:26:58Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [April 1, 2016, 11:37pm UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/18 "2016-04-01T23:37:50Z")

</div>

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.

![](https://forum.sambapos.com/uploads/default/original/3X/c/8/c8af35eb8897f9afb8f4eee97806588393871fb5.png)

##Ticket Tag

![](https://forum.sambapos.com/uploads/default/original/3X/c/0/c086677a7e1f777858402889f4d642b8775f817e.png)

* * *

##Actions

 ![](https://forum.sambapos.com/uploads/default/original/3X/3/9/3962e1505d29528b2eb98fc996ec96ccdea967d8.png)

> ##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` |

* * *

 ![](https://forum.sambapos.com/uploads/default/original/3X/7/a/7a37970e10d526a9d8bcb788d9067114df95a2c8.png)

> ##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

 ![](https://forum.sambapos.com/uploads/default/original/3X/7/7/774151e9db9a30cdf810e7ee10c67ecd48dd6287.png)

> ##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 Amount` | **_Equals_** | `0` |

##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}` …

![](https://forum.sambapos.com/uploads/default/original/3X/6/8/6883b2feb6e640e6d1829f853a08125a6767cc73.png)

![](https://forum.sambapos.com/uploads/default/original/3X/5/b/5b1c34f8b6bd033e258541d2a4f78088d8362cd4.png)

---

<div class="post-metadata">

**Author:** ![ojarana](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/o/dec6dc/32.png) [@ojarana](https://forum.sambapos.com/u/ojarana)\
**Post date:** [April 2, 2016, 12:39am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/19 "2016-04-02T00:39:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [April 2, 2016, 12:41am UTC](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126/20 "2016-04-02T00:41:20Z")

</div>

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

[Next page](https://forum.sambapos.com/t/ticket-number-skip-but-ticket-id-is-not-what-would-cause-this/9126.md?page=2)
