[Solved] When ticket is opened, counter is updated even if no orders are registered

We have been using SambaPOS for some time now (4.1.82). Looking back through the records I have found quite a lot of missing tickets. This appears to be caused when the user opens a ticket by selecting a table and then closes it again without registering any orders (maybe they opened the wrong table in error). Next time a table is opened, the ticket number has been incremented by two (or more if it happens several times). The overall effect of this is that there are missing tickets in the records.

I assume this is happening because the ticket counter is being incremented by one each time a ticket is opened, but is not decremented again if the ticket is closed with no orders.

In the example below, note that ticket 33343 is missing caused by deliberately doing the above procedure.

We get the same problem if the Add Ticket button is used without any orders being placed.

Is there any way to avoid this happening?

Have you moved orders to new tickets? Did you change any default rules particularly with closing a ticket?

@stevew Could you pm me a backup of your database?

Default behavior is it closes ticket and counter stays the same. So this behavior is caused by a configuration mistake more than likely.

Thanks for the response and happy to hear it shouldn’t be like this.

The above demo error was created as described, there were no orders moved to new tickets and as far as I am aware I haven’t changed any default behavior. Close ticket rule as follows, mapping is default

My database was 326MB when I backed it up this morning so PM it may not be very practical, but I can if you wish.

Ticket 33334 and 33335 were merged together. When this happens, the orders are removed from those tickets and placed into a new Ticket - in this case, Ticket 33336. Notice they are all the same table (0).

This is normal. Ticket numbers do not increase/generate when you open a ticket - they increase (they are generated) when you close (submit) a ticket, or Merge Tickets.

When you close a Ticket - or to be more accurate - when you Lock a Ticket (by default this happens when you print a bill, and in some cases when you close a ticket if you have it automatically print to the kitchen, the ticket might be locked as well), the only way to add more Orders to a Tickets is to Unlock the Ticket. There are a few ways this can happen:

  • add order, then select table that already has orders on it
  • select table, then add order (this will not occur if the ticket is not locked)
  • select table, click add ticket, then add order

In every case, a new Ticket is created for that Entity. The first one will give you the choice to merge the tickets, the second one will only be causal if the ticket is locked, and if so, the last 2 will merge automatically for you.

If you are experiencing behavior that is not in-line with the above, then something in your Rules is causing this… look for Rules that Lock the Ticket.

Backup your database with all transactions then Clear all transaction data and do another backup to send to me. If your not comfortable doing this I understand.

This issue will probably be very difficult for us to help you because both me and @QMcKay know what is happening but without knowing which rule is affecting it we cant offer you a direct solution. Furthermore it may be difficult for you to convey this information to us because you do not understand why this is happening. This is why I asked for a backup I can simply look at it and find the problem faster.

If you know for a fact you did not move orders and you simply just added an Entity then closed ticket and it did this behavior that means something was changed. Default setup does not do this so the only way for it to happen is due to configuration.

@QMcKay thanks for the reply. I understand what you say about moving orders and merging tickets and that all seem to be working. My problem is the missing tickets.

If I start with the current entry, we are at ticket 33348

If I now open a table (2) but don’t put any orders and then click close

and then again table (3)

and again table (4) but this time order something and submit

it has jumped to ticket 33351, i.e. it has lost two tickets 33349 and 33350

I have had a look at the rules and all seem OK, although it doesn’t help that I am not sure what I am looking for.

Check your rules for possible unnecessary “Execute Print Job” actions. Generally that action updates ticket number to be able to print ticket. For example if you place “print bill” action inside “Ticket Closed” rule that will increase ticket number.

2 Likes

Thanks @emre. That was the source of the problem.

I print a restaurant copy of the bill when it is settled (as the manager likes to check all receipts and doesn’t seem to trust the end of shift printout). The constraint I was using for this was “remaining amount = 0” so this was firing each time a table was opened and closed with no orders, but no receipt was printing as there was nothing to print, so it wasn’t obvious that this was happening. I have now amended this to constraints “remaining amount = 0” AND “Ticket Id > 0” and all is working fine.

Thanks to all for your assistance :smile:

1 Like