Display some Ticket Tag in Ticket Lister

Hi sambapos community,

I have a rule that gets fired when I click a “Print Invoice” button. This rule generates an invoice number that that sets a ticket tag. The invoice number is a program setting counter like in this tutorial http://forum2.sambapos.org/index.php/topic,97.msg671.html#msg671. In the invoice printing template I use {TICKET TAG:MYINVOICENUMBER} to retrieve the invoice number and it appears fine on the printed invoice. Later on I would like to display this invoice number in a ticket lister but it is always blank. It seems this tag only exists during the execution of the rule but is not saved in database or so.
In the rule the ticket gets reopened, ticket tag updated, saved and closed.
I tried to use ticket states instead of ticket tags but same problem, the invoice number is blank.

What’s the right way to save ticket tags or states ?

Thanks.

Here is the rule:

What state are you actually updating? Can you show that action?

Also can you explain why your using this? I mean what business flow are you attempting?

Are you sure that you don’t have any rule that untag it?
Open the ticket and show screenshot please.

I am updating a “custom” state (or tag) that I called MYINVOICENUMBER.

My goal is to print an invoice number (different then the ticket number). I also want to be able to show this invoice number later on when I display the ticket.

First thing I see is in your action for State your Parameter syntax is wrong… it should be [:FACTURANUMBER]

If that is all you want then just use {TICKET ID} and you can insert it on the Ticket with {TICKET ID} tag. Every Ticket is assigned a TICKET ID that is seaprate from Ticket NO. Its always increasing and is the unique ticket identifier for database. You can even load and display tickets simply by Ticket Id.

I think he has another rule/action to set program setting called FACTURANUMBER.

@devloic But I don’t see any Ticket Tag MYINVOICENUMBER in your ticket. That is why it is empty.
I think you use {:FACTURANUMBER} to print not {TICKET TAG:MYINVOICENUMBER}.

Show your ticket tag rule/action

hmm, I changed it to [:FACTURANUMBER] and now the printed invoice number is blank while it wasn’t with {:FACTURANUMBER}. The tutorial How to create the PERFECT BILL uses {:SOMEPROGRAMSETTING} syntax for program settings.

I can’t use {TICKET ID} because the invoice numbers need to start from some specific value, ex: 1000. (I set the initial value directly in database)

True, I have this action :

I use both for testing ( hoping that at least one of the two (TAG or STATE) would be persistent). Here is the printing template line I use:
<L00>Factura No : STATE{TICKET STATE:MYINVOICENUMBER}TAG{TICKET TAG:MYINVOICENUMBER}
Actually the invoice number is correctly shown in the printed invoice.

It’s later on when I want to show it in a ticket lister that it doesn’t appear.

There must be something that reset it. Both ticket tag and ticket state are persistent. Unless you have another action to reset it.

First try another simple ticket tag before ticket paid. Then paid the ticket and open it to see if you still have ticket tag.

BTW. Make sure you install more ticket actions in samba market. I think the problem is you trying to do things after ticker was closed.

Nice guess! The “more ticket actions” module was not installed anymore (although the action were still available). After reinstalling I got the tag/state in my ticket lister.