Generate two different numbers to two different invoices

Hello guys! I have a problem in my country there are three different types of bill. 1) the ticket: normal without a serial number. 2) Fiscal Receipt ticket: identical to the ticket, but with a progressive number. 3) Ticket Invoice: Equal to the ticket but with a different sequence number yet. In my local the bill is printed after completing the order and so the kitchen sent all courses. I followed many tutorials to make it but I encountered problems. After closing the order you can no longer change the “ticket type”. There is another way to get two numbers generated differently in bills?

You can generate any numbers by using Update Program Setting Action.

When and how you trigger each one?

thanks for the reply! when customers have finished eating, they ask the bill with or: regular ticket (A sequential number eg 01111) or by invoice (A numerical example: 00121). I have to be able to print one of these after the order sent to the kitchen

I can call in the print template?

I think i have seen this so many times. Can you use search fiscal bill or invoice?

BTW, I can’t understand why your country using this system. Isn’t it easier to cheat tax, lol, no offend? I guess when ppl ask for fiscal invoice that mean you have to report to tax agency. That is great :smiley:

Hmm… I can’t find it. Don’t remember magic keyword :blush:

Basically, create 3 global program settings (save to database) INVA, INVB, INVC and automation command button (or edit default Print Bill) with command value with Number Group 1, 2, 3. When click print bill, it show 3 choice of number 1 2 3. Create Rule when command value 1 update INVA (Update Type “Increase”) and Tag ticket what the number. In printer template you can just use Ticket Tag as Inv number, no need for extra template.


OK! :heart_eyes:
first step is here ?

Ok! But is possible to increase automatic number INVA?

No, Product Tag Captions are used to set special information about individual Products.

What you are looking for is in Automation. This is where the real power of SambaPOS is realized. Go to:

Manage > Automation > Actions

Create a new Action. You can create 3 separate Actions for each Invoice, but for more flexibility, you can create a single Action that contains [:parameters] that you can use with any of the Invoices. So, create an Action of the Type Update Program Setting

Create another Action of the Type Ask Question. We will use this to prompt the user to choose which Invoice they want to print …

Create another Action of the Type Update Ticket Tag. We will use this Action to save the Invoice Number with the Ticket, so that you can recall it at any time.

Create another Action of the Type Execute Automation Command*. We will use this Action to perform intermediary operations.

Now you need to make a decision. You can have 3 different “Print Invoice” buttons below the Ticket, or you can use a single button that prompts the user to choose the Invoice Type they want.

@sukasem suggests that you could modify the default Print Bill button Rule so you don’t need to create any new buttons. In that case, go to:

Manage > Automation > Rules

… and find and open the Print Bill Rule …

This is what my Print Bill Rule looks like - yours might be slightly different:

So what do we do with that? We can add our Actions to this Rule, or we could Clone the Rule and make modifications to our new copy of the Rule.

If you decided you want to use the Print Bill button to make this work for you, we need to make some major modifications to this Rule to achieve the proper flow (sequence of operations).

So lets start by Cloning the Rule. Close the Rule, then right-click on it and select Clone Rule

Change the name of the Rule, and change the Custom Constraint, then click Save. We will come back to this Rule a bit later to make more modifications…

Now open the original Print Bill Rule, click Select Actions, and move all the Actions on the RIGHT over to the LEFT. We are effectively removing all the Actions from the Rule, and we will add our own here instead.

While you still have the Action Chooser open, type in the search box below the LEFT list "IC " to filter the Action list so we can see our Actions easier. Move the IC Ask Invoice Type Action from the LEFT to the RIGHT, then click Ok …

Supply the parameters for the Ask Question Action, then Save the Rule:


Choose Invoice Type


Invoice A=INVA:Orange;Gray,The B Invoice=INVB:Green;Gray,An Invoice I call C=INVC:Purple;Gray,CANCEL=Cancel:Red;Gray

:bulb: TIP: The syntax for defining a button in the Ask Question Action is this:



IC Print Invoice








Let’s test it out …

Ok, you notice there is nothing different about this, except for the prompt to choose the Invoice Type. The Bill prints the same as it always did. Good. Nothing broken. Let’s continue to make more modifications …

1 Like

thanks so much to everyone I have succeeded

Ok, so are we done then?

Yes, thanks very much :kissing_smiling_eyes:

Is possible print three different print job, es: Fattura=Print bill1,INVAB=Print bill 2 ?

You can print unlimited print jobs. Just make the rules and actions.


But how set to in ask question?

Ask question is an action, if you need to base a rule/action on the returned value you need to use the command value of the ask question to trigger a seccond rule and the command value in that rule will be the value of the button from the ask question.


Apparently not :wink:

I never finished explaining the rest of the setup. There is much more to it, since the Ask Question Action sets [:CommandValue] and executes another command (IC Print Invoice), but that command has no constraints pertaining to the value passed by Ask Question…


I never stop to improve :stuck_out_tongue_closed_eyes:

however, I can not give to the three INVA the right print job