home

Browse documentation

ezyVet Knowledge Center

Get access to documentation, training, and other high-quality resources.

Twig template variables: Invoices

The invoice variables show data of an invoice (for example, the totals, the payments and the line items). Each variable starts with invoice.

Variables that check a condition

Some of these variables show if a condition is true. For example, invoice.HasAnimal is true if the invoice has a related patient record.

To use a variable of this type:

  • Put the variable in a Twig if statement.
  • Between the if tag and the else tag, put the text to show when the condition is true.
  • Between the else tag and the endif tag, put the text to show when the condition is not true.
Note: When you use the variable without an if statement, the variable shows 1 when the condition is true. When the condition is not true, the variable shows no value.

Example:

{% if invoice.HasAnimal %}
Patient: {{ invoice.AnimalName }}
{% else %}
This invoice is not for a patient.
{% endif %}

In this example:

  • invoice.HasAnimal is true if the invoice has a related patient record.
  • When the condition is true, the invoice shows the name of the patient.
  • When the condition is not true, the invoice tells the client that the invoice is not for a patient.
RecordThe document shows
An invoice for Newsflash, the patient of Mr Riker, Will (200019). The condition is true.Patient: Newsflash
An invoice for Mr Riker, Will (200019), for a product only. The invoice has no patient. The condition is not true.This invoice is not for a patient.

Variables that show a list

Some of these variables show a list. For example, invoice.AllocatedPayments shows a list of the payments allocated to the invoice.

To use a variable of this type:

  • Put the variable in a Twig for loop.
  • Between the for tag and the endfor tag, put the text to show for each item.
  • After for, enter a name for each item in the list.
Note: Use the same name in the variables in the loop.

Example:

{% for payment in invoice.AllocatedPayments %}
{{ payment.Date|dateformat }}: {{ payment.Amount }}
{% endfor %}

In this example:

  • invoice.AllocatedPayments is the list of the payments allocated to the invoice.
  • payment is the name for each item in the list.
  • payment.Date and payment.Amount show the date and the quantity of each payment.
  • 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:

{{ invoice.ApprovedAt|dateformat }}

In this example:

  • invoice.ApprovedAt shows the approval date of the invoice.
  • The dateformat filter shows the date in a format that is easy to read.

Variables

NameClassic template system equivalent?Function
{{ invoice.Name }}NoShows the name of the invoice.
Note: This variable uses this format for the invoice name: <invoice-number>-<invoice-date>. <invoice-number> is the number of the invoice. <invoice-date> is the date of the invoice. The date obeys your date format configuration.
{{ invoice.StatusName }}NoShows the status of the invoice. The possible values are:
  • Approved
  • Pending
{{ invoice.ClientContactName }}NoShows the name of the client of the invoice.
{{ invoice.TaxBreakDownString }}{InvoiceTaxBreakdown}Shows the dollar quantity of each tax rate of the invoice.
{{ invoice.PaymentMethods }}{InvoicePaymentMethod}Shows the payment method of the invoice.
{{ invoice.TotalDiscountAmountIncTax }}{InvoiceTotalDiscountAmountIncTax}Shows the total discount quantity of the invoice. The value includes tax.
{{ invoice.TotalDiscountPercent }}{InvoiceTotalDiscountPercentage}Shows the total discount quantity of the invoice.
{{ invoice.InvoiceTypeName }}{InvoiceTypeName}Shows the type of the invoice (for example, if the invoice is a credit note).
{{ invoice.OrderNumber }}{InvoiceOrderNumber}Shows the purchase order numbers of the invoice.
{{ invoice.ApprovedAt }}NoShows the approval date of the invoice.
Note: To show a date value that is easy to read, use this variable with the dateformat Twig filter. For example:
{{ invoice.ApprovedAt|dateformat }}
For more information, refer to Variables that show a date.
{{ invoice.FreightGstRate }}NoShows the GST rate of the freight of the invoice.
{{ invoice.FreightGst }}No Shows the total GST of the freight of the invoice.
{{ invoice.Freight }}NoShows the total dollar value of the freight of the invoice. The value does not include tax.
{{ invoice.Outstanding }}NoShows the same value as {{ invoice.Due }}.
{{ invoice.Due }}{InvoiceDue}Shows the outstanding dollar value of the invoice.
Tip: Use this variable to show the dollar value that the client must pay.
{{ invoice.Allocated }} NoShows the same value as {{ invoice.Paid }}.
{{ invoice.Paid }}{InvoicePaid}Shows the paid dollar value of the invoice.
Note: ezyVet calculates the value as the total dollar value of the invoice minus {{ invoice.Due }}.
{{ invoice.Gst }}{InvoiceGst}Shows the total tax of the invoice.
{{ invoice.Total }}{InvoiceTotal}Shows the total dollar value of the invoice.
{{ invoice.Date }}{InvoiceDate}Shows the date of the invoice.
{{ invoice.DueDate }}{InvoiceDueDate}Shows the due date of the invoice.
{{ invoice.CustomerReference }}{InvoiceCustomerReference}Shows the reference number of the invoice.
{{ invoice.AllocatedHtml }}NoShows the payment allocation values of the invoice.
Note: To show each payment allocation value on a new line, enter:
{{ invoice.AllocatedHtml | nl2br }}
Note: To show a character between each payment allocation value, use the replace Twig filter. Put the character between quotation marks. For example, to show a | character, enter:
{{ invoice.AllocatedHtml | replace({'\n': ' | '}) }}
To show a comma, enter:
{{ invoice.AllocatedHtml | replace({'\n': ','}) }}
{{ invoice.InvoiceItemsHtml }}NoShows the line items of the invoice. This variable uses this format to show each line item: <product-code>-<barcode>-<product-name> x <quantity> @ <unit-price>. The unit price is the price after the discount. The value includes tax. If the product has no barcode, this variable does not show a barcode.
Note: To show each line item on a new line, enter:
{{ invoice.InvoiceItemsHtml | nl2br }}
{{ invoice.Comments }}{InvoiceComments}Shows all comments of the Comments section of the invoice.
Note: This variable shows the content without formatting and without line breaks.
{{ invoice.Department.TaxNumber }}{DepartmentTaxNumber}Shows the tax number of the department that person set for the invoice.
{{ invoice.Consult.TherapeuticSpecifics }}NoShows the content of the Specifics box of clinical procedure records of the clinical record.
{{ financial.DivisionTaxNumber }}NoShows the tax number of the department that you are signed in to.
{{ invoice.Consult.Date|dateformat }}{ConsultDate}Shows the date of the clinical record.
{{ invoice.ClientContact.AllContacts }}NoShows the name of the contact record and its Secondary Contact name.
Note: The template variable shows & between the two names.
Note: If the contact record does not have a Secondary Contact name, the template variable shows the name of the contact record only.
{{ invoice.surchargeAmount }}{InvoiceSurchargeAmount}Shows the surcharge quantity.
{{ invoice.paymentMethodsIncludingSurcharge }}{invoicePaymentMethodsIncludingSurcharge}Shows the payment methods that have a surcharge.
{{ invoice.NonBundleTotalDiscount }}NoShows the total discount of the invoice without the discounts for fixed-price product bundles.
{{ invoice.NonBundleTotalDiscountIncTax }}NoShows the total discount of the invoice with tax without the discounts for fixed-price product bundles.
{{ invoice.PaymentAmountTendered }}{PaymentAmountTendered}Shows the cash quantity paid of the payment.
{{ invoice.PaymentChange }}{PaymentChange}Shows the cash change of the payment.
{{ invoice.PaymentRounding }}{PaymentRounding}Shows the cash rounding value of the payment.
{{ invoice.LineItems }}NoShows a list of the line items of the invoice.
Note: Use this variable in a Twig for loop. For example:
{% for line in invoice.LineItems %}
  {{ line.Name }}
{% endfor %}
In the loop, you can use all invoice line item variables. For more information, refer to Variables that show a list.
{{ invoice.AllocatedPayments }}NoShows a list of the payments allocated to the invoice.
Note: Use this variable in a Twig for loop. For example:
{% for payment in invoice.AllocatedPayments %}
  {{ payment.Date }}: {{ payment.Amount }}
{% endfor %}
For more information, refer to Variables that show a list.
{{ invoice.Animal }}NoShows the patient record of the invoice.
Tip: To show more information about the record, add one more variable after this variable, for example {{ invoice.Animal.Name }}.
{{ invoice.AnimalName }}NoShows the name of the patient of the invoice.
{{ invoice.HasAnimal }}NoTrue if the invoice has a related patient record.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.ApprovedByUser }}NoShows the record of the staff member who approved the invoice.
Tip: To show more information about the record, add one more variable after this variable, for example {{ invoice.ApprovedByUser.Name }}.
{{ invoice.User }}NoShows the record of the staff member who made the invoice.
Tip: To show more information about the record, add one more variable after this variable, for example {{ invoice.User.Name }}.
{{ invoice.ContactInvoiceHasBeenMadeFor }}NoShows the contact record of the owner of the patient of the clinical record of the invoice.
Note: The owner of the patient can be different from the contact that ezyVet invoices.
{{ invoice.CustomerOrder }}NoShows the online customer order record that the invoice came from.
Note: If the invoice did not come from an online customer order, this variable shows no value.
{{ invoice.Financial }}NoShows the ledger record of the invoice.
Note: You can use these statement line variables after this variable:
  • OwnerRecordType
  • OwnerNumber
  • Amount
  • AllocatedAmount
  • ClientContact
  • Invoice
  • Payment
  • IsInvoice
  • IsPayment
For example, enter {{ invoice.Financial.AllocatedAmount }}.
{{ invoice.PaymentTerms }}NoShows the payment terms record of the invoice.
Tip: To show more information about the record, add one more variable after this variable, for example {{ invoice.PaymentTerms.Name }}.
{{invoice.HasBalanceOutstanding}}NoShows if the invoice has an outstanding balance. The possible values are:
  • YES (the invoice has an outstanding balance)
  • No value (the invoice does not have an outstanding balance)
{{ invoice.HasRemotePaymentMethod }}NoShows if ezyVet can supply an online payment link for the invoice. The possible values are:
  • YES (ezyVet can supply an online payment link)
  • No value (ezyVet cannot supply an online payment link)
{{invoice.RemotePaymentLink}}NoShows the online payment link of the invoice.
{{ invoice.SurchargeRate }}NoShows the surcharge rate for a payment with the online payment link of the invoice, for example 3.5%.
Note: If the payment method has no surcharge, this variable shows no value.
{{ invoice.SurchargeType }}NoShows the type of the surcharge of the invoice. The possible values are:
  • PERCENT (the surcharge is a percentage of the invoice)
  • FLAT (the surcharge is the same quantity for each payment)
{{ invoice.IsSurcharge }}NoTrue if the invoice is for a payment surcharge.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.IncludesTax }}NoTrue if the total dollar value of the invoice includes tax.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.SubTotal }}NoShows the total of the invoice without tax and freight.
Tip: To include tax, enter {{ invoice.SubTotal(true) }}.
{{ invoice.TotalDiscountAmount }}NoShows the total discount quantity of all line items of the invoice, without tax.
Tip: To include tax, enter {{ invoice.TotalDiscountAmount(true) }}.
{{ invoice.TotalDiscountAmountBeforeTax }}NoShows the total of all price adjustments of the line items of the invoice, without tax.
{{ invoice.OnBilledFromInvoice }}NoShows the record of the initial invoice of the on-billed invoice.
Note: This variable is applicable to syndicate on-billed invoices.
{{ invoice.OnBilledPercent }}NoShows the share of the initial invoice that the syndicate member pays. This variable uses a percentage to show the value.
Note: This variable is applicable to syndicate on-billed invoices.
{{ invoice.WellnessPlanMemberships }}NoShows a list of the wellness plan memberships of the invoice.
Note: Use this variable in a Twig for loop. Refer to Variables that show a list.
{{ invoice.HasDisabledLines }}NoTrue if the invoice has line items that are deactivated.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.HasDiscounts }}NoTrue if the invoice has a line item with a discount.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.HasNoPending }}NoTrue if the invoice has no line items with the Pending status and you have the permission to approve the invoice.
Note: This variable uses the permissions of the user who prints or sends the document. The same invoice can show a different result for a different user.
Note: For an invoice with a total less than 0, the user must also have the permission to approve credit notes.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.HasRoundingLine }}NoTrue if the invoice has a line item with a rounding value.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.IsApproved }}NoTrue if the invoice is approved.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.IsLocked }}NoTrue if the invoice is locked.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.IsSent }}NoTrue if the invoice has the Sent condition.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.IsReadyForBilling }}NoTrue if the invoice is approved but not locked.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoice.IsCreditNote }}NoTrue if the total dollar value of the invoice is less than 0.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.