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
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 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.HasTotalRangeis 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.
| Record | The 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
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 quotation.LineItems %}
{{ line.ProductName }}: {{ line.CustomDescription }}
{% endfor %}In this example:
quotation.LineItemsis the list of the line items of the estimate.lineis the name for each item in the list.line.ProductNameshows the product name of each line item.line.CustomDescriptionshows 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.Taxshows the total tax of the low range of the estimate.- The
moneyformatfilter 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.
raw filter, the document shows the HTML tags as text.Example:
{{ quotation.LineContentsHtml|raw }}In this example:
quotation.LineContentsHtmlshows a table of the line items of the estimate.- The
rawfilter shows the table in the document.
Variables
| Name | Classic 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:
|
{{ 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 }} | No | Shows a list of the line items of the estimate. Note: Use this variable in a Twig for loop. For example:In the loop, you can use all estimate line item variables. For more information, refer to Variables that show a list. |
{{ quotation.LineContentsHtml }} | No | Shows a table of the line items of the estimate, with the description, quantity, discounts, prices and totals. |
{{ quotation.StatusName }} | No | Shows the status of the estimate, for example Draft or Accepted. |
{{ quotation.AnimalName }} | No | Shows the name of the patient of the estimate. |
{{ quotation.Consult }} | No | Shows 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 }} | No | Shows the low total of the estimate. |
{{ quotation.SubTotal }} | No | Shows the total of the estimate, without tax. Tip: To include tax, enter {{ quotation.SubTotal(true) }}. |
{{ quotation.Gst }} | No | Shows the tax of the low total of the estimate. |
{{ quotation.HighTotal }} | No | Shows the high total of the estimate. |
{{ quotation.HighSubTotal }} | No | Shows the high total of the estimate, without tax. |
{{ quotation.HighGst }} | No | Shows the tax of the high total of the estimate. |
{{ quotation.HasTotalRange }} | No | True if the low total and the high total of the estimate are different. |
{{ quotation.HasTaxRange }} | No | True if the low tax and the high tax of the estimate are different. |
{{ quotation.HasDiscount }} | No | True if the estimate has a line item with a discount. |
{{ quotation.HasImages }} | No | True if the estimate has a product with an image. |
{{ quotation.IncludesTax }} | No | True if the total dollar value of the estimate includes tax. |
{{ line.ProductName }} | No | Shows the product name of the estimate line item. |
{{ line.CustomDescription }} | No | Shows the custom description of the estimate line item. |
{{ line.IsAccepted }} | No | True if the client accepted the estimate line item. |
{{ line.ProductImageUrl }} | No | Shows 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 }} | No | Shows the number of product bundles above the estimate line item. Note: For a top-level line item, this variable shows 0. |