Netsuite Customer Statement (PDF/HTML) - trying to insert posted code to display lines from invoice - but getting errors

51 views Asked by At

Simon G posted this answer to display lines from an invoice showing paid amounts on the customer statement and posted this code below, but when I try to insert it into the customer template at the record.lines level, I can't seem to get to save without errors. Can anyone help with where to insert this in the customer statement Advanced template for a standard customer statement.

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

I am using the regular customer statement default code.

I just need to know how to insert the lines code into the statement code. Any help would be greatly appreciated. THanks so much.

J Gold

I tried inserting it in the section for the record.lines, because it would not recognize, statement.lines, but keep getting one error after another, on missing tags, and incorrect tags.

1

There are 1 answers

1
Krypton On

It's difficult to get the context of your question, but from a quick look I can say that where you have statement.lines in your template, this should be record.lines.

If that doesn't help you can improve your question by:

  1. Adding a link to the answer you reference at the top of your question. ("Simon G posted this answer..." - what answer?)
  2. Enumerate the specific errors you're getting, and when you get them. IE: the process you're following and at what point in the process the error appears.