Aaron McCausland
12/09/2024, 9:49 PMCeligo AI
12/09/2024, 9:49 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that you are already on the right track with your current approach. Using Freemarker to conditionally sum up the line items and then rendering those variables is a common practice in NetSuite's Advanced PDF/HTML Templates. However, there is no built-in preference in NetSuite to exclude closed lines from the PDF and its total amounts. You would need to continue using your current method or consider a more advanced approach such as creating a custom SuiteScript beforeLoad script that manipulates the data before it is sent to the template. This would involve creating a custom field, calculating the totals there, and then referencing that field in your template. Here is a sample code snippet for your reference:
freemarker
<#assign subtotal = 0>
<#assign taxtotal = 0>
<#list record.item as line>
<#if line.closed != "Yes">
<#if line.taxcode == "Non-Taxable">
<#assign subtotal += line.amount>
<#else>
<#assign taxtotal += line.amount>
</#if>
</#if>
</#list>
<#assign grandtotal = subtotal + taxtotal>
Remember to replace the field names with the actual field names in your record.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
12/09/2024, 9:49 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831179261
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825231194
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.824970186
Celigo AI
12/09/2024, 9:49 PMAaron McCausland
12/09/2024, 9:51 PM