简体   繁体   English

NS Advanced PDF / HTML模板

[英]NS Advanced PDF/HTML Template

I am creating a print out for Invoice using advanced pdf. 我正在使用高级pdf创建发票的打印输出。 I'm trying to get a value of a custom field in the "Tax code" record which is related to the field 'Tax code' in the sublist 'Item'. 我正在尝试获取“税码”记录中与子列表“项目”中的“税码”字段相关的自定义字段的值。 I tried with ${item.taxcode.customfield}, but in the print out, I have an error 我尝试使用$ {item.taxcode.customfield},但在打印输出中,出现错误

Exception during template merging.com.netledger.templates.TemplateServiceException: Exception during template merging.java.lang.NullPointerExceptionPlease contact your administrator. 模板merging.com.netledger.templates.TemplateServiceException期间的异常:模板merging.java.lang.NullPointerException期间的异常请联系管理员。

Is there another way to manipulate my case and make it work ? 还有另一种方法来操纵我的案子并使之起作用吗?

  <table class="total" style="width: 100%; margin-top: 10px;" border="2"> <#list record.item as item><#if item_index==0> <tr> <th colspan="5" line-height="150%" style="font-weight: bold;background-color: rgb(255, 255, 255);padding: 4x 2px;">Tax Code Message</th> </tr> <tr> <td ><#if item.taxcode?contains("VAT:")><#assign taxcode>${item.taxcode?replace("VAT:","")}</#assign>${taxcode}<br/>${item.taxcode.customfield}</#if></td> <td ></td> <td ></td> </tr> <tr> <td ></td> <td ></td> <td ></td> </tr> </#if></#list> </table> 

Thanks! 谢谢!

//assuming customfield is a replacement of your actual SB/PD field. //假设customfield替代了您实际的SB / PD字段。 I could be wrong, but could it be that you are trying to 'join' more than 2 records? 我可能是错的,但是可能是您要“加入”两个以上的记录吗? Not sure NetSuite allows that. 不确定NetSuite是否允许。

See if you could access it with the following: 查看是否可以通过以下方式访问它:

record.field?has_content
... <#assign... 
    <#list item as items
        <#list items.taxCode as itemTaxCode>
        <{itemTaxCode.customfield}>

Or you could do a source of the field on the line-item level of the record, then pull that custcol_* field. 或者,您可以在记录的行项目级别上执行该字段的来源,然后提取该custcol_ *字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM