【问题标题】:Netsuite Customer Statement (PDF/HTML)Netsuite 客户声明 (PDF/HTML)
【发布时间】:2017-05-31 20:48:06
【问题描述】:

我需要在客户声明的发票(行项目)上显示amount.paid

下面是我提出的解决方案,在我被建议包含toNumber function之后

【问题讨论】:

  • 第一行;如何在客户报表上的发票(行项目)上显示amount.paid@NineBerry

标签: pdf if-statement freemarker netsuite


【解决方案1】:

查看这些信息,我能够想出一个报表表,它可以满足我的需求。

  • 如果是发票,每一行都会显示费用
  • 如果是已付款的发票,将显示已付款金额
  • 如果是付款/存款/贷记,付款栏将显示该笔付款的总金额。
  • 余额列将显示金额,如果它是未付或部分付清的发票
  • 和运行列,将显示语句的运行总计
  • (代码见下文)

    <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>
    

【讨论】:

    猜你喜欢
    • 2018-10-20
    • 2017-05-26
    • 2017-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-08
    • 2017-07-14
    • 1970-01-01
    相关资源
    最近更新 更多