Printing template merge generates error

Hi, I have set my printing tamplate to separate orders on submitted and new orders. the template looks like this.

[LAYOUT]
– General layout

ORDER
=
Date:{TICKET DATE}
Time:{TIME}
{ENTITIES}
Ticket No:{TICKET NO}
-
{ORDERS}

=

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

=

For more orders,
{USER NAME} continues serving you.

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

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

[PAYMENTS]
{PAYMENT NAME}|{PAYMENT AMOUNT}

[ORDERS GROUP|ORDER STATE:Status]

[ORDERS GROUP:Submitted]
{GROUP KEY}

[ORDERS GROUP:New]
{GROUP KEY}

[ORDERS]
– Default format for orders
- {QUANTITY} {NAME}|{TOTAL PRICE}
{ORDER TAGS}
{SORTED ORDER TAGS}

[ORDERS:Gift]
– Format for gifted orders
- {QUANTITY} {NAME}|GIFT
{ORDER TAGS}

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

[ORDER TAGS]
– Format for order tags
* {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
– Table entity format
Table: {ENTITY NAME}

[ENTITIES:Customer]
– Customer entity format
Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

my problem comes when I order the same product twice so that it should appear in both submitted and new orders. I get this error
image

the error is gone if i don’t merge order tags. how do i correct this error because I need to merge?

Interesting, I’m not sure there will be a solution to this, I would imagine samba is merging lines before passing to template processing so would need to be left unmerged