Twig template variables: Statements
The statement variables show data of a statement (for example, the balances and the statement lines). Most variables start with statement or debtorcontact.
debtorcontact variable is the client that the statement is for. All contact variables also work with the debtorcontact variable. These variables do not use a prefix:isDetailedshowDiscountbyAnimalshowAnimalSubtotalshowSalesPersontaxName
The line variables work on each statement line in {% for line in statement.lines %}.
- The
statementvariables - The variables that do not use a prefix
line.balanceAt,line.transTypeandline.taxTotalline.animalHeaderandline.animalDetails- The names after
line.animalHeaderandline.animalDetails(for example,line.animalHeader.animalName)
Enter these variables as shown. For example, enter statement.startDate, not statement.StartDate. The part after a record is not case-sensitive (for example, Name in statement.business.Name).
Variables that check a condition
Some of these variables show if a condition is true. For example, debtorcontact.HasOverdueBalance is true if the client has an overdue balance.
To use a variable of this type:
- Put the variable in a Twig
ifstatement. - Between the
iftag and theelsetag, put the text to show when the condition is true. - Between the
elsetag and theendiftag, put the text to show when the condition is not true.
if statement, the variable shows 1 when the condition is true. When the condition is not true, the variable shows no value.Example:
{% if debtorcontact.HasOverdueBalance %}
Your account is overdue. Please pay the overdue balance.
{% else %}
Thank you for your payment.
{% endif %}In this example:
debtorcontact.HasOverdueBalanceis true if the client has an overdue balance.- When the condition is true, the statement tells the client to pay the overdue balance.
- When the condition is not true, the statement thanks the client.
| Record | The document shows |
|---|---|
| A statement for Mr Riker, Will (200019), with an overdue balance. The condition is true. | Your account is overdue. Please pay the overdue balance. |
| A statement for Miss Kochanski, Kristine (200021), with no overdue balance. The condition is not true. | Thank you for your payment. |
Variables that show a list
Some of these variables show a list. For example, statement.lines shows a list of the statement lines.
To use a variable of this type:
- Put the variable in a Twig
forloop. - Between the
fortag and theendfortag, put the text to show for each item. - After
for, enter a name for each item in the list.
Example:
{% for line in statement.lines %}
{{ line.OwnerRecordType }} {{ line.OwnerNumber }}: {{ line.Amount }}
{% endfor %}In this example:
statement.linesis the list of the statement lines.lineis the name for each item in the list.line.OwnerRecordType,line.OwnerNumberandline.Amountshow the record type, the number and the amount of each statement line.- The document shows the text between the tags one time for each item in the list.
Variables that show a date
Some of these variables show a date. To show the date in a format that is easy to read, use the dateformat Twig filter. The Function column of each variable of this type has a note about the dateformat filter.
After the variable name, enter a vertical bar and dateformat.
Example:
{{ statement.dueDate|dateformat }}In this example:
statement.dueDateshows the due date of the last invoice of the client.- The
dateformatfilter shows the date in a format that is easy to read.
Variables
| Name | Classic template system equivalent? | Function |
|---|---|---|
{{ statement.business.Name }} | No | Shows the signed-in department, business unit, or database. |
{{ debtorcontact.FinalBalance }} | {FinalBalance} | Shows the client balance at the end of the statement period. |
{{ settings.BankAccountNumber }} | {BusinessBankAccount} | Shows the bank account number of the business unit. |
{{ debtorcontact.StartDate }} | No | Shows the start date of the statement period. Note: The date obeys your date format configuration. |
{{ debtorcontact.EndDate }} | No | Shows the end date of the statement period. Note: The date obeys your date format configuration. |
{{ debtorcontact.ThisMonthName }} | No | Shows the name of this month, for the aging columns of the statement. |
{{ debtorcontact.Minus1MonthName }} | No | Shows the name of the month one month before this month, for the aging columns of the statement. |
{{ debtorcontact.Minus2MonthName }} | No | Shows the name of the month two months before this month, for the aging columns of the statement. |
{{ debtorcontact.Minus3MonthName }} | No | Shows the name of the month three months before this month, for the aging columns of the statement. |
{{ debtorcontact.Minus4MonthName }} | No | Shows the name of the month four months before this month, for the aging columns of the statement. |
{{ debtorcontact.Minus3PlusMonthName }} | No | Shows the name of the month three months before this month, followed by +, for an aging column of three or more months. |
{{ debtorcontact.ThisMonthBalance }} | No | Shows the balance of the client for this month. |
{{ debtorcontact.Minus1MonthBalance }} | No | Shows the balance of the client for the month one month before this month. |
{{ debtorcontact.Minus2MonthBalance }} | No | Shows the balance of the client for the month two months before this month. |
{{ debtorcontact.Minus3MonthBalance }} | No | Shows the balance of the client for the month three months before this month. |
{{ debtorcontact.Minus4MonthBalance }} | No | Shows the balance of the client for the month four months before this month. |
{{ debtorcontact.Minus3PlusMonthBalance }} | No | Shows the balance of the client for three or more months before this month. |
{{ debtorcontact.Minus1MonthDiscountAmount }} | No | Shows the discount quantity that the client got in the month one month before this month. |
{{ debtorcontact.Minus2MonthDiscountAmount }} | No | Shows the discount quantity that the client got in the month two months before this month. |
{{ debtorcontact.Minus3MonthDiscountAmount }} | No | Shows the discount quantity that the client got in the month three months before this month. |
{{ debtorcontact.Minus4MonthDiscountAmount }} | No | Shows the discount quantity that the client got in the month four months before this month. |
{{ debtorcontact.OverdueBalance }} | No | Shows the overdue balance of the client. |
{{ debtorcontact.HasOverdueBalance }} | No | True if the client has an overdue balance. |
{{ debtorcontact.HasRemotePaymentMethod }} | No | Shows if your ezyVet site has a payment method that can supply online payment links. The possible values are:
|
{{ debtorcontact.RemotePaymentLink }} | No | Shows the online payment link for the balance of the client. |
{{ debtorcontact.ResidenceStatementLines }} | No | Shows a list of the statement lines for each patient that resides with the client. |
{{ statement.startDate }} | No | Shows the start date of the statement period. Note: The date obeys your date format configuration. |
{{ statement.endDate }} | No | Shows the end date of the statement period. Note: The date obeys your date format configuration. |
{{ statement.initialBalance }} | No | Shows the balance of the client at the start of the statement period. |
{{ statement.finalBalance }} | No | Shows the balance of the client at the end of the statement period. |
{{ statement.currentBalance }} | No | Shows the balance of the client today. |
{{ statement.totalBalanceExcTax }} | No | Shows the balance of the client at the end of the statement period, without tax. |
{{ statement.totalBalanceIncTax }} | No | Shows the balance of the client at the end of the statement period, with tax. |
{{ statement.totalTax }} | No | Shows the tax part of the balance of the client at the end of the statement period. |
{{ statement.dueDate }} | No | Shows the due date of the last invoice of the client. |
{{ statement.interestRate }} | No | Shows the interest rate of the statement. |
{{ statement.toMonth }} | No | Shows the month that the statement goes to. |
{{ statement.lines }} | No | Shows the list of the statement lines. Note: Use this variable in a Twig for loop. For example:In the loop, you can use the line variables. For more information, refer to Variables that show a list. |
{{ line.OwnerRecordType }} | No | Shows the type of the statement line. The possible values are:
|
{{ line.OwnerNumber }} | No | Shows the number of the invoice or the payment of the statement line. |
{{ line.Amount }} | No | Shows the quantity of the invoice or the payment of the statement line. |
{{ line.AllocatedAmount }} | No | Shows the allocated quantity of the invoice or the payment of the statement line. |
{{ line.balanceAt }} | No | Shows the balance of the client after the statement line. |
{{ line.transType }} | No | Shows the type of the statement line. Note: For a payment, this variable also shows the payment method (for example, Payment: Cash). |
{{ line.taxTotal }} | No | Shows the outstanding tax of the invoices, from the start of the statement to the statement line. |
{{ line.animalHeader }} | No | Shows the patient information for the first statement line of each patient. Note: This variable shows a value only when byAnimal is true.Tip: To show one part of the patient information, add a name after this variable, for example {{ line.animalHeader.animalName }}. The possible names are animalName, animalLocation, animalSyndicateMsg, animalBalance and animalBalanceGst. |
{{ line.animalDetails }} | No | Shows the patient information and the balance of the patient for the last statement line of each patient. Note: This variable shows a value only when byAnimal is true.Tip: To show one part of the patient information, add a name after this variable, for example {{ line.animalDetails.animalBalance }}. The possible names are animalName, animalLocation, animalSyndicateMsg, animalBalance and animalBalanceGst. |
{{ line.ClientContact }} | No | Shows the contact record of the client of the statement line. Tip: To show more information about the record, add one more variable after this variable, for example {{ line.ClientContact.Name }}. |
{{ line.Invoice }} | No | Shows the invoice record of the statement line. Note: If the statement line is a payment, this variable shows no value. Tip: To show more information about the record, add one more variable after this variable, for example {{ line.Invoice.Number }}. |
{{ line.Payment }} | No | Shows the payment record of the statement line. Note: If the statement line is an invoice, this variable shows no value. Tip: To show more information about the record, add one more variable after this variable, for example {{ line.Payment.Number }}. |
{{ line.IsInvoice }} | No | True if the statement line is an invoice. |
{{ line.IsPayment }} | No | True if the statement line is a payment. |
{{statement.remotePaymentLink}} | No | Shows the online payment link for the balance of the client. |
{{ statement.hasRemotePaymentMethod }} | No | True if your ezyVet site has a payment method that can supply online payment links. |
{{ isDetailed }} | No | True if your ezyVet site is configured to show detailed statements. |
{{ showDiscount }} | No | True if your ezyVet site is configured to show discounts on statements. |
{{ byAnimal }} | No | True if your ezyVet site is configured to group statements by patient. |
{{ showAnimalSubtotal }} | No | True if your ezyVet site is configured to show a subtotal for each patient on statements. |
{{ showSalesPerson }} | No | True if your ezyVet site is configured to show the sales person on statements. |
{{ taxName }} | No | Shows the name of the sales tax of your ezyVet site, for example GST or VAT. Note: This variable does not use a prefix. |