Created
December 16, 2020 21:21
-
-
Save 23maverick23/bd912b14aca218e70d700c6fe645b36f to your computer and use it in GitHub Desktop.
NS: Freemarker PDF Template - Chart by Item Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table align="left" border="0" width="100%"> | |
<tr> | |
<td> | |
<piegraph width="150" height="150" display-key="flat-outer"> | |
<#assign previous_itemtype = ""> | |
<#assign item_name = ""> | |
<#list record.item?sort_by('itemtype') as item> | |
<#if item.itemtype != previous_itemtype> | |
<#assign current_itemtype = item.itemtype> | |
<#assign itemtype_subtotal = 0> | |
<#list record.item?sort_by('itemtype') as item> | |
<#if item.itemtype == current_itemtype> | |
<#assign itemtype_subtotal += item.amount> | |
</#if> | |
</#list> | |
</#if> | |
<#if item.itemtype == "NonInvtPart"> | |
<#assign item_name = "Licenses/Materials"> | |
<#elseif item.itemtype == "InvtPart"> | |
<#assign item_name = "Inventory"> | |
<#elseif item.itemtype == "Service"> | |
<#assign item_name = "Services"> | |
<#elseif item.itemtype == "Expense"> | |
<#assign item_name = "Billable Expenses"> | |
</#if> | |
<gdata name="${item_name} (${nsformat_currency(itemtype_subtotal)})" value="${itemtype_subtotal}"/> | |
<#assign previous_itemtype = item.itemtype> | |
</#list> | |
</piegraph> | |
</td> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment