Html printing , spcae utilizing

Using this code to print html kitchen dockets , there is a empty border if no notes or, entities available , can this space removed if nothing there i mean disappear the box and only show /print something in it ? its the last row contains pickup time, entites and notes all in one box

[LAYOUT]
    -- General layout
    <div style="font-size:13px;text-align: right;  font-family:'Arial';">
    <table>
    <tr>   
    <td>
    <div style="text-align:left;">
    <div style="height: 15px;padding:2px;">Order Number:</div>
    <div style="height: 15px;padding:2px;">Accepted At:</div>
    
    </td>
    <td>
    <div style="height: 15px;padding:2px;">{ORDER NUMBERS}</div>
    <div style="height: 15px;padding:2px;">{TICKET DATE:dd/MMM/yy} at {TICKET TIME}</div>
    </td></tr>
    </table>
    </div>
    
    <div style="font-size:14px;text-align: right; font-family:'Arial';">
    <table>
    <tr>   
    <td>
    <div style="text-align:left;">
    <div style="height: 15px;padding:2px;">Phone:</div>
    <div style="height: 15px;padding:2px; font-weight:bold;">Customer:</div>
    
    </td>
    <td>
    <div style="height: 15px;padding:2px;">{ENTITY DATA:Customers:Phone}{ENTITY DATA:Accounts:Mobile}</div>
    <div style="height: 15px;padding:2px; font-weight:bold;">{ENTITY DATA:Customers:FirstName} {ENTITY DATA:Customers:LastName} {ENTITY DATA:Accounts:Customer Name}</div>
    </td></tr>
    </table>
    </div>

    <div style="font-size:18px; background-color: #000000 black; color: #ffffff;text-align:center;padding:2px;font-family:'Bahnschrift';"><b>{DEPARTMENT}{TICKET TAG:MANUAL ENTRY}</b></div>
    <div style="margin: 0; border-width: 1px; border-color: black; text-align: center; width: 100%; font-family:'Bahnschrift'; font-size:14px; font-weight:bold;"> [=FD(ADS('{TICKET DATE:HH:mm}',+{TICKET TAG:Pickup Minutes}*60),'hh:mm tt')]          {TICKET TAG:Pickup Minutes}<br>{ENTITIES}<br>{NOTE}</div>

Changing the part at the end to this should do it:

[<br>[{ENTITIES}]][<br>[{NOTE}]]

(if the part within the inner [ ] is empty, the whole part within the outer [ ] will not display)

However the printer template you included is incomplete, you reference {ENTITIES} but there is no [ENTITIES] section, so nothing will ever display there.

Also not sure if it’s an error but you have {ENTITY DATA:Customers:Phone} and {ENTITY DATA:Accounts:Mobile} - so the Customer Phone is coming from an Entity of Entity Type Customers and the Mobile is coming from a separate Entity of Entity Type Accounts. You also mix other fields between the 2 Entity Types.

1 Like

thank you @markjw now its hiding a line gap , tested except pickup time line, is still leaving a line space and border , tried with brackets .
Here is the full template some one needs, i added Notes,Table No and pickup time in Black section so its get attention of cook that works great for us.

[LAYOUT]
    -- General layout
    <div style="font-size:13px;text-align: right;  font-family:'Arial';">
    <table>
    <tr>   
    <td>
    <div style="text-align:left;">
    <div style="height: 15px;padding:2px;">Order Number:</div>
    <div style="height: 15px;padding:2px;">Accepted At:</div>
    </td>
    <td>
    
    <div style="height: 15px;padding:2px;">{ORDER NUMBERS}</div>
    <div style="height: 15px;padding:2px;">{TICKET DATE:dd/MMM/yy} at {TICKET TIME}</div>
    </td></tr>
    </table>
    </div>
    
    <div style="font-size:13px;text-align: right; font-family:'Arial';">
    <table>
    <tr>   
    <td>
    <div style="text-align:left;">
    <div style="height: 15px;padding:2px; font-weight:bold;">Customer:</div>
    <div style="height: 15px;padding:2px;">Phone:</div>
    </td>
    <td>
    
    <div style="height: 15px;padding:2px; font-weight:bold;">{ENTITY DATA:Customers:FirstName} {ENTITY DATA:Customers:LastName} {ENTITY DATA:Accounts:Customer Name}</div>
    <div style="height: 15px;padding:2px;">{ENTITY DATA:Customers:Phone}{ENTITY DATA:Accounts:Mobile}</div>
    </td></tr>
    </table>
    </div>

    <div style="font-size:18px;text-align:center;padding:2px;font-family:'Bahnschrift';"><b>{DEPARTMENT}{TICKET TAG:MANUAL ENTRY}</b></div>
    <div style="margin: 0; border-width: 1px; border-color: black; background-color: #000000 black; color: #ffffff; text-align: center; width: 100%; font-family:'Arial'; font-size:16px; font-weight:bold;">[[{ENTITIES}]][<br>[{NOTE}]]</div>
    <div style="margin: 0; border-width: 1px; border-color: black; background-color: #000000 black; color: #ffffff; text-align: center; width: 100%; font-family:'Arial'; font-size:16px; font-weight:bold;">[=FD(ADS('{TICKET DATE:HH:mm}',+{TICKET TAG:Pickup Minutes}*60),'hh:mm tt')]                               [[{TICKET TAG:Pickup Minutes}]]</div>
{ORDERS}
<J><F>

<div style="text-align:center; border: 1px black solid; font-family:'Arial';"> 
<div style="height: 20px; font-size:14px;font-weight:bold;padding:6px;">[='{TICKET STATE:Status}' == 'Paid' ? '☑  Paid              ☐ Not Paid' : '   ☐  Paid               ☑ Not Paid']</div>
<div style="height: 10px; font-size:18px;padding:5px;"></div>
</td><td>
    
  
[ORDERS GROUP|ORDER STATE:Course:Deals,Starters,Lunch Special,Main Course,Sides/Salads,Tandoor Breads,Desserts,Misc Item,Non Alcohol,Drinks,Packing]
<div style="padding: 2px; text-align: Center; width: 100%; font-family:'Arial'; font-size:10px; font-weight:bold;line-height: 1.6em;">[{GROUP KEY} ({QUANTITY SUM})]</div>
</div>

[ORDERS]
-- Default format for orders

<div style="font-size:16px;text-align:left;font-family:'Arial'">
<table>
<tr>
<td width=40> {QUANTITY} x </td>
<td width=260>{PRODUCT NAME} [='{PORTION}' == '' ? '' : '{PORTION}  ']</td>
</tr> 
</table>
</div>
<div style="font-size:13px;text-align:left;font-family:'Arial'; font-weight:bold;">
{SORTED ORDER TAGS}
</div>

[ORDERS:Gift]
-- Format for gifted orders
<div style="font-size:15px;text-align:left;font-family:'Arial'">
<table>
<tr class="strikeout">
<td width=40> ({QUANTITY}) x </td>
<td width=260>{PRODUCT NAME} [='{PORTION}' == '' ? '' : '{PORTION}  ']</td>
<td width=100 align=right><i><b>Free Item !</b></i></td>
</tr>
</table>

[ORDERS:Void]
-- Fromat for Voided orders
<div style="font-size:15px;text-align:left;font-family:'Arial'">
<table>
<tr class="strikeout">
<td width=40><i><b> ({QUANTITY}) x </b></i> </td>
<td width=260><i><b>{PRODUCT NAME}</b></i></td>
<td width=180 align=right><i><b>🆇 VOID</b></i></td>
</tr>
</table>


[SORTED ORDER TAGS]
-- Format for order tags
<div style="padding:0 0 0 18">☐ [={ORDER TAG QUANTITY}>1?'{ORDER TAG QUANTITY} X ':'']   {ORDER TAG NAME}  [({ORDER TAG TOTAL PRICE})]</div>
<div style="padding:0 0 0 18">{ORDER TAG NOTE}</div>


[ENTITIES:Table]
-- Customer entity format
 <div style="font-size:14px;text-align: right;  font-family:'Bahnschrift';">
    <table>
    <tr>   
    <td>
    <div style="text-align:left;">
    <div style="height: 15px;padding:1px;"> Table: {ENTITY NAME} </div>
    </td>

    <td>
    <div style="height: 15px;padding:1px;">Pax: {TICKET TAG:Pax Count}</div>
    </td></tr>
    </table>
    </div>