At what point can I store Ticket Id on a ticket

What point could I store Ticket ID on a Ticket Tag. I tried to store it on payment processed with {TICKET ID} it did not work. I tried it on Ticket Closed still did not store the tag. But it reads it just fine when ticket is printed.

I found it… its Before Ticket Closing… but it shows 0 so it is not showing the ticket id correctly. Is it not possible to store the Ticket ID in a ticket tag or am I just doing it wrong?

Out of curiosity, are you sure you want Ticket ID instead of Ticket NO ? Just asking, since they are different things, and you may have better luck with Ticket NO.

ID is DB related, while NO is generated.

No I want Ticket ID.
Reason: I built a Refund Entity Screen.
Uses a Task Type Editor you type in ticket ID or Scan barcode at bottem of ticket … it brings up the paid ticket to do refund transaction on.

This is so I can train employees to do refunds without giving them access to ticket viewer or main menu. It also makes it faster.

EDIT:I want to tag the ID on the printed receipt… Maybe I can just put it in the ticket template… it might print on receipt which would be same thing…
EDIT: Nope seems it wont print it there either. Maybe its because of when the ticket is printing let me try that.
EDIT: Tried after ticket closing still wont print it.
EDIT: Odd its not even printing my Barcode that had Ticket ID in it. IT was printing before the latest version. Now it is not.
EDIT: If i reprint ticket… it does print it. So something has changed that behavior. Its almost like its generating Ticket ID after its closed.

I guess I could use Ticket Number but I really wanted that for something else.
EDIT: Actually no I need it to be Ticket Id for the Task Type to work correctly. It may have to do with me switching Ticket Type’s during transaction. Maybe I should print ticket before that task is executed
EDIT: Nope that’s not it either…now I am thinking something changed with latest version of Samba.

OK. Try reading Ticket ID with {TICKET ID} tag on Ticket Closed rule.

You can use printer template tags in rules to read ticket values even rule does not publish that with a rule parameter.

We’re using Ticket Id parameter on before ticket closing to determine if ticket is a new ticket or not. If Ticket Id is 0 it means this is a new ticket. It works just before ticket gets saved and since Id is a database generated value it remains 0 for new tickets. Ticket Closed works after ticket saves.

It works with printer template on closed. But it will not update a ticket tag on closed. I would rather use printer template for it… but I would need to isolate it from printing on EVERY ticket closed it needs to just print on Tickets closed that are a specific payment method.

I only want this ticket template to print when specific payment types are used. Because I am using a Refund Payment type with Refund accounting. I have a separate Refund Ticket that prints for those transactions.

I will play around with it more. What I am setting up is kind of hard to explain to you the flow its quite complicated. I will attempt to show you the operational flow in a few minutes.

Why you need to save it as a ticket tag as you can access (and also print) it with {TICKET ID}?

I don’t. but now (TICKET ID) is not printing on my tickets when i have it inserted in Payment Processed. It was working yesterday. It will print if its inserted in Ticket Closed but that would cause that ticket to print on EVERY ticket closed… I don’t want that.

If I could put constraints on Ticket Closed rule to only run action if the Closed Ticket had a specific payment type… that would work.

SambaPOS does not save a ticket until you close it. This is atomic. It can save whole ticket or nothing so we never have half saved tickets.

However Ticket ID created when ticket first saved. Ticket Closed executes after ticket saves so changes on ticket at that time does not save.

Ticket ID may print or may not if print job started from Before Ticket Closed. Since printing works in a different thread it may print if it starts printing after ticket gets saved.

You can use [=TN'{PAYMENT TOTAL:Cash}'] > 0 as a Ticket Closed constraint.

Still thinking…

Here is the operational flow of what I am doing.

Customer Pays for their order:
Receipt prints for customer with the Ticket ID printed at the top in the form TR#: {TICKET ID}
Bottom of the receipt would contain <BAR>{TICKET ID}

Customer comes back to do a return:
Employee navigates to the Refund Entity Screen
Employee either Scans bar-code on ticket or enters the TR# into the Task Type Editor Widget.
I have it set to load the {TICKET ID} that was entered to perform a refund.

Refund is performed which changes ticket type to Refund Ticket, Changes Tax to Refund Tax and runs through a completely separate accounting system to track the refunds… its a reverse system.
It prints a specific Ticket Template with Refund Ticket at the top.

EVERYTHING is working except now its not printing the Ticket ID on my receipts… and if i put it at Ticket Closed it will mess up my ability to print unique receipts for refunds or Non Tax (Also using Task Type for Non Tax transactions running through its own Accounting as well)

The NON TAX system will use our Governments unique TAX ID numbers that are assigned to business owners… I will be making cards with those numbers on them for employees to enter into the Task Type Editor widget to start a Non Tax transaction and it assigns their unique ID to the transaction for tracking in case I get audited for Taxes.

So I have unique Printer Templates for every type of transaction.

So you should start printing with Ticket Closed rule. We can’t change this.

We need to check if we should print or not.

So we can maintain a ticket state to enable/disable automatic printing. When you enable it a print will start when ticket closed. If not it will print nothing.

I’ll try it now and also add screenhots here while trying it.

I am going to put full screenshots of my flow… its just so complex it will take me a while. I am integrating several systems that are common in the US for retail. I have setup 4 different accounting systems some of them overlap some dont. It took me a while to plan it all out. And the changes you made with this update made it all possible except for just the ticket printing.

OK. Let me test it…

If you want to take a look at it to understand what I am doing better I could just send you a DB backup.

You want to print a bill (and ticket id on it) if ticket paid with a specific payment type. Did I get it wrong?

That would work yes. Sorry i didn’t mean you got it wrong. I was just saying its hard for me to explain the flow because I have integrated several accounting systems around payment types. some of them overlap some are completely separate.

But it is all working the only issue was the ticket printing with the ID on it and only for specific payment types. This would prevent it from printing on a Refund transaction… but it would print on a Fast Cash payment.

I have 4 Primary Ticket Templates.

  1. Customer Refund Template
  2. Customer Receipt Template
  3. Customer Non Tax Template
  4. Customer Reprint Template

The only one thats majorly different is the Non Tax template because it has sections that need to be signed by a customer with a pen and retained at the store.

The other 3 the only difference is what it prints at the top EXAMPLE: Duplicate or Refund Ticket
So I don’t mind if TICKET ID is printed on all of those. What I dont want is Customer Receipt Template printing for a Refund Transaction I would want Customer Refund Template to print.

lol I don’t think a POS software other than SambaPOS can handle it. Even describing the requirement takes that much. I think we should design separate workflow for auto print. Can you please review it and let me know if it can solve your issue?

I’ll start by creating Enable Auto Print Action.

… and another one to disable Auto Print.

This rule disables auto print when you open a ticket.

This rule executes print job if Auto Print Enabled.


So what you need to do is executing Enable Auto Print Action if you need an auto print on ticket close. What do you think about it?

I think that would work. So I would enable that and it will auto print after that ticket is closed… I would not put the Execut Print Job action under Ticket closed rule… correct? I am pretty sure that would work.