HTML A4 Print Receipt | Breaks when {ORDER TAGS} is implemented

Hi,

I am having a issue where I have a bespoke item which requires order tags to show in my HTML A4 print template but when I add the order tags function and {ORDER TAGS} code it deletes the majority of the HTML code.

My setup is:
Printer Type: HTML
Printer used: Generic A4 Brother printer

This is the current code that works without order tags (Image of the output below.)

[LAYOUT]
<HTML>

<Body style="margin:10px; padding:20px; max-height:100%; max-width:100%; ">
-- Logo/Title

<table style="font-size:11px; font-family: Calibri (body); width:;">
    <tr>
        <td>
        <b>
            <br />
            Company Name
            Address Line 1,
            Address Line 2,
            Post Code,
            </b>
            <br />
            <b>Telephone: </b> 00000 000000
            <b>Web: </b> www.website.co.uk
            <b>Email: </b> noreply@website.co.uk
            <b>Company Reg: </b> 000000
            <b>VAT Number: </b> GB000000
            <br />
           
            <b>BACS Details</b>
            Company Name
            Sort Code: 00-00-00
            Account: 00000000
        </td>
        <td>  
            <br /> 
        </td>
        <td align=center> 
           
            
            <h1><b>INVOICE</b></h1>
            Invoice Number: {TICKET NO}
            Date: {TICKET DATE}
        </td>
    </tr>
</table>

-- Invoice & Delivery Address

<table style="font-size:11px; font-family: Calibri (body); margin-top:20px;">
    <tr>
        <td>
        <div style="border:1px solid black; padding:25px; margin-right: 10px;">
            <b>Invoice To: </b>
                {ENTITY NAME:Customer}
                {ENTITY DATA:Customer:Phone}  {ENTITY DATA:Customer:Email}
                <br />
                {ENTITY DATA:Customer:Address_Line_1} 
                {ENTITY DATA:Customer:City}
                {ENTITY DATA:Customer:Postcode} 
        </div>                
        </td>
        <td>
        
        </td>
        <td> 
        <div style="border:1px solid black; padding:25px; margin-left: 10px; ">
            <b>Deliver To: </b>
                {ENTITY NAME:Customers Delivery} 
                {ENTITY DATA:Customers Delivery:Phone Number} {ENTITY DATA:Customers Delivery:Email} 
                <br />
                {ENTITY DATA:Customers Delivery:Address line 1}  
                {ENTITY DATA:Customers Delivery:Town}    
                {ENTITY DATA:Customers Delivery:PostCode}
        </div>                
        </td>
</table>

<div style="border:1px solid black; padding:25px; margin-top: 20px;">
-- Item Sold Table
<table style="font-size:11px; font-family: Calibri (body);">
    <tr>
        <td width=60>
            <b>QTY</b>
        </td>
        <td width=300>
               <b>Description</b>
        </td>
        <td align=right width=auto>
          <b>Unit Cost </b>
        </td>
        <td align=right width=auto>
            <b>Total </b>
        </td>
 </tr>

</table>
{ORDERS}
</div>



-- SubTotal & Total
<table style="font-size:11px; font-family: Calibri (body); margin-top:20px;">
    <tr>
        <td width=350>
        <div style="border:1px solid black; padding:25px; height: 46px;">
            <b>Notes: </b> {NOTE}
            <br />
            <b>Served by:</b> {USER NAME}
        </div>
        </td>
        <td width=auto>
               <br />
        </td>
        <td width=350>
        <div style="border:1px solid black; padding:25px;">
            <table>
                <tr>
                        <td align=left ><b>Net Cost:</b></td>
                    <td align=right > £[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL:Delivery Charge}'))-TN('{CALCULATION TOTAL:Discount}')-TN('{TAX TOTAL}'))] </td>
                </tr>
                <tr>
                    <td align=left ><b>Discount:</b></td>
                    <td align=right >£{CALCULATION TOTAL:Discount}</td>
                </tr>
                <tr>
                    <td align=left ><b>Discounted Net Cost:</b></td>
                    <td align=right >[£[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL:Delivery Charge}')-TN('{TAX TOTAL}'))/TN('{EXCHANGE RATE:curr}'))]]</td>
                </tr>
                <tr>
                    <td align=left ><b>Delivery Cost:</b></td>
                    <td align=right >[£{CALCULATION TOTAL:Delivery Charge}]</td>
                </tr>
                <tr>
                    <td>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td align=left ><b>VAT:</b></td>
                    <td align=right >£{TAX TOTAL}</td>
                </tr>
                <tr>
                    <td align=left ><b>Total Cost</b>:</td>
                    <td align=right >£{TICKET TOTAL}</td>
                </tr>
            </table>
        </div>
        </td>
 </tr>
</table>



</Body>









[ORDERS]
-- Default format for orders
<table style="font-size:11px;">
    <tr>
        <td width=60>{QUANTITY}</td>
        <td width=300>{NAME}</td>
        <td align=right width=auto> £[=F((TN('{PRICE}')-TN('{ENTITY DATA:CUSTOMERS:"Discount Value","Value":"5%"}')-TN('{ENTITY DATA:CUSTOMERS:"Discount Value","Value":"15%"}'))/TN('{EXCHANGE RATE:curr}'))]</b></td>        
        <td align=right width=auto>{VISIBLE TOTAL}</td>
    </tr>
</table>




[DISCOUNTS]
<J00>{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}: | {TENDERED}

[ORDERS:Gift]
-- Format for gifted orders
<J00>{QUANTITY} {NAME}|**FREE**


[ORDERS:Void]
-- Nothing will print for void lines


[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[TAXES]
<J00>Tax Total:|{TAX TOTAL}


</HTML>

This is the code I updated it to where order tags breaks it. (Image below of how it looks when order tags added)

[LAYOUT]
<HTML>

<Body style="margin:10px; padding:20px; max-height:100%; max-width:100%; ">
-- Logo/Title

<table style="font-size:11px; font-family: Calibri (body); width:;">
    <tr>
        <td>
        <b>
            <br />
            Company Name
            Address Line 1,
            Address Line 2,
            Post Code,
            </b>
            <br />
            <b>Telephone: </b> 00000 000000
            <b>Web: </b> www.website.co.uk
            <b>Email: </b> noreply@website.co.uk
            <b>Company Reg: </b> 000000
            <b>VAT Number: </b> GB000000
            <br />
           
            <b>BACS Details</b>
            Company Name
            Sort Code: 00-00-00
            Account: 00000000
        </td>
        <td>  
            <br /> 
        </td>
        <td align=center> 
           
            
            <h1><b>INVOICE</b></h1>
            Invoice Number: {TICKET NO}
            Date: {TICKET DATE}
        </td>
    </tr>
</table>

-- Invoice & Delivery Address

<table style="font-size:11px; font-family: Calibri (body); margin-top:20px;">
    <tr>
        <td>
        <div style="border:1px solid black; padding:25px; margin-right: 10px;">
            <b>Invoice To: </b>
                {ENTITY NAME:Customer}
                {ENTITY DATA:Customer:Phone}  {ENTITY DATA:Customer:Email}
                <br />
                {ENTITY DATA:Customer:Address_Line_1} 
                {ENTITY DATA:Customer:City}
                {ENTITY DATA:Customer:Postcode} 
        </div>                
        </td>
        <td>
        
        </td>
        <td> 
        <div style="border:1px solid black; padding:25px; margin-left: 10px; ">
            <b>Deliver To: </b>
                {ENTITY NAME:Customers Delivery} 
                {ENTITY DATA:Customers Delivery:Phone Number} {ENTITY DATA:Customers Delivery:Email} 
                <br />
                {ENTITY DATA:Customers Delivery:Address line 1}  
                {ENTITY DATA:Customers Delivery:Town}    
                {ENTITY DATA:Customers Delivery:PostCode}
        </div>                
        </td>
</table>

<div style="border:1px solid black; padding:25px; margin-top: 20px;">
-- Item Sold Table
<table style="font-size:11px; font-family: Calibri (body);">
    <tr>
        <td width=60>
            <b>QTY</b>
        </td>
        <td width=300>
               <b>Description</b>
        </td>
        <td align=right width=auto>
          <b>Unit Cost </b>
        </td>
        <td align=right width=auto>
            <b>Total </b>
        </td>
 </tr>

</table>
{ORDERS}
</div>



-- SubTotal & Total
<table style="font-size:11px; font-family: Calibri (body); margin-top:20px;">
    <tr>
        <td width=350>
        <div style="border:1px solid black; padding:25px; height: 46px;">
            <b>Notes: </b> {NOTE}
            <br />
            <b>Served by:</b> {USER NAME}
        </div>
        </td>
        <td width=auto>
               <br />
        </td>
        <td width=350>
        <div style="border:1px solid black; padding:25px;">
            <table>
                <tr>
                        <td align=left ><b>Net Cost:</b></td>
                    <td align=right > £[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL:Delivery Charge}'))-TN('{CALCULATION TOTAL:Discount}')-TN('{TAX TOTAL}'))] </td>
                </tr>
                <tr>
                    <td align=left ><b>Discount:</b></td>
                    <td align=right >£{CALCULATION TOTAL:Discount}</td>
                </tr>
                <tr>
                    <td align=left ><b>Discounted Net Cost:</b></td>
                    <td align=right >[£[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL:Delivery Charge}')-TN('{TAX TOTAL}'))/TN('{EXCHANGE RATE:curr}'))]]</td>
                </tr>
                <tr>
                    <td align=left ><b>Delivery Cost:</b></td>
                    <td align=right >[£{CALCULATION TOTAL:Delivery Charge}]</td>
                </tr>
                <tr>
                    <td>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td align=left ><b>VAT:</b></td>
                    <td align=right >£{TAX TOTAL}</td>
                </tr>
                <tr>
                    <td align=left ><b>Total Cost</b>:</td>
                    <td align=right >£{TICKET TOTAL}</td>
                </tr>
            </table>
        </div>
        </td>
 </tr>
</table>



</Body>









[ORDERS]
-- Default format for orders
<table style="font-size:11px;">
    <tr>
        <td width=60>{QUANTITY}</td>
        <td width=300>{NAME}</td>
        <td align=right width=auto> £[=F((TN('{PRICE}')-TN('{ENTITY DATA:CUSTOMERS:"Discount Value","Value":"5%"}')-TN('{ENTITY DATA:CUSTOMERS:"Discount Value","Value":"15%"}'))/TN('{EXCHANGE RATE:curr}'))]</b></td>        
        <td align=right width=auto>{VISIBLE TOTAL}</td>
        {ORDER TAGS}
    </tr>
</table>




[DISCOUNTS]
<J00>{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}: | {TENDERED}

[ORDERS:Gift]
-- Format for gifted orders
<J00>{QUANTITY} {NAME}|**FREE**


[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00>  {ORDER TAG QUANTITY} {ORDER TAG NAME}| {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[TAXES]
<J00>Tax Total:|{TAX TOTAL}


</HTML>

try this

[LAYOUT]
<HTML>

<Body style="margin:10px; padding:20px; max-height:100%; max-width:100%; ">
-- Logo/Title

<table style="font-size:11px; font-family: Calibri (body); width:;">
    <tr>
        <td>
        <b>
            <br />
            Company Name
            Address Line 1,
            Address Line 2,
            Post Code,
            </b>
            <br />
            <b>Telephone: </b> 00000 000000
            <b>Web: </b> www.website.co.uk
            <b>Email: </b> noreply@website.co.uk
            <b>Company Reg: </b> 000000
            <b>VAT Number: </b> GB000000
            <br />
           
            <b>BACS Details</b>
            Company Name
            Sort Code: 00-00-00
            Account: 00000000
        </td>
        <td>  
            <br /> 
        </td>
        <td align=center> 
           
            
            <h1><b>INVOICE</b></h1>
            Invoice Number: {TICKET NO}
            Date: {TICKET DATE}
        </td>
    </tr>
</table>

-- Invoice & Delivery Address

<table style="font-size:11px; font-family: Calibri (body); margin-top:20px;">
    <tr>
        <td>
        <div style="border:1px solid black; padding:25px; margin-right: 10px;">
            <b>Invoice To: </b>
                {ENTITY NAME:Customer}
                {ENTITY DATA:Customer:Phone}  {ENTITY DATA:Customer:Email}
                <br />
                {ENTITY DATA:Customer:Address_Line_1} 
                {ENTITY DATA:Customer:City}
                {ENTITY DATA:Customer:Postcode} 
        </div>                
        </td>
        <td>
        
        </td>
        <td> 
        <div style="border:1px solid black; padding:25px; margin-left: 10px; ">
            <b>Deliver To: </b>
                {ENTITY NAME:Customers Delivery} 
                {ENTITY DATA:Customers Delivery:Phone Number} {ENTITY DATA:Customers Delivery:Email} 
                <br />
                {ENTITY DATA:Customers Delivery:Address line 1}  
                {ENTITY DATA:Customers Delivery:Town}    
                {ENTITY DATA:Customers Delivery:PostCode}
        </div>                
        </td>
</table>

<div style="border:1px solid black; padding:25px; margin-top: 20px;">
-- Item Sold Table
<table style="font-size:11px; font-family: Calibri (body);">
    <tr>
        <td width=60>
            <b>QTY</b>
        </td>
        <td width=300>
               <b>Description</b>
        </td>
        <td align=right width=auto>
          <b>Unit Cost </b>
        </td>
        <td align=right width=auto>
            <b>Total </b>
        </td>
 </tr>

</table>
{ORDERS}
</div>



-- SubTotal & Total
<table style="font-size:11px; font-family: Calibri (body); margin-top:20px;">
    <tr>
        <td width=350>
        <div style="border:1px solid black; padding:25px; height: 46px;">
            <b>Notes: </b> {NOTE}
            <br />
            <b>Served by:</b> {USER NAME}
        </div>
        </td>
        <td width=auto>
               <br />
        </td>
        <td width=350>
        <div style="border:1px solid black; padding:25px;">
            <table>
                <tr>
                        <td align=left ><b>Net Cost:</b></td>
                    <td align=right > £[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL:Delivery Charge}'))-TN('{CALCULATION TOTAL:Discount}')-TN('{TAX TOTAL}'))] </td>
                </tr>
                <tr>
                    [<td align=left ><b>Discount:</b></td>
                    <td align=right >£{CALCULATION TOTAL:Discount}</td>]
                </tr>
                <tr>
                    [<td align=left ><b>Discounted Net Cost:</b></td>
                    <td align=right >£[=F((TN('{TICKET TOTAL}')-TN('{CALCULATION TOTAL:Delivery Charge}')-TN('{TAX TOTAL}'))/TN('{EXCHANGE RATE:curr}'))]</td>]
                </tr>
                <tr>
                    [<td align=left ><b>Delivery Cost:</b></td>
                    <td align=right >£{CALCULATION TOTAL:Delivery Charge}</td>]
                </tr>
                <tr>
                    <td>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td align=left ><b>VAT:</b></td>
                    <td align=right >£{TAX TOTAL}</td>
                </tr>
                <tr>
                    <td align=left ><b>Total Cost</b>:</td>
                    <td align=right >£{TICKET TOTAL}</td>
                </tr>
            </table>
        </div>
        </td>
 </tr>
</table>



</Body>









[ORDERS]
-- Default format for orders
<table style="font-size:11px;">
    <tr>
        <td width=60>{QUANTITY}</td>
        <td width=300>{NAME}</td>
        <td align=right width=auto> £[=F((TN('{PRICE}')-TN('{ENTITY DATA:CUSTOMERS:"Discount Value","Value":"5%"}')-TN('{ENTITY DATA:CUSTOMERS:"Discount Value","Value":"15%"}'))/TN('{EXCHANGE RATE:curr}'))]</b></td>        
        <td align=right width=auto>{VISIBLE TOTAL}</td>
    </tr>
</table>
{SORTED ORDER TAGS}

[SORTED ORDER TAGS]
-- Format for order tags
<table style="font-size:10px; font-family: Calibri (body);">
    <tr>
        <td width=60>
            <b></b>
        </td>
        <td width=300>
               <b>-{ORDER TAG NAME}</b>
        </td>
        [<td align=right width=auto>
          <b>£{ORDER TAG PRICE}</b>]
        </td>
        [<td align=right width=auto>
            <b>£{ORDER TAG TOTAL}</b>]
        </td>
 </tr>

[DISCOUNTS]
<J00>{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}: | {TENDERED}

[ORDERS:Gift]
-- Format for gifted orders
<J00>{QUANTITY} {NAME}|**FREE**


[ORDERS:Void]
-- Nothing will print for void lines


[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[TAXES]
<J00>Tax Total:|{TAX TOTAL}


</HTML>
1 Like

That is amazing. Fixed the problem.

Appreciate your help :blush:

1 Like