Netsuite客户声明(PDF / HTML)

时间:2017-01-16 22:36:18

标签: pdf if-statement freemarker netsuite

我需要在客户对帐单上显示发票(订单项)上的<InputWrap />

在我建议包含amount.paid

之后,我提出了以下解决方案

1 个答案:

答案 0 :(得分:0)

查看这些信息,我能够提出一个声明表,告诉我我想要的东西。

  • 如果是发票,每行都会显示费用
  • 如果是已付款的发票,则会显示已支付的金额
  • 如果是付款/存款/信用,付款列将显示该付款的总付款。
  • 余额列将显示金额,如果是未支付或部分支付的发票
  • 和正在运行的列将显示语句的运行总计
  • (请参阅下面的代码)

    <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}&nbsp;-&nbsp;${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>