You can use the invoice.invoice variable to show invoice variables such as job_name and sales_team_member in the Customer Account Statement Template.
Here is an example of how you can modify the default Customer Account Statement Template to show the invoice job name and sales team member.
Default Code
<thead>
<tr>
<th>Invoice Date</th>
<th>Invoice #</th>
{% if statement.has_any_po_numbers? %}
<th>PO #</th>
{% endif %}
{% if statement.is_company_statement? %}
<th>Customer</th>
{% endif %}
<th width="220">Description</th>
<th>Total</th>
<th>Opening Balance</th>
<th>Payments</th>
<th>Refunds</th>
<th width="120">Closing Balance</th>
</tr>
</thead>
{% endunless %}
{% unless statement.is_cart_based? %}
{% assign balance = statement.start_balance%}
{% assign row_count = 1%}
<tbody>
<tr>
<td>{{ statement.from_date | date: "%d/%b/%Y" }}0</td>
<td> </td>
{% if statement.is_company_statement? %}
<td> </td>
{% endif %}
<td>Previous balance (forwarded)</td>
<td class="text_right"> </td>
<td class="text_right"> </td>
<td class="text_right qty">{{ balance | format_currency }}</td>
</tr>
{% for item in statement.items %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{ item.date | date: "%d/%b/%Y" }}</td>
<td>{% if item.item_type == 'invoice' %} {{ item.invoice.order_number }}{% endif %}</td>
{% if statement.is_company_statement? %}
<td>{{ item.customer.full_name }}</td>
{% endif %}
<td>
{% if item.item_type == 'invoice' %}
Charges for invoice {{ item.invoice.order_number }}
{% elsif item.item_type == 'payment' %}
Payment Received ({{ item.invoice_numbers }})
{% elsif item.item_type == 'refund' %}
Payment Refunded
{% elsif item.item_type == 'credit' %}
Credit for invoice {{ item.credit.invoice.order_number }}
{% endif %}
</td>
<td class="text_right">{% if item.increases_balance? %} {{ item.amount | format_currency }}{% assign balance = balance | plus: item.amount%}{% endif %}</td>
<td class="text_right">{% if item.decreases_balance? %} {{ item.amount | format_currency }}{% assign balance = balance | minus: item.amount%}{% endif %}</td>
<td class="text_right qty">{{ balance | format_currency }}</td>
</tr>
{% endfor %}
{% for i in (row_count..16) %}
<tr>
<td> </td>
<td> </td>
{% if statement.is_company_statement? %}
<td> </td>
{% endif %}
<td> </td>
<td> </td>
<td> </td>
<td class="qty"> </td>
</tr>
{% endfor %}
</tbody>
{% else %}
{% assign row_count = 1%}
<tbody>
<tr>
<td colspan="9"><b>--- Outstanding Invoices Brought forward ---</b></td>
</tr>
{% for invoice in statement.outstanding_invoices %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{invoice.invoice_date | date: "%d/%b/%Y" }}</td>
<td>{{invoice.invoice_id}}</td>
{% if statement.has_any_po_numbers? %}
<td>{{invoice.po_number}}</td>
{% endif %}
{% if statement.is_company_statement? %}
<td>{{ invoice.customer.full_name }}</td>
{% endif %}
<td>Charges for invoice (brought forward)</td>
<td style="border-right: 2px solid;">{{invoice.invoice_total}}</td>
<td>{{invoice.previous_outstanding}}</td>
<td>{{invoice.paid_this_period}}</td>
<td>{{invoice.refunded_this_period}}</td>
<td class="text_right qty">{{invoice.outstanding}}</td>
</tr>
{% endfor %}
{% for invoice in statement.outstanding_invoices_with_new_payment %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{invoice.invoice_date | date: "%d/%b/%Y" }}</td>
<td>{{invoice.invoice_id}}</td>
{% if statement.has_any_po_numbers? %}
<td>{{invoice.po_number}}</td>
{% endif %}
{% if statement.is_company_statement? %}
<td>{{ invoice.customer.full_name }}</td>
{% endif %}
<td>Charges for invoice (brought forward)</td>
<td style="border-right: 2px solid;">{{invoice.invoice_total}}</td>
<td>{{invoice.previous_outstanding}}</td>
<td>{{invoice.paid_this_period}}</td>
<td>{{invoice.refunded_this_period}}</td>
<td class="text_right qty">{{invoice.outstanding}}</td>
</tr>
{% endfor %}
{% assign row_count = row_count | plus:1%}
<tr>
<td colspan="9"><b>--- New invoices ---</b></td>
</tr>
{% for invoice in statement.new_invoices %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{invoice.invoice_date | date: "%d/%b/%Y" }}</td>
<td>{{invoice.invoice_id}}</td>
{% if statement.has_any_po_numbers? %}
<td>{{invoice.po_number}}</td>
{% endif %}
<td>Charges for invoice</td>
Custom Code
Add the code in red to the default code shown above as follows:
<thead>
<tr>
<th>Invoice Date</th>
<th>Invoice #</th>
{% if statement.has_any_po_numbers? %}
<th>PO #</th>
{% endif %}
{% if statement.is_company_statement? %}
<th>Customer</th>
{% endif %}
<th width="220">Description</th>
<th>Job Name</th>
<th>Salesperson</th>
<th>Total</th>
<th>Opening Balance</th>
<th>Payments</th>
<th>Refunds</th>
<th width="120">Closing Balance</th>
</tr>
</thead>
{% endunless %}
{% unless statement.is_cart_based? %}
{% assign balance = statement.start_balance%}
{% assign row_count = 1%}
<tbody>
<tr>
<td>{{ statement.from_date | date: "%d/%b/%Y" }}0</td>
<td> </td>
{% if statement.is_company_statement? %}
<td> </td>
{% endif %}
<td>Previous balance (forwarded)</td>
<td class="text_right"> </td>
<td class="text_right"> </td>
<td class="text_right qty">{{ balance | format_currency }}</td>
</tr>
{% for item in statement.items %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{ item.date | date: "%d/%b/%Y" }}</td>
<td>{% if item.item_type == 'invoice' %} {{ item.invoice.order_number }}{% endif %}</td>
{% if statement.is_company_statement? %}
<td>{{ item.customer.full_name }}</td>
{% endif %}
<td>
{% if item.item_type == 'invoice' %}
Charges for invoice {{ item.invoice.order_number }}
{% elsif item.item_type == 'payment' %}
Payment Received ({{ item.invoice_numbers }})
{% elsif item.item_type == 'refund' %}
Payment Refunded
{% elsif item.item_type == 'credit' %}
Credit for invoice {{ item.credit.invoice.order_number }}
{% endif %}
</td>
{% for statement_invoice in statement.invoices %}
<td class="text_right">{{ statement_invoice.invoice.job_name }}</td>
<td class="text_right">{{ statement_invoice.invoice.sales_team_member }}</td>
{% endfor %}
<td class="text_right">{% if item.increases_balance? %} {{ item.amount | format_currency }}{% assign balance = balance | plus: item.amount%}{% endif %}</td>
<td class="text_right">{% if item.decreases_balance? %} {{ item.amount | format_currency }}{% assign balance = balance | minus: item.amount%}{% endif %}</td>
<td class="text_right qty">{{ balance | format_currency }}</td>
</tr>
{% endfor %}
{% for i in (row_count..16) %}
<tr>
<td> </td>
<td> </td>
{% if statement.is_company_statement? %}
<td> </td>
{% endif %}
<td> </td>
<td> </td>
<td> </td>
<td class="qty"> </td>
</tr>
{% endfor %}
</tbody>
{% else %}
{% assign row_count = 1%}
<tbody>
<tr>
<td colspan="11"><b>--- Outstanding Invoices Brought forward ---</b></td>
</tr>
{% for invoice in statement.outstanding_invoices %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{invoice.invoice_date | date: "%d/%b/%Y" }}</td>
<td>{{invoice.invoice_id}}</td>
{% if statement.has_any_po_numbers? %}
<td>{{invoice.po_number}}</td>
{% endif %}
{% if statement.is_company_statement? %}
<td>{{ invoice.customer.full_name }}</td>
{% endif %}
<td>Charges for invoice (brought forward)</td>
{% for outstanding_invoice in statement.outstanding_invoices %}
<td class="text_right">{{ outstanding_invoice.invoice.job_name }}</td>
<td class="text_right">{{ outstanding_invoice.invoice.sales_team_member }}</td>
{% endfor %}
<td style="border-right: 2px solid;">{{invoice.invoice_total}}</td>
<td>{{invoice.previous_outstanding}}</td>
<td>{{invoice.paid_this_period}}</td>
<td>{{invoice.refunded_this_period}}</td>
<td class="text_right qty">{{invoice.outstanding}}</td>
</tr>
{% endfor %}
{% for invoice in statement.outstanding_invoices_with_new_payment %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{invoice.invoice_date | date: "%d/%b/%Y" }}</td>
<td>{{invoice.invoice_id}}</td>
{% if statement.has_any_po_numbers? %}
<td>{{invoice.po_number}}</td>
{% endif %}
{% if statement.is_company_statement? %}
<td>{{ invoice.customer.full_name }}</td>
{% endif %}
<td>Charges for invoice (brought forward)</td>
{% for outstanding_invoice in statement.outstanding_invoices_with_new_payment %}
<td class="text_right">{{ outstanding_invoice.invoice.job_name }}</td>
<td class="text_right">{{ outstanding_invoice.invoice.sales_team_member }}</td>
{% endfor %}
<td style="border-right: 2px solid;">{{invoice.invoice_total}}</td>
<td>{{invoice.previous_outstanding}}</td>
<td>{{invoice.paid_this_period}}</td>
<td>{{invoice.refunded_this_period}}</td>
<td class="text_right qty">{{invoice.outstanding}}</td>
</tr>
{% endfor %}
{% assign row_count = row_count | plus:1%}
<tr>
<td colspan="11"><b>--- New invoices ---</b></td>
</tr>
{% for invoice in statement.new_invoices %}
{% assign row_count = row_count | plus:1%}
<tr>
<td>{{invoice.invoice_date | date: "%d/%b/%Y" }}</td>
<td>{{invoice.invoice_id}}</td>
{% if statement.has_any_po_numbers? %}
<td>{{invoice.po_number}}</td>
{% endif %}
<td>Charges for invoice</td>
{% for new_invoice in statement.new_invoices %}
<td class="text_right">{{ new_invoice.invoice.job_name }}</td>
<td class="text_right">{{ new_invoice.invoice.sales_team_member }}</td>
{% endfor %}
Comments
0 comments
Please sign in to leave a comment.