I have an Invoice Template for which I want to display a table as a summary of VAT (TVA), so for example if I have three items with the same TVA and one item with different TVA code, I should display two lines of TVA, one with the sum of amounts of the other lines, and the second line of TVA correspond to the unique TVA.
I currently have the below code in the Template, which doesn't work correctly.
<table class="itemtable" style="margin-top:10px;width:100%;"><!-- start items --><#list record.item as item><#list record.item as items> <#if items_index==0><#if item_index==0>
<thead>
<tr>
<th colspan="5" line-height="150%" style="font-weight: bold;background-color: rgb(255, 255, 255);padding: 4x 2px;">TVA</th>
</tr>
<tr>
<td>Code</td>
<td>VAT</td>
<td>VAT%</td>
<td>Amount</td>
<td> </td>
</tr></thead></#if></#if>
<tr>
<#if !(items.taxcode?matches(item.taxcode))>
<td>${item.taxcode} ${items.taxcode} </td>
<td>${item.tax1amt}</td>
<td>${item.taxrate1}</td>
<td>${item.amount}</td>
<td> </td>
</#if>
</tr></#list></#list><!-- end items --></table>
Is there a way to get list of TVA present at the line of item without repetition in freemarker template?