Print Last Bill

Should the steps in this post: Print Last Receipt via Automation Command - #8 by QMcKay
Work in the current version?

Yes it will work just fine.

Then I’ve done something wrong :pensive:

Here’s what I have so far.

I’ve created the Store Last Ticket Id Action:

StoreLastTicketId

This is a little bit different here because I don’t print a bill with every transaction. 99.9% of customers don’t want one so it’s just a waste of paper so I’ve put the action into the Settle Rule:
Settle Rule
(I’ve put the Store Last Ticket ID Action above the Display Payment Screen Action since taking this screenshot)

Created the Automation command button:

PLB AC

Created the Load Ticket action:

Load Ticket

and Created the Rule for the Automation command button:


PLB2

If I run with this I get:

Last Ticket ID 0

and the subsequent print is a list of the ‘Bill’ template with placeholders and variable etc.

If I change the Settle rule ‘StoreLastTicketId’ action to {TICKET NO} (like on the printer template) from {TICKET ID} I get the actual last ticket number displayed in the above message.

However the last ticket number was 27584 but the ticket that prints is 13716
If I create another ticket, 27585, the ticket that prints is 13717

I hope that all makes sense?

One thing I did notice is that the original post has no ‘TicketId’ in the Refresh Ticket Action where my Action has that field. Should I put {SETTING:LastTicketId} into that field?

Ticket iD does not exist until after you submit the ticket. Ticket ID is only generated when it creates the ticket in the database. Store it in Ticket Closed event.

Also, you shouldn’t need to load ticket, you can pass ticket id into the print job action directly :wink:
Just make a new execute print action with ticket id field carried into the action.

Plus Jessie comment about ticket id.
My print last bill is on the mark ticket closed rule which I think is before ticket closing with balance 0 constraint.

1 Like

Thanks guys, I’ll try this after work tomorrow, cheers.

Hmmm, no joy with that either. I tried both suggestions. Still the only way to get an actual ticket number in the message is to use {TICKET NO} (instead of {TICKET ID}) in the StoreLastTicketId action.
Capture

But even then, nothing prints :worried:
Maybe I’ll delete and try again from scratch.

What rule event is that in?

It was in the Settle rule then I tried the Close rule then Closing? Rule (sorry can’t remember the exact rule name, I’m at home right now).

See this old tutorial of mine.

I’ve solved it!!!

Basically my Refresh Ticket Action had the TicketId field (because I had copied from another Refresh Ticket Action). When that field was empty a value of 0 was passed on instead of the actual ticket id.

Thanks for all the help guys!

1 Like

And just an FYI…

I added a widget to my main screen:


PLB Button Settings

I can run the command from here just fine. :nerd_face: