Ticket template codings

I didn’t post up the adjusted template. The one above was showing how it would produce in a browser, not the template. I made some changes for the last one. I just overwrote it. Let me see if I can put it back together easily.

Thank you very much. It’ll be really helpful for me. Appreciate it🙌🏻

The one with circles was html outside samba, didnt work in samba, preview with squares was in samba.

update decided to change our own ticket format to this style. Its much easier for customers to read. Might reduce the padding, but overall its better.

In setting this up, I noticed that bottom-border also doesn’t work. Had to use underscore for the single lines.

image

[LAYOUT]
<div style="padding: 5px; text-align: Center; background-color: #000000 black; color: #ffffff; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">113 E Holly St<Br/>Bellingham, WA 98226<Br />(360) 933-4301</div>
<div style="padding: 5px; text-align: Center; background-color: #ffffff black; color: #000000; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Order Online @ Horseshoecafe.com</div>

<div style="width: 100%; height: 10px;"> </div>

<table>
<tr>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px; font-size:10px;padding:5px;">{DATE:yyyy}</div>
<div style="height: 20px; font-size:14px;padding:2px;">{TIME}</div>
<div style="height: 10px; font-size:10px;padding:5px;">{DATE:MMM} {DATE:dd}</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Table</div>
<div style="height: 20px;font-size:14px;padding:2px;">{ENTITY NAME:Table}</div>
<div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Ticket</div>
<div style="height: 20px;font-size:14px;padding:2px;">{TICKET NO}</div>
<div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Server</div>
<div style="height: 20px;font-size:14px;padding:2px;">{USER NAME}</div>
<div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</td>
</tr>
</table>

<div style="width: 100%; height: 10px;"> </div>
<div style="padding: 5px; text-Align: center; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Welcome, [='{ENTITY NAME:Customer}'==''?'Guest':'{ENTITY NAME:Customer}']</div>
<div style="width: 100%; height: 10px;"> </div>

{ORDERS}
 
{DISCOUNTS}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
{SERVICES}
<table><tr>
<td width="275" align="center">&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</td>
</tr></table>

<table>
<tr>
<td width="225"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Tax:</span></td>
<td width="75"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TAX TOTAL}</span></td>
</tr>
</table>
{PAYMENTS}

<div style="width: 100%; height: 10px;"> </div>
<div style="padding: 5px; text-Align: center; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Thank you for Visiting the 'Shoe<br /> We'll see you next time<Br />Horseshoe Cafe Est. 1886</div>
<div style="width: 100%; height: 10px;"> </div>

<div style="padding: 5px; text-Align: left; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">
<table>
<tr><td align=center><span style="text-align:center; font-family:'Helvetica'; font-size:14px;">*Voluntary* Health Contact Info<Br /></span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Name: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Phone: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">E-mail: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;<Br /></span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:10px;">If we learn you may have been exposed to COVID-19 during your visit, we will only share this information with public health officials. We will not use your info for any other purpose.</span></td></tr>
</table>
</div>

[DISCOUNTS]
<J30>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[SERVICES]
-- <J10>{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]
<table>
<tr>
<td width="225"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{PAYMENT NAME}</span></td>
<td width="75"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{PAYMENT AMOUNT}</span></td>
</tr>
</table>

[ORDERS]
<table>
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">- {QUANTITY}</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{NAME}</span></td>
<td width="30"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TOTAL PRICE}</span></td>
</tr>
{ORDER TAGS}
</table>

[ORDERS:Gift]
-- Format for gifted orders
<table>
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">- {QUANTITY}</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">**COMP** {NAME}</span></td>
<td width="30"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TOTAL PRICE}</span></td>
</tr>
{ORDER TAGS}
</table>

[ORDER TAGS]
-- Format for order tags
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">     {ORDER TAG QUANTITY}</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">* {ORDER TAG NAME} </span></td>
<td width="30"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">[=F(TN('{ORDER TAG PRICE}')*TN('{ORDER TAG QUANTITY}')*TN('{QUANTITY}'),'#.00')]</span></td>
</tr>

Document printer will give you greater control. I have been meaning to learn how to build a nice template with it but I do not have the time.

FYI, I did try Document Printer with throwing a bunch of commands on a print template. All I did was change my printer to Document Printer and it printed perfectly. So… you could have circles, but I think the boxes are just as good. Here is a pic, HTML printer on the left and Document Printer on the right.

Document Printer Object Info:

Center Text in a WPF XAML Shape: https://weblogs.asp.net/psheriff/centering-text-on-a-wpf-shape
WPF Shapes and Basic Drawing: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/shapes-and-basic-drawing-in-wpf-overview?view=netframeworkdesktop-4.8
XAML Syntax: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/xaml-syntax-in-detail?view=netframeworkdesktop-4.8

2 Likes

Great Work!! :clap: :clap: :clap: This is awesome. Thank you once again!

Hi, I couldn’t insert the logo and icons. Can advise on this?

You can insert images into single lines by using <BMP>Image location

For inline icons I think <img src="location"> should work or you can use text/symbols. Start by getting your logo to print at the top and go from there.

My logo is loaded into the printer memory for increases the speed of the print. Logos really depend on how you set it up.

Yup I tried this bmp method but it’s only supporting for esc/pos printer type. I’m using html type.

Can you share your printer template? I’m pretty sure <BMP> works with HTML Printing as long as its on its own line.

[LAYOUT]

113 E Holly St
Bellingham, WA 98226
(360) 933-4301
Order Online @ Horseshoecafe.com
‪C:\Users\Shalini\Pictures\Classic 12.bmp
{DATE:yyyy}
{TIME}
{DATE:MMM} {DATE:dd}
Table
{ENTITY NAME:Table}
*icon*
Ticket
{TICKET NO}
*icon*
Server
{USER NAME}
*icon*
Welcome, [='{ENTITY NAME:Customer}'==''?'Guest':'{ENTITY NAME:Customer}']

{ORDERS}

{DISCOUNTS}
[Total Gift:|{ORDER STATE TOTAL:Gift}]
{SERVICES}

___________________________________________
Tax: {TAX TOTAL}
{PAYMENTS}
Thank you for Visiting the 'Shoe
We'll see you next time
Horseshoe Cafe Est. 1886
*Voluntary* Health Contact Info
Name: ___________________________________
Phone: ___________________________________
E-mail: ___________________________________
If we learn you may have been exposed to COVID-19 during your visit, we will only share this information with public health officials. We will not use your info for any other purpose.

[DISCOUNTS]
{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[SERVICES]
– {CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]

{PAYMENT NAME} {PAYMENT AMOUNT}

[ORDERS]

{ORDER TAGS}
- {QUANTITY} {NAME} {TOTAL PRICE}

[ORDERS:Gift]
– Format for gifted orders

{ORDER TAGS}
- {QUANTITY} **COMP** {NAME} {TOTAL PRICE}

[ORDER TAGS]
– Format for order tags

{ORDER TAG QUANTITY} * {ORDER TAG NAME} [=F(TN('{ORDER TAG PRICE}')*TN('{ORDER TAG QUANTITY}')*TN('{QUANTITY}'),'#.00')]

Can you put ``` at the beginning and end of your template so it shows your printer template formatted.

BTW HTML img tag works fine within the formatted sections. You just have to get your icons to the size you want. See below:

image

<div style="padding: 5px; text-align: Center; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;"><img src="C:\Users\josep\Documents\bg.png"></div>
<div style="width: 100%; height: 10px;"></div>
<div style="padding: 5px; text-align: Center; background-color: #000000 black; color: #ffffff; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">113 E Holly St<Br/>Bellingham, WA 98226<Br />(360) 933-4301</div>
<div style="padding: 5px; text-align: Center; background-color: #ffffff black; color: #000000; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Order Online @ Horseshoecafe.com</div>

<div style="width: 100%; height: 10px;"> </div>

<table>
<tr>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px; font-size:10px;padding:5px;">{DATE:yyyy}</div>
<div style="height: 20px; font-size:14px;padding:2px;">{TIME}</div>
<div style="height: 10px; font-size:10px;padding:5px;">{DATE:MMM} {DATE:dd}</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Table</div>
<div style="height: 20px;font-size:14px;padding:2px;">{ENTITY NAME:Table}</div>
<div style="height: 10px;font-size:10px;padding:5px;"><img src="C:\Users\josep\Documents\bg.png"></div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Ticket</div>
<div style="height: 20px;font-size:14px;padding:2px;">{TICKET NO}</div>
<div style="height: 10px;font-size:10px;padding:5px;"><img src="C:\Users\josep\Documents\bg.png"></div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Server</div>
<div style="height: 20px;font-size:14px;padding:2px;">{USER NAME}</div>
<div style="height: 10px;font-size:10px;padding:5px;"><img src="C:\Users\josep\Documents\bg.png"></div>
</td>
</tr>
</table>

<BMP> did work but it was showing the path of the image as well. Not sure why.

1 Like

You really smashed that template, great work! I just might use it as some point. :slight_smile:

Hah thanks. I’m using it as well now too. Funny how things work out. I’m not using any icons and the boxes are slightly smaller. I do like how information on the ticket is presented horizontally versus vertical. I’ll post up my final template as well.

Final Version … for now

image

[LAYOUT]
-- Address and Website
<div style="padding: 5px; text-align: Center; background-color: #000000 black; color: #ffffff; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">113 E Holly St<Br/>Bellingham, WA 98226<Br />(360) 933-4301</div>
<div style="padding: 5px; text-align: Center; background-color: #ffffff black; color: #000000; border: 1px black solid; width: 225px; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Order Online @ Horseshoecafe.com</div>

-- Spacer
<div style="width: 100%; height: 5px;"> </div>

-- Header Info Layout
<table>
<tr>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px; font-size:10px;padding:5px;">{DATE:MMM} {DATE:dd}</div>
<div style="height: 20px; font-size:14px;padding:2px;">{TIME}</div>
-- <div style="height: 10px; font-size:10px;padding:5px;">{DATE:yyyy}</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Table</div>
<div style="height: 20px;font-size:14px;padding:2px;">{ENTITY NAME:Table}</div>
-- <div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Ticket</div>
<div style="height: 20px;font-size:14px;padding:2px;">{TICKET NO}</div>
-- <div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</div>
</td>
<td>
<div style="text-align:center; border: 1px black solid; font-family:'Helvetica';">
<div style="height: 10px;font-size:10px;padding:5px;">Server</div>
<div style="height: 20px;font-size:14px;padding:2px;">{ENTITY NAME:Server}</div>
-- <div style="height: 10px;font-size:10px;padding:5px;">*icon*</div>
</td>
</tr>
</table>

-- <div style="width: 100%; height: 10px;"> </div>
-- <div style="padding: 5px; text-Align: center; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Welcome, [='{ENTITY NAME:Customer}'==''?'Guest':'{ENTITY NAME:Customer}']</div>

-- Spacer
<div style="width: 100%; height: 10px;"> </div>

{ORDERS}
<div style="width: 100%; height: 10px;"> </div>
<div style="padding: 0px; text-Align: center; font-family:'Helvetica'; font-size:12px; font-weight:bold;line-height: 1.6em;">{TICKET QUANTITY SUM}x Items Sold</div>
 
{DISCOUNTS}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
{SERVICES}
-- <table><tr>
-- <td width="275" align="center">&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</td>
-- </tr></table>

<J00>-------------------------------------------
<div style="font-size:14px;font-weight:bold;text-align:justify;font-family:'Helvetica'">
<table>
<tr>
<td width="200" align="left">Sub Total:</td>
<td width="55" align="right">[=F(TN('{PLAIN TOTAL}'),'0.00')]</td>
</tr>
</table>
</div>
<J00>-------------------------------------------

<table>
<tr>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Tax:</span></td>
<td width="55" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TAX TOTAL}</span></td>
</tr>
</table>
{PAYMENTS}

<div style="width: 100%; height: 10px;"> </div>
<div style=" background-color: #000000 black; color: #ffffff; padding: 5px; text-Align: center; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">Thank you for Visiting the 'Shoe<br /> We'll see you next time<Br />Horseshoe Cafe Est. 1886</div>
<div style="width: 100%; height: 10px;"> </div>

<div style="padding: 5px; text-Align: left; border: 1px black solid; font-family:'Helvetica'; font-size:12px; font-weight:normal;line-height: 1.6em;">
<table>
<tr><td align=center><span style="text-align:center; font-family:'Helvetica'; font-size:14px;">*Voluntary* Health Contact Info<Br /></span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Name: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">Phone: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">E-mail: &#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;<Br /></span></td></tr>
<tr><td><span style="text-align:left; font-family:'Helvetica'; font-size:10px;">If we learn you may have been exposed to COVID-19 during your visit, we will only share this information with public health officials. We will not use your info for any other purpose.</span></td></tr>
</table>
</div>

[DISCOUNTS]
<table>
<tr>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{CALCULATION NAME} %{CALCULATION AMOUNT}</span></td>
<td width="55" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{CALCULATION TOTAL}</span></td>
</tr>
</table>

[SERVICES]
-- <J10>{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]
<table>
<tr>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{PAYMENT NAME}</span></td>
<td width="55" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{PAYMENT AMOUNT}</span></td>
</tr>
</table>

[ORDERS]
<table>
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">- {QUANTITY}</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">{NAME}</span></td>
<td width="30" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TOTAL PRICE}</span></td>
</tr>
{ORDER TAGS}
</table>

[ORDERS:Gift]
-- Format for gifted orders
<table>
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">- {QUANTITY}</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:14px;">**COMP** {NAME}</span></td>
<td width="30" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:14px;">{TOTAL PRICE}</span></td>
</tr>
{ORDER TAGS}
</table>

[ORDER TAGS]
-- Format for order tags
<tr>
<td width="25"><span style="text-align:left; font-family:'Helvetica'; font-size:12px;">***</span></td>
<td width="200"><span style="text-align:left; font-family:'Helvetica'; font-size:9px;">{ORDER TAG NAME} </span></td>
<td width="30" align="right"><span style="text-align:right; font-family:'Helvetica'; font-size:9px;">[=F(TN('{ORDER TAG PRICE}')*TN('{ORDER TAG QUANTITY}')*TN('{QUANTITY}'),'#.00')]</span></td>
</tr>
1 Like

Thank you so much! Manage to add icons and logo☺️

4 Likes

Hi sir. If I change the printer type to html , the receipt is printing but the cash drawer isn’t opening. But once I put back a basic receipt format and change the printer type to esc, the cash drawer is opening. Do we have any ways to settle this?

Create another printer in sambapos for esc/pos and a new print job and template for that. The drawer pop command requires esc/pos mode.

Thank you!! Will try it