【发布时间】:2017-05-31 20:48:06
【问题描述】:
我需要在客户声明的发票(行项目)上显示amount.paid。
下面是我提出的解决方案,在我被建议包含toNumber function之后
【问题讨论】:
-
第一行;如何在客户报表上的发票(行项目)上显示
amount.paid@NineBerry
标签: pdf if-statement freemarker netsuite
我需要在客户声明的发票(行项目)上显示amount.paid。
下面是我提出的解决方案,在我被建议包含toNumber function之后
【问题讨论】:
amount.paid@NineBerry
标签: pdf if-statement freemarker netsuite
查看这些信息,我能够想出一个报表表,它可以满足我的需求。
(代码见下文)
<table>
<#list statement.lines as line>
<#if line_index==0>
<thead>
<tr>
<th>Date</th>
<th>Description</th>
<th>References #</th>
<th>Charge</th>
<th>Payment</th>
<th>Balance Due</th>
<th>Running</th>
</tr>
</thead>
</#if>
<tr>
<#function toNumber val><#if val?has_content && val?length gt 0 ><#return val?html?replace('[^0-9.]','','r')?number ><#else><#return 0 ></#if></#function>
<#assign amountpaid=(line.charge?int-line.amountremaining?int)>
<td>${line.datecol}</td>
<td>${line.description}</td>
<td>${line.otherrefnum} - ${line.custbodyjobnum}</td>
<td>${line.charge}</td>
<td><#if amountpaid gt 0>${amountpaid?string.currency}<#else>${line.payment}</#if></td>
<td>${line.amountremaining}</td>
<td>${line.balance}</td>
</tr>
</#list>
</table>
【讨论】: