I need to print each new order in a text file and each file should have a different file name.
By adding a new Printer with the printer type “Demo Printer (notepad)” it’s not working because all files have the same name.
Next step.
I created this Printer, template, and printer job:
Finally, I achieved printing new orders in a text file and each text file has a different file name.
This is how the files look like when I have new order (below picture left side):
The main problem here is when I just open a table and close it without adding any new items it also creating me a text file without items (below picture right side):
I’m not in front of one of my work terminals to give you exacts, but you could add a constraint - order counts greater than 1 so that it ignores any tables without orders.
I tried to add a custom constraint in my rule but again when I open and close a table(without adding any new items on it) in which there are some items that are not settled yet it creates that file with just these three lines:
In case I open and close a table that is free(without any items on it) it does not create that file.
Is your states (Status) working correctly? When you add an item to a ticket it should have a status of “NEW”. After closing and reopening that status should change to “SUBMITTED”. Can you confirm this is what is happening?
When you created your “Print Fiskal File”, did you change the “Order State Name” and “Order State” after having in the rule? If so, remove it from the rule, save the rule, reopen the rule and add the action back in the place.
The Print Fiskal File should only fire when you have new orders, that’s what states fields are checking in the “Execute Print Job” action
If the above 2 items did not correct the situation, use this as a constraint: {TICKET STATE:Status}EqualsNew Orders
In addition to what Bob_be suggests, I would also suggest moving the Print Fiskal File action into its own rule and instead of Ticket Closing use Before Ticket Closing. I find it best practice to isolate custom automation from the stock automation.