【发布时间】:2021-03-26 12:36:12
【问题描述】:
我们正在使用 NetSuite 的用于分组发票的高级 PDF 模板来打印发票组,并且需要在发票组的每个发票行中包含一个现有的自定义字段(发票抬头中的 custbody_subscription_name)。
我们可以将自定义字段添加到 Invoice Group 应用程序的视图中,但是我们如何引用 PDF 模板中的自定义字段?该模板似乎使用硬编码名称“groupedinvoices_summary”来引用每组发票,但不清楚如何引用自定义字段。这是我们的自定义 HTML 模板的 sn-p,其中包含我们的 'custbody_subscription_name' 自定义字段:
<table style="width: 100%; margin-top: 10px;"><#list groupedinvoices_summary as invoice><#if invoice_index==0>
<thead>
<tr style="background-color: #d3d3d3;">
<td align="center" colspan="4" style="font-weight: bold;border-left: 1px solid; border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.custbody_subscription_name@label}</td>
<td align="center" colspan="4" style="font-weight: bold;border-left: 1px solid; border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.invoicenum@label}</td>
<td align="center" colspan="3" style="font-weight: bold;border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.itemtotal@label}</td>
<td align="center" colspan="3" style="font-weight: bold;border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.discounttotal@label}</td>
<td align="center" colspan="3" style="font-weight: bold;border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.trantaxtotal@label}</td>
<td align="center" colspan="3" style="font-weight: bold;border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.shippingcharge@label}</td>
<td align="center" colspan="3" style="font-weight: bold;border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.handlingcharge@label}</td>
<td align="center" colspan="3" style="font-weight: bold;border-top: 1px solid; border-bottom: 1px solid; border-right: 1px solid ">${invoice.fxamount@label}</td>
</tr>
</thead>
</#if><tr>
<td align="left" colspan="4" style="color: #333333;border-left: 1px solid; border-bottom: 1px solid; border-right: 1px solid">${invoice.custbody_subscription_name}</td>
<td align="left" colspan="4" style="color: #333333;border-left: 1px solid; border-bottom: 1px solid; border-right: 1px solid">${invoice.invoicenum}</td>
<td align="center" colspan="3" style="border-bottom: 1px solid; border-right: 1px solid">${invoice.itemtotal}</td>
<td align="center" colspan="3" style="border-bottom: 1px solid; border-right: 1px solid">${invoice.discounttotal}</td>
<td align="center" colspan="3" style="border-bottom: 1px solid; border-right: 1px solid">${invoice.trantaxtotal}</td>
<td align="center" colspan="3" style="border-bottom: 1px solid; border-right: 1px solid">${invoice.shippingcharge}</td>
<td align="center" colspan="3" style="border-bottom: 1px solid; border-right: 1px solid">${invoice.handlingcharge}</td>
<td align="right" colspan="3" style="border-bottom: 1px solid; border-right: 1px solid">${invoice.fxamount}</td>
</tr>
</#list></table>
更新 #1:在尝试了各种方法之后,主要问题显然是只能引用默认视图中的字段。我们如何解决这个问题?
【问题讨论】:
标签: netsuite suitescript suitescript2.0