# Tutorial: Basic Print Last Bill/Receipt Button (JTRTech)

**URL:** <https://forum.sambapos.com/t/tutorial-basic-print-last-bill-receipt-button-jtrtech/5588>\
**Category:** V4 Tutorial\
**Created:** [May 26, 2015, 9:48pm UTC](https://forum.sambapos.com/t/tutorial-basic-print-last-bill-receipt-button-jtrtech/5588 "2015-05-26T21:48:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [May 26, 2015, 9:48pm UTC](https://forum.sambapos.com/t/tutorial-basic-print-last-bill-receipt-button-jtrtech/5588/1 "2015-05-26T21:48:04Z")

</div>

I know there are other similar tutorials but wanted to upload a simple quick one for ‘Print Last Bill’

First you’ll need to setup a rule to log the last paid ticket.  
This is uses a update program setting action used in many setups and your likely to already have so havent’t gone into that. You could use local but I have used ‘not local’ and logged against program setting of LASTBILL\_{:CURRENTTERMINAL}  
Have added the two constraints to only log tickets that are closed with no remaining balance and a total thats not zero  
which will generally be you paid tickets.

 ![](https://forum.sambapos.com/uploads/default/original/3X/b/1/b110f2a23dbfab4c845e8cddd9d710f705b11f72.png) 

Next you’ll want a Button (Automation Command)

 ![](https://forum.sambapos.com/uploads/default/original/3X/d/b/db4cda2c628cb7bb4f4a8ba9df3cab93e51b4c4b.png) 

As a print bill action will automaticly print the current ticket if if a ticket is open.  
Easiest way to avoid this button printing current bill is to make it only visible when there is no open ticket using Status=

 ![](https://forum.sambapos.com/uploads/default/original/3X/d/d/ddb13e8a3b88bebb4c5ab5e1ea6155caa696977a.png) 

You’ll need an action to print a specific ticket. Note the `[:Ticket ID]` this will carry the field to the action instance in the rule.

 ![](https://forum.sambapos.com/uploads/default/original/3X/c/7/c7bd1cbfd7aae400e7d31248fbf4def49c550760.png) 

Lastly you’ll need the rule to power the automation command.  
The `{SETTING:LASTBILL_{:CURRENTTERMINAL}}` will call the saved ticket ID from the program setting for the current terminal.

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/5/450ab273007c095150fa7fb70eccce79776fe781.png)

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [June 27, 2015, 12:30am UTC](https://forum.sambapos.com/t/tutorial-basic-print-last-bill-receipt-button-jtrtech/5588/2 "2015-06-27T00:30:18Z")

</div>

**PLEASE NOTE THERE WAS A SPELLING MISTAKE IN ORIGINAL POST**  
{:CURENTTERMINAL} was used, this should be {:CURRENTTERMINAL} - **TWO R’s**  
Have corrected the text but the screen shots still show incorrect spelling.
