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} - ${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.
It's difficult to get the context of your question, but from a quick look I can say that where you have
statement.linesin your template, this should berecord.lines.If that doesn't help you can improve your question by: