home

Browse documentation

ezyVet Knowledge Center

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

Twig template variables: Estimates

The estimate variables show data of an estimate (for example, the line items and the low and high totals). Most variables start with quotation or line.

The line variables work on each estimate line item in {% for line in quotation.LineItems %}.

Variables that check a condition

Some of these variables show if a condition is true. For example, quotation.HasTotalRange is true if the low total and the high total of the estimate are different.

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 quotation.HasTotalRange %}
The price can change, because some line items have a quantity range.
{% else %}
The price of this estimate does not change.
{% endif %}

In this example:

  • quotation.HasTotalRange is true if the low total and the high total of the estimate are different.
  • When the condition is true, the estimate tells the client that the price can change.
  • When the condition is not true, the estimate tells the client that the price does not change.
RecordThe document shows
An estimate for a dental procedure for Rintincan. One line item has a quantity range. The condition is true.The price can change, because some line items have a quantity range.
An estimate for a vaccination for Ruby. No line item has a quantity range. The condition is not true.The price of this estimate does not change.

Variables that show a list

Some of these variables show a list. For example, quotation.LineItems shows a list of the line items of the estimate.

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 line in quotation.LineItems %}
{{ line.ProductName }}: {{ line.CustomDescription }}
{% endfor %}

In this example:

  • quotation.LineItems is the list of the line items of the estimate.
  • line is the name for each item in the list.
  • line.ProductName shows the product name of each line item.
  • line.CustomDescription shows the custom description of each line item.
  • 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:

{{ quotation.Tax|moneyformat }}

In this example:

  • quotation.Tax shows the total tax of the low range of the estimate.
  • The moneyformat filter shows the currency symbol of your ezyVet site, then the value with two decimals, for example $1250.50.

Variables that show formatted content

Some of these variables show content with formatting (for example, a table or an address with a line break after each line). Variables of this type show the content in HTML. To show the formatting in the document, use the raw Twig filter. The Function column of each variable of this type has a note about the raw filter.

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

Note: If you do not use the raw filter, the document shows the HTML tags as text.

Example:

{{ quotation.LineContentsHtml|raw }}

In this example:

  • quotation.LineContentsHtml shows a table of the line items of the estimate.
  • The raw filter shows the table in the document.

Variables

NameClassic template system equivalent?Function
{{ quotation.Animal.DateOfBirth }}{AnimalDOB}Shows the full date of birth of the patient.
{{ quotation.Animal.Name }}{AnimalName}Shows the name of the patient.
{{ quotation.Animal.Number }}{AnimalNumber}Shows the value of the Code box of the patient record.
{{ quotation.Animal.Sex }}{AnimalSex}Shows the sex of the patient. The possible values are:
  • Male
  • Female
{{ quotation.BlurbHtml }}{EstimateBlurb}Shows the contents of the Blurb box of the estimate.
{{ quotation.ClientContact.Name }}{ContactName}Shows the name of the client.
Note: If the contact type is set to Business, the variable shows the name of the business. If the contact type is set to Individual, the variable shows the name of the person.
{{ quotation.ClientContact.PostalAddress.AddressText }}{ContactPostalAddress}Shows the postal address of the client.
{{ quotation.Date }}{EstimateDate}Shows the date of the estimate.
{{ quotation.Deposit }}{EstimateDeposit}Shows the deposit quantity of the estimate.
{{ quotation.Name }}{EstimateName}Shows the name of the estimate.
{{ quotation.Number }}{EstimateNumber}Shows the number of the estimate.
{{ quotation.Tax }}{EstimateLowTotalGst}Shows the total GST of the low range of the estimate.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ quotation.HighTotalExcTax }}{EstimateHighTotalExcGst}Shows the total dollar value of the high range of the estimate. The value does not include GST.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ quotation.HighTotalIncTax }}{EstimateHighTotalIncGst}Shows the total dollar value of the high range of the estimate.
Note: Use this variable with the moneyformat Twig filter. Refer to Variables that show a price or a total.
{{ quotation.TotalExcTax }}{EstimateTotalExcGst}Shows the total price of the estimate. The value does not include GST.
{{ quotation.TotalIncTax }}{EstimateTotalIncGst}Shows the total dollar quantity of the estimate. The value includes GST.
{{ quotation.LineItems }}NoShows a list of the line items of the estimate.
Note: Use this variable in a Twig for loop. For example:
{% for line in quotation.LineItems %}
  {{ line.ProductName }}
{% endfor %}
In the loop, you can use all estimate line item variables. For more information, refer to Variables that show a list.
{{ quotation.LineContentsHtml }}NoShows a table of the line items of the estimate, with the description, quantity, discounts, prices and totals.
Note: Use this variable with the raw Twig filter. Refer to Variables that show formatted content.
{{ quotation.StatusName }}NoShows the status of the estimate, for example Draft or Accepted.
{{ quotation.AnimalName }}NoShows the name of the patient of the estimate.
{{ quotation.Consult }}NoShows the clinical record of the estimate.
Tip: To show more information about the record, add one more variable after this variable, for example {{ quotation.Consult.Date }}.
{{ quotation.Total }}NoShows the low total of the estimate.
{{ quotation.SubTotal }}NoShows the total of the estimate, without tax.
Tip: To include tax, enter {{ quotation.SubTotal(true) }}.
{{ quotation.Gst }}NoShows the tax of the low total of the estimate.
{{ quotation.HighTotal }}NoShows the high total of the estimate.
{{ quotation.HighSubTotal }}NoShows the high total of the estimate, without tax.
{{ quotation.HighGst }}NoShows the tax of the high total of the estimate.
{{ quotation.HasTotalRange }}NoTrue if the low total and the high total of the estimate are different.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ quotation.HasTaxRange }}NoTrue if the low tax and the high tax of the estimate are different.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ quotation.HasDiscount }}NoTrue if the estimate has a line item with a discount.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ quotation.HasImages }}NoTrue if the estimate has a product with an image.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ quotation.IncludesTax }}NoTrue if the total dollar value of the estimate includes tax.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ line.ProductName }}NoShows the product name of the estimate line item.
{{ line.CustomDescription }}NoShows the custom description of the estimate line item.
{{ line.IsAccepted }}NoTrue if the client accepted the estimate line item.
Note: Use this variable in a Twig if statement. Refer to Variables that check a condition.
{{ line.ProductImageUrl }}NoShows the URL of the image of the product of the estimate line item.
Tip: Use this variable in an image tag to show the image in a PDF.
{{ line.BundleNestingDepth }}NoShows the number of product bundles above the estimate line item.
Note: For a top-level line item, this variable shows 0.