Reprint a coupon after a printer bug

Hello, Is there an easy way to reprint a coupon after a printer bug?
Sometimes when there is a bug with printer (no more paper, unplugged…), the coupon entity is created in database but the “print entity” action fails.
Is there an, easy way to reprint it or do we need set specific action/rules/automation command to reprint it?


Yes you’ll need additional configuration for re-print function.

Ok thanks for your answer,
I’ve set an automatic command button. That’s not perfect but it makes the work.

Can you tell me what can be the perfect solution for you? Maybe we can optimize configuration for better usage.

I’ve set an automatic command button which ask me a value (I enter manually the number of the coupon) and print it.
Problems : We need to know the REF so we need to search the last coupon sold in entity search.
And If we’ve sold 5 coupons in the same time, we need to reprint these one by one. (and long way if more)

Best solution : Set Action/Rules to load the last printing job (search ticket, display ticket, and reprint the printing job)
I have no idea if it could be possible.

Yes it is possible. Create Update Program Setting action and while printing execute it to store current coupon reference value. Store it as Local so it works as a temporary memory.

If you name setting as LASTCOUPONREF you can access this value with {:LASTCOUPONREF} tag from rules. Please notice it uses curly brackets and semicolon to differ from variables and printing tags.

Ok I’ll try to set it but how to do if we sell 5 coupons on one ticket?
If I put this action in “bath generate coupons” rules, that will store only one coupon reference in memory and at the next print, that will erase the previous.

So you can store coupon id list but this time if printing fails it will print 5 of them again. I think you should implement reprinting last coupon feature but also keep printing by id action somewhere for such cases.

This can be a solution for you too. That will be released on next update.

I’ve followed the tutorial but I don’t know how to apply this to “print entity” action.
When I reopen ticket, I see that I sold 5 coupons and if I reprint it, I just reprint “bill” but not the 5 coupons with barcode.

Yes. That’s right. To be able to print these you have to store generated coupon numbers within order.

Another idea might be storing last generated coupon numbers in a text file. Value Looper action can load values from text file.

I understand the theory but That’s too hard for me without a tutorial

It is easy than it seems. Start implementing “Text File Creation” feature from coupon tutorial. While implementing it:

  1. Skip “Create New File Name” action and enter a static file name for “Add Line to Text File” action. For example that file name can be “LastCoupons.txt”
  2. Coupon Line Parameter should be only {ENTITY NAME}
  3. Prepare a batch file (*.bat) to delete “LastCoupons.txt” file. For example that file can be “delete.bat”. It should contain “del LastCoupons.txt” line. Place it where LastCoupons.txt file generates.
  4. Create a “Start Process” action to execute this bat file. Place this action instead of “Create new file name” action. So every time you create entities LastCoupons.txt file deletes and recreates with last coupon numbers.

###Printing text File

  1. Create a new value looper action and enter LastCoupons.txt file path as value. So Value Looper loads file and loops each row. Name it properly not to conflict with other looper.
  2. Create a rule that handles value looper by it’s name and executes “Print Coupon” action. You’ll pass Looper Value to “Coupon Number” parameter of Print Coupon action.
  3. Attach this value looper to an automation command that displays a “Reprint Coupons” button.

I hope it helps.

Thanks for your help, I’ll try it this week.