home

Browse documentation

ezyVet Knowledge Center

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

Twig template variables: Invoice line items

The invoice line item variables show data of each line item of an invoice (for example, the product, the quantity, the discount and the total). Each variable starts with invoiceline.

Variables that check a condition

Some of these variables show if a condition is true. For example, invoiceline.IncludesTax is true if the prices of the invoice line item include tax.

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:

{{ invoiceline.Name }}
{% if invoiceline.IncludesTax %}
(Price includes tax)
{% else %}
(Price does not include tax)
{% endif %}

In this example:

  • invoiceline.IncludesTax is true if the prices of the invoice line item include tax.
  • When the condition is true, the invoice shows that the price includes tax.
  • When the condition is not true, the invoice shows that the price does not include tax.
RecordThe document shows
A line item on an invoice for Rintincan. The price includes tax. The condition is true.Dental scale and polish

(Price includes tax)

A line item on an invoice for Rintincan. The price does not include tax. The condition is not true.Dental scale and polish

(Price does not include tax)

Variables that show a list

Some of these variables show a list. For example, invoiceline.NestedLines shows a list of the line items below a header line.

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 nested in invoiceline.NestedLines %}
{{ nested.ProductCode }}: {{ nested.Name }}
{% endfor %}

In this example:

  • invoiceline.NestedLines is the list of the line items below a header line.
  • nested is the name for each item in the list.
  • nested.ProductCode shows the product code of each line item below the header line.
  • nested.Name shows the description of each line item below the header line.
  • The document shows the text between the tags one time for each item in the list.

Variables that show a price or a total

Some of these variables show a price or a total. To show the value in a format that is easy to read, use the moneyformat Twig filter. The Function column of each variable of this type has a note about the moneyformat filter.

After the variable name, enter a vertical bar and moneyformat.

Example:

{{ invoiceline.Total|moneyformat }}

In this example:

  • invoiceline.Total shows the total of the invoice line item.
  • The moneyformat filter shows the currency symbol of your ezyVet site, then the value with two decimals, for example $1250.50.

Variables

NameFunction
{{ invoiceline.ProductName }}Shows the name of theproduct.
Note: This variable shows the product name that is in the Description column of the invoice line item.
{{ invoiceline.Product.Name }}Shows the name of theproduct.
Note: This variable shows the product name that is in the configuration of the product.
{{ invoiceline.Quantity }}Shows the quantity of the product.
{{ invoiceline.Date }}Shows the date of the invoice line item.
{{ invoiceline.SalesPerson }}Shows the contact record of the sales person of the invoice line item.
{{ invoiceline.TotalBeforeDiscount }}Shows the total dollar quantity of the invoice line item without the discount. The value does not include tax.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ invoiceline.TotalBeforeDiscount(true) }}Shows the total dollar quantity of the invoice line item without the discount. The value includes tax.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ invoiceline.TotalDiscount }}Shows the total discount quantity of the invoice line item. This variable uses a dollar quantity to show the value.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ invoiceline.TotalDiscountPercent }}Shows the total discount quantity of the invoice line item. This variable uses a percentage to show the value.
Tip: To show the percentage rounded to two decimal places, enter {{ invoiceline.TotalDiscountPercent }}|round(2)
{{ invoiceline.Total(true) }}Shows the total dollar value of the invoice line item. The value includes tax.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ invoiceline.Total }}Shows the total dollar value of the invoice line item. The value does not include tax.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ invoiceline.PriceAfterDiscount(true) }}Shows the total price of the invoice line item with the discount.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ invoiceline.Product.PrintableName }}Shows the content of the Printable Name box of the product's configuration.
Note: The content of the Printable Name box is the alternative product name.
{{ line.NonBundleTotalDiscount }}Shows the discount quantity of a line item of a fixed-price product bundle.
Note: The {{ line.NonBundleTotalDiscount }} variable only shows the discount quantity that a staff member sets or that a price adjustment rule sets.
{{ invoiceline.serialAndExpiry }}Shows the serial number and expiration date of a line item of a product or batch.
Note: The expiration date obeys your date format configuration. If a batch does not have an expiration date, ezyVet does not show an expiration date.
{{ TotalTaxBeforeDiscount }}Shows the total price value of an invoice line item without discounts.
{{ invoiceline.NonBundleDiscountReasons }}Shows the discount reasons of the invoice line item, with a comma between each value.
Note: This variable does not show the discount reasons of a product bundle.
{{ invoiceline.BatchNumberAndExpiry }}Shows the batch number and the expiration date of each batch of the invoice line item, with a comma between each value.
Note: The expiration date obeys your date format configuration.
{{ invoiceline.Name }}Shows the description of the invoice line item as it shows on the invoice.
{{ invoiceline.ProductCode }}Shows the product code of the invoice line item.
{{ invoiceline.Reference }}Shows the reference of the invoice line item.
{{ invoiceline.Price }}Shows the unit price of the invoice line item, after discount.
Tip: To include tax, enter {{ invoiceline.Price(true) }}.
{{ invoiceline.PriceBeforeDiscount }}Shows the unit price of the invoice line item, before discount.
Tip: To include tax, enter {{ invoiceline.PriceBeforeDiscount(true) }}.
{{ invoiceline.PriceGst }}Shows the tax of each unit of the invoice line item, after discount.
{{ invoiceline.DiscountAmountPerUnit }}Shows the discount quantity of each unit of the invoice line item.
Tip: To include tax, enter {{ invoiceline.DiscountAmountPerUnit(true) }}.
{{ invoiceline.DiscountAmountPerUnitTax }}Shows the tax part of the discount quantity of each unit of the invoice line item.
{{ invoiceline.TotalDiscountAmountBeforeTax }}Shows the total discount quantity of the invoice line item, without tax.
{{ invoiceline.TotalBeforeDiscountTax }}Shows the tax of the total of the invoice line item, before discount.
{{ invoiceline.TotalGst }}Shows the total tax of the invoice line item, with two decimals.
{{ invoiceline.TotalTax }}Shows the total tax of the invoice line item.
Note: This variable shows the value without formatting.
{{ invoiceline.TaxRate }}Shows the tax rate of the invoice line item. This variable uses a percentage to show the value.
{{ invoiceline.TaxCode }}Shows the tax code of the invoice line item.
{{ invoiceline.IncludesTax }}True 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.
{{ invoiceline.FullBatchInfo }}Shows each serial number or batch number of the invoice line item, with the expiration date of each number.
Note: This variable shows a comma between each value, for example ABC123 12/03/2027, DEF456 01/09/2027.
{{ invoiceline.SerialNumbersString }}Shows the serial numbers of the invoice line item, with a comma between each value.
{{ invoiceline.HasSerialNumbers }}True if the invoice line item has a serial number.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.IsHeaderLine }}True if the invoice line item is the header line of a product bundle or a group.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.HasHeaderLine }}True if the invoice line item is under a header line.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.HeaderLine }}Shows the record of the header line of the invoice line item.
{{ invoiceline.nestedLines }}Shows a list of the line items under the header line.
Note: Use this variable in a Twig for loop. Refer to Variables that show a list.
{{ invoiceline.IsContainerProduct }}True if the product of the invoice line item is a product container.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.ProductContainerItems }}Shows a list of the items of the product container of the invoice line item.
Note: Use this variable in a Twig for loop. Refer to Variables that show a list.
{{ invoiceline.ContainedProductNames }}Shows the names of the items of the product container of the invoice line item, with a comma between each value.
{{ invoiceline.PrintContained }}True if the invoice line item is configured to show the contained items of the invoice line item on the invoice.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.PrintContainedPrices }}True if the invoice line item is configured to show the prices of the contained items of the invoice line item on the invoice.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.ShowProductContainerItems }}True if the product of the invoice line item is configured to show the contained items of the product on the invoice.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.ShowProductContainerItemPrices }}True if the product of the invoice line item is configured to show the prices of the contained items of the product on the invoice.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ invoiceline.HighQty }}Shows the high quantity of an invoice line item that has a quantity range.
Note: This variable is usually for an estimate.
{{ invoiceline.HighTotal }}Shows the high total of an invoice line item that has a quantity range.
Note: This variable is usually for an estimate.
{{ invoiceline.CombinedInvoiceDescription }}Shows the product name of the invoice line item, followed by the reference of the invoice line item in brackets.
Note: This variable is applicable to combined invoices.
{{ invoiceline.Consult }}Shows the clinical record of the invoice line item.
Tip: To show more information about the record, add one more variable after this variable, for example {{ invoiceline.Consult.Date }}.
{{ invoiceline.Invoice }}Shows the invoice record of the invoice line item.
Tip: To show more information about the record, add one more variable after this variable, for example {{ invoiceline.Invoice.Number }}.