Print All Unique Tax Rate Values Shown in Item Lines in One Field in Advanced PDF/HTML Template

User wants to print all unique Tax Rate values used for each item in Item Table in one field in their customized Advanced PDF/HTML Template. The provided snippet may be inserted in the Summary section of the template.

This solution is applicable when Tax Rate is used as transaction line field in Item Lines and may be used as a column in the Item Table referenced as {item.taxrate1}.

Sample code is given below

<#assign taxrateValues = []>
  <#list record.item?sort_by("taxrate1") as item>
     <#assign allRates = item.taxrate1>
       <#if ! taxrateValues?seq_contains(allRates)>
          <#assign taxrateValues = taxrateValues + [allRates]>
           ${‌allRates?replace("%", " ")}
       </#if>
  </#list>

Leave a comment

Your email address will not be published. Required fields are marked *