# Print Last Paid Ticket

**URL:** <https://forum.sambapos.com/t/print-last-paid-ticket/24825>\
**Category:** V5 Question\
**Created:** [September 27, 2021, 8:26am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825 "2021-09-27T08:26:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 8:26am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/1 "2021-09-27T08:26:13Z")

</div>

I have followed some Tutorials (V5 and V4 Sambapos) to create a button on sale screen to print lastTicket. Ticket is Paid, Printed and closed normally.

I need to Print Last Ticket on Sale Screen. Someone knows a step by step Tutorial to Print Last Ticket from Sale Screen?

For exemple following link. I can always NOT print my last Ticket.

[Print Last Receipt via Automation Command - #8 by QMcKay](https://forum.sambapos.com/t/print-last-receipt-via-automation-command/2866/8)?

---

<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:** [September 27, 2021, 8:51am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/2 "2021-09-27T08:51:13Z")

</div>

Mostlikely you make a mistake somewhere but here is one I wrote.

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 10:00am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/3 "2021-09-27T10:00:42Z")

</div>

Maybe 2 Reasons:

1- I dont see what you have under :Message Test Action (it is not visible)  
2- Under Entity Customer: I have created a new Field : LastTicketId (number string)  
i have realised that is not saved.

It must be same name in Entity Customer and under AC-StoreLastTicket as shown in your Tutorial?

![bbba4ba89bfdd80e](https://forum.sambapos.com/uploads/default/original/3X/0/0/00d1aa1fae68bca489934c407814d8909b788ad4.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:** [September 27, 2021, 10:03am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/4 "2021-09-27T10:03:39Z")

</div>

> [@Tutorial: Basic Print Last Bill/Receipt Button (JTRTech)](https://forum.sambapos.com/t/tutorial-basic-print-last-bill-receipt-button-jtrtech/5588):
>
> 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…

---

<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:** [September 27, 2021, 10:04am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/5 "2021-09-27T10:04:16Z")

</div>

Forgot to paste the link.

Message would just be for testing and not needed.

What do you mean about customer entity?

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 10:09am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/6 "2021-09-27T10:09:15Z")

</div>

i have thought that i need a field to Store last Ticket ID. I saw it in a Tutorrial. Not true?

---

<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:** [September 27, 2021, 10:30am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/7 "2021-09-27T10:30:32Z")

</div>

Are you wanting to print that customers last bill or just last bill paid?

If you want to log last ticket from that customer than yes, but you would need to have selected that customer before printing else it wouldn’t know which customer it refferws to.

If general last bill paid you need to use something like a global program setting field so its always available.

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 10:31am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/8 "2021-09-27T10:31:48Z")

</div>

Need to print only last paid Ticket. (with customer or without customer)

Target is: Print ticket only if the customer want to get it, otherweise no need to print. Need to save some paper…

---

<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:** [September 27, 2021, 10:32am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/9 "2021-09-27T10:32:43Z")

</div>

So no, not entity field.

---

<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:** [September 27, 2021, 10:34am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/10 "2021-09-27T10:34:09Z")

</div>

See my tutorial. Pretty simple to do.

---

<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:** [September 27, 2021, 10:38am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/11 "2021-09-27T10:38:05Z")

</div>

The tutorial you linked to doesn’t use entity field so not sure where you got that from…

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 11:04am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/12 "2021-09-27T11:04:10Z")

</div>

In your Tutorial, i see some different fields under:  
Rules, select Actions: **Update Programme Setting.**

possible to use another action for this ?

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

> [@Tutorial: Basic Print Last Bill/Receipt Button (JTRTech)](https://forum.sambapos.com/t/tutorial-basic-print-last-bill-receipt-button-jtrtech/5588):
>
> 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…

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 11:38am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/13 "2021-09-27T11:38:59Z")

</div>

I followed this tutorial too, really no success. I reapeated Process several times.  
I really dont know what s wrong with my steps .

> [@Print Last Receipt via Automation Command](https://forum.sambapos.com/t/print-last-receipt-via-automation-command/2866/8):
>
> @sukasem Gave you the steps… Using Update Program Setting Action to store last ticket id. [image] Inject action create above to your Print Bill rule (where you choose to Inject this is up to you…) [image] Create Automation command button Create Load Ticket action [image] Create Rule for automation command button. [image] [image]

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [September 27, 2021, 11:39am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/14 "2021-09-27T11:39:49Z")

</div>

Show your steps you did.

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 11:42am UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/15 "2021-09-27T11:42:29Z")

</div>

i make exactly the same as described in this link. I make sscreenshots in a while and send you

> [@Print Last Receipt via Automation Command](https://forum.sambapos.com/t/print-last-receipt-via-automation-command/2866/8):
>
> @sukasem Gave you the steps… Using Update Program Setting Action to store last ticket id. [image] Inject action create above to your Print Bill rule (where you choose to Inject this is up to you…) [image] Create Automation command button Create Load Ticket action [image] Create Rule for automation command button. [image] [image]

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 12:11pm UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/16 "2021-09-27T12:11:09Z")

</div>

Following steps are done:  
1- Action to store Last Ticket ID using Update Programme Setting  
2- This action added into Print Bill Rule with Mappings  
3- Automation Command Button is created  
4- Load Ticket Action is created.  
5- Rule is Created for Automation Command.

I make same with V5 and 4, to see the problem.

[last print.pdf](https://forum.sambapos.com/uploads/short-url/zPxsFBriMhVqbVkJ4rPGlvA2jjr.pdf) (208.7 KB)

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 1:46pm UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/17 "2021-09-27T13:46:04Z")

</div>

@Jesse I sent you all steps in a pdf file.

---

<div class="post-metadata">

**Author:** ![Adam1](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/a/7ba0ec/32.png) [@Adam1](https://forum.sambapos.com/u/Adam1)\
**Post date:** [September 27, 2021, 3:48pm UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/18 "2021-09-27T15:48:06Z")

</div>

@Sonnmatt Showing your steps of what you did will give you better feedback and help others in the community if they have the same problem.

---

<div class="post-metadata">

**Author:** ![Sonnmatt](https://forum.sambapos.com/user_avatar/forum.sambapos.com/sonnmatt/32/37986_2.png) [@Sonnmatt](https://forum.sambapos.com/u/Sonnmatt)\
**Post date:** [September 27, 2021, 3:53pm UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/19 "2021-09-27T15:53:52Z")

</div>

@Adam1 all what i did to print last Ticket, are in pdf file. It is visible on it. But Problem is not resolved,i cannot print my last paid and closed Ticket. Any Proposition?

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [September 27, 2021, 3:58pm UTC](https://forum.sambapos.com/t/print-last-paid-ticket/24825/20 "2021-09-27T15:58:51Z")

</div>

Try changing the setting name to: ~~`{LOCAL SETTING:LastTicketId}`~~.  
**Edit**  
Opps. sorry forgot the local setting option is set to False, meaning it is global setting. Change the setting to `{GLOBAL SETTING:LastTicketId}`

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

[Next page](https://forum.sambapos.com/t/print-last-paid-ticket/24825.md?page=2)
