4.8. Placeholders reference

This is a reference section that shows all the fields that can be used in an invoice template. These fields can be used to include information about:

  • your business

  • your client's business

  • the actual invoice content

Some fields contain an additional description to properly describe their meaning.

4.8.1. Business

The following table shows the fields that can be used to include information about your business in an invoice.

Table 4.4. Business Properties

Property Version Meaning

1. General

business.name 1.0 self-explained
business.code 2.3 A short code that identifies your business.
business.businessNumber 2.3 The number assigned to your business when it was created.
business.otherNumber 2.3 A number that could be used as the trade register number.
business.taxNumber 1.4 The tax number assigned by the government to your business. In many countries, businesses must include their VAT number on their invoices. In such cases, the tax number is the VAT number.

2. Taxes

business.taxLiable 1.5

Indicates whether the business pays taxes or not. A business pays taxes if they are enabled.

If you want to do something when the business pays taxes:

[#if business.taxLiable]
...
[/#if]

If you want to do something when the business doesn't pay taxes:

[#if !business.taxLiable]
...
[/#if]

3. Contact

business.attention 1.0 self-explained
business.address 1.0 self-explained
business.city 1.0 self-explained
business.state 1.0 self-explained
business.zip 1.0 self-explained
business.country 1.0 self-explained
business.phone 1.0 self-explained
business.fax 1.0 self-explained
business.mobile 2.1 self-explained
business.other 2.1 self-explained
business.email 1.0 self-explained
business.website 1.8 self-explained

4.8.2. Client

The following table shows the fields that can be used to include information about your client's business in an invoice.

Table 4.5. Client Properties

Property Version Meaning
1. General
client.name 1.0 self-explained
client.code 1.5 The client code is especially useful if you want to number invoices automatically and to include the client code in the invoice number.
client.businessNumber 2.3 The number assigned to the business when it was created.
client.otherNumber 2.3 A number that could be used as the trade register number.
client.taxNumber 1.4 The tax number assigned by the government to your client's business. In many countries, invoices must include the client's VAT number. In such cases, the tax number is the VAT number.
client.invoices 2.0

A list with all the invoices of a client. This is useful if you want to create a statement. To access an invoice from the list use the following Freemarker code:

[#list client.invoices as invoice]
...
[/#list]
client.balance 2.0 How much money the client has to pay for all open (unpaid) invoices. Balance is the difference between the total of all invoices and the total of all payments.

2. Contact

client.attention 1.0 self-explained
client.address 1.0 self-explained
client.city 1.0 self-explained
client.state 1.0 self-explained
client.zip 1.0 self-explained
client.country 1.0 self-explained
client.phone 1.0 self-explained
client.fax 1.0 self-explained
client.mobile 2.1 self-explained
client.other 2.1 self-explained
client.email 1.0 self-explained
client.website 1.8 self-explained

4.8.3. Contract

The following table shows the fields that can be used to include information about the contract which is invoiced. Every time an invoice is created, it is associated with a contract. The following placeholders identify the contract from both the client's view and yours.

Table 4.6. Contract Properties

Property Version Meaning
contract.number 1.9 The number you associate with the contract.
contract.reference 1.9, 2.1

The number the client associates with the contract. In most cases, this number is a purchase order number.

Note: contract.reference replaces contract.clientNumber since version 2.1


4.8.4. Invoice

The following table shows the fields that can be used to include information about the actual invoice.

Table 4.7. Invoice Properties

Property Version Meaning
1. General
invoice.number 1.0 self-explained
invoice.notes 2.0 self-explained
invoice.date 1.0 Use ${invoice.date?date} to access the value of the invoice date.
invoice.period 2.3 Indicates the date or period when the invoiced services were provided.
invoice.dueDate 1.5 Use ${invoice.dueDate?date} to access the date when an invoice is due.
invoice.dueDays 1.5 When the invoice must be paid (in days since the invoice date).
invoice.overdue 2.1.2 Indicates whether an invoice is overdue or not.
2. Payments
invoice.ageInDays 2.0 The number of days since an invoice was created until it was paid.
invoice.balance 2.0 How much money the client has to pay. Balance is the difference between the invoice total and payments total.
invoice.paymentsTotal 2.0 self-explained
invoice.payments 2.0

A list with all the payments of an invoice. To access a payment from the list use the following Freemarker code:

[#list invoice.payments as payment]
...
[/#list]
invoice.paid 2.0 Indicates whether an invoice is paid (completely) or not.
invoice.paymentDate 2.0 Use ${invoice.paymentDate?date} to access the value of the date when the invoice was paid completely.

3. Contents

The contents of an invoice may be accessed either by project or directly by referencing its items.

invoice.items 1.4, 2.0

A list with all the items of an invoice. To access an item from the list use the following Freemarker code:

[#list invoice.items as item]
...
[/#list]

Since version 2.0, this placeholder has a new meaning. The list contains all items, including products and expenses. Previously, it contained only services.

Instead of accessing the entire list of items, one can access the services, the products and the expenses separately using the invoice.services, invoice.products and invoice.expenses placeholders.

invoice.services 2.0

A list with all the service items of an invoice. To access a service from the list use the following Freemarker code:

[#list invoice.services as service]
...
[/#list]
invoice.products 2.5

A list with all the product items of an invoice. To access a product from the list use the following Freemarker code:

[#list invoice.products as product]
...
[/#list]
invoice.expenses 1.4

A list with all the expense items of an invoice. To access an expense from the list use the following Freemarker code:

[#list invoice.expenses as expense]
...
[/#list]
invoice.projects 1.0

A list with all the projects whose items or expenses belong to this invoice. The list of projects is useful if you invoice multiple projects.

To access a project from the list use the following Freemarker code:

[#list invoice.projects as project]
...
[/#list]
4. Totals
invoice.servicesSubtotal 2.0 The total amount of money due for all the service items from the invoice.
invoice.productsSubtotal 2.5 The total amount of money due for all the product items from the invoice.
invoice.expensesSubtotal 1.0 The total amount of money due for all the expense items from the invoice.
invoice.profit 1.11 self-explained
invoice.total 1.0 The total amount of money (no taxes included).
invoice.grandTotal 1.4 The total amount of money (all taxes included).
invoice.exchangeRates 2.0

A list with all the exchange rates of an invoice if it uses multiple currencies. To access exchange rates from the list use the following Freemarker code:

[#list invoice.exchangeRates as exchangeRate]
...
${exchangeRate.source}
${exchangeRate.target}
${exchangeRate.rate}
...
[/#list]
5. Taxes
invoice.taxable 1.8

Indicates whether the invoice has taxes or not. If you want to do something when the invoice has taxes:

[#if invoice.taxable]
...
[/#if]

If you want to do something when the invoice doesn't have taxes:

[#if !invoice.taxable]
...
[/#if]
invoice.taxes 1.4

A list with all the taxes of an invoice. To access a tax from the list use the following Freemarker code:

[#list invoice.taxes as tax]
...
[/#list]
invoice.taxTotal(tax) 1.4

This is a function that gives you the total amount for a certain tax.

The most common situation when this function is used is at the end of the invoice to display the total for each tax of the invoice. If the invoice has more than one tax.

invoice.taxesTotal 1.4 The taxes due for the invoice.
6. Discounts
invoice.regularTotal 1.8

If the total of an invoice is discounted, this field indicates the total before the discount. You may want to use this field like this:

[#if item.totalDiscounted]
    ${item.regularTotal}
[/#if]

The regular total is accessed only when the total is discounted.

invoice.rawTotal 1.8

If an invoice has discounts for both its items and its total value, this field represents the value of the invoice without any discount.

It's how much you would make if no discount is applied.

invoice.totalDiscount 1.8 If the total value of an invoice is discounted, this field indicates the discount. It can be used to display the actual discount.
invoice.totalDiscounted 1.8 Indicates if the total of an invoice is discounted. See the item.regularPrice field above.
7. Time
invoice.billableTimeAsHour 1.5 The total invoiced time in hour format. For instance 1 hour and 30 minutes is represented as 1:30.
invoice.billableTimeAsDecimal 1.5 The total invoiced time in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

4.8.5. Item

The following table shows the fields of an item from an invoice. An item cannot be accessed directly. You can either access it from the list of items of an invoice (invoice.items or invoice.services, invoice.products and invoice.expenses) or from the list of items of a project (project.items or project.services, project.products and project.expenses).

Table 4.8. Item Properties

Property Version Meaning

1. General

The general fields are used to describe an item.

item.name 1.0 self-explained
item.description 1.0 self-explained
item.date 2.0 Use ${item.date?date} to access the value of the item date.
item.notes 2.0 self-explained
item.catalogItem 1.0, 2.0, 2.5

self-explained

${item.catalogItem!"-"}

Note: item.catalogItem replaces item.itemCategory (introduced in version 2.0) and item.service (used before version 2.0).

item.service 2.0

Indicates if this item is a service. The following code prints a plus character if the item is a service.

[#if item.service]
    +
[/#if]

To access the list of services of a project see the project.services placeholder. For an invoice, see invoice.services.

item.product 2.5

Indicates if this item is a product. The following code prints a plus character if the item is a product.

[#if item.product]
    +
[/#if]

To access the list of products of a project see the project.products placeholder. For an invoice, see invoice.products.

item.expense 2.0

Indicates if this item is an expense. The following code prints a plus character if the item is an expense.

[#if item.expense]
    +
[/#if]

To access the list of expenses of a project see the project.expenses placeholder. For an invoice, see invoice.expenses.

2. Billing

The billing fields are used to show billing information (price, quantity, total) about the item. If an item is discounted, you may also want to use the fields that show the regular (before any discount is applied) values.

More information about discounts and when they are available is provided in the discount section below.

item.taxExempt 2.0

Indicates whether this item is exempt from taxes or not. The following code prints a plus character if the item is exempt from taxes.

[#if item.taxExempt]
    +
[/#if]

Items can be marked as exempt from taxes only if taxes are enabled for your business.

item.price 1.0, 2.0

The price used to bill the item. If the item is discounted, it indicates the price after the discount.

Note: item.price replaces item.rate which was used up until version 1.11.

item.cost 1.11 How much the item costs. If you subcontract or resell some services, this field represents how much you are paying for the item.
item.quantity 1.0, 2.0

The quantity used to bill the item. If the item is discounted, it indicates the quantity after the discount.

If the item is billed in hours, this field indicates the number of hours in decimal format. Otherwise it indicates the number of units.

Note: item.quantity replaces item.units which was used up until version 1.11.

item.quantityType 2.0

Indicates whether a service item is billed in units or hours. Expense and product items are always billed in units.

[#if item.quantityType.id == 0]
    units
[/#if]

[#if item.quantityType.id == 1]
    hours
[/#if]
item.unitOfMeasure 2.3 self-explained
item.profit 1.11 self-explained
item.total 1.0, 2.0

The amount of money that is charged for the item. If the item is discounted, it indicates the amount after all discounts.

Note: item.total replaces item.amount which was used up until version 1.11.

item.regularPrice 1.8, 2.0

If the price of an item is discounted, this field indicates the price before the discount. You may want to use this field like this:

[#if item.priceDiscounted]
    ${item.regularPrice}
[/#if]

The regular price is accessed only when the price is discounted.

Note: item.regularPrice replaces item.regularRate which was used up until version 1.11.

item.regularQuantity 1.8, 2.0

If the quantity of an item is discounted, this field indicates the quantity before the discount. You may want to use this field like this:

[#if item.quantityDiscounted]
    ${item.regularQuantity}
[/#if]

The regular quantity is accessed only when it is discounted.

Note: item.regularQuantity replaces item.regularUnits which was used up until version 1.11.

item.regularTotal 1.8, 2.0

If an item is discounted, this field indicates the total amount for the item before any discount is applied to it. You may want to use this field like this:

[#if item.discounted]
    ${item.regularTotal}
[/#if]

The regular total is accessed only when it is discounted.

Note: item.regularTotal replaces item.regularAmount which was used up until version 1.11.

3. Discount

The discount fields can be used to determine the discounts for the price or quantity of an item. There are also a few fields that can be used to determine if a discount has been applied to an item or not.

item.priceDiscount 1.8, 2.0

If an item is discounted by price, this field indicates the discount. It can be used to display the actual discount.

Note: item.priceDiscount replaces item.rateDiscount which was used up until version 1.11.

item.quantityDiscount 1.8, 2.0

If an item is discounted by quantity, this field indicates the discount. It can be used to display the actual discount.

Note: item.quantityDiscount replaces item.unitsDiscount which was used up until version 1.11.

item.priceDiscounted 1.8, 2.0

Indicates if the price of an item is discounted. See the item.regularPrice field above.

Note: item.priceDiscounted replaces item.rateDiscounted which was used up until version 1.11.

item.quantityDiscounted 1.8, 2.0

Indicates if the quantity of an item is discounted. See the item.regularQuantity field above.

Note: item.quantityDiscounted replaces item.unitsDiscounted which was used up until version 1.11.

item.discounted 1.8

Indicates if an item is discounted (either by rate or number of units). See the item.regularAmount field above.

4. Time

The time fields can be used to get more detailed information about the time recorded for an item.

item.timeEntries 1.5

A list with all the time entries recorded for a project item. This list is useful if you want to create a very detailed invoice that shows a breakdown for each invoiced item.

To access a time entry from the list use the following Freemarker code:

[#list item.timeEntries as timeEntry]
...
[/#list]
item.elapsedTimeAsHour 1.5 The total time recorded for a project item in hour format. For instance 1 hour and 30 minutes is represented as 1:30.
item.elapsedTimeAsDecimal 1.5 The total time recorded for a project item in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.
item.billableTimeAsHour 1.5

The total billed time for a project item in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

The billed time may be slightly different than the elapsed time because of the time rounding that is applied to hourly-rated items.

item.billableTimeAsDecimal 1.5

The total time recorded for a project item in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

The billed time may be slightly different than the elapsed time because of the time rounding that is applied to hourly-rated items.


4.8.6. Payment

The following table shows the fields of a payment made to an invoice. A payment cannot be accessed directly. You can only access it from the list of payments of an invoice (invoice.payments).

Table 4.9. Payment Properties

Property Version Meaning
payment.date 2.0 self-explained
payment.notes 2.0 self-explained
payment.amount 2.0 self-explained
payment.reference 2.0 self-explained


4.8.7. Tax

The following table shows the fields of a tax from an invoice. A tax cannot be accessed directly. You can only access it from the list of taxes of an invoice (invoice.taxes).

Table 4.10. Tax Properties

Property Version Meaning
tax.name 1.4 self-explained

4.8.8. Project

The following table shows the fields of an invoice project. A project cannot be accessed directly. You have to access it from the list of projects of an invoice (invoice.projects).

Usually, you don't need to work with invoice projects. They are useful only if the invoice is for multiple projects.

Table 4.11. Project Properties

Property Version Meaning

1. General

project.name 1.0 self-explained
project.number 2.6 self-explained
project.reference 2.6 self-explained
project.description 2.5 self-explained
project.notes 1.8 self-explained

2. Contents

An invoice project contains billable items which can be service, product or expense items. The following fields let you access them.

project.items 1.0, 2.0

A list with all the items of an invoice project. To access an item from the list use the following Freemarker code:

[#list project.items as item]
...
[/#list]

Since version 2.0, this placeholder has a new meaning. The list contains all items, including expenses. Previously, it contained only services.

Instead of accessing the entire list of items, one can access the services and the expenses separately using the project.services, project.products and the project.expenses placeholders.

project.services 2.0

A list with all the service items of an invoice project. To access a service from the list use the following Freemarker code:

[#list project.services as service]
...
[/#list]
project.products 2.5

A list with all the product items of an invoice project. To access a product from the list use the following Freemarker code:

[#list project.products as product]
...
[/#list]
project.expenses 1.0

A list with all the expense items of an invoice project. To access an expense from the list use the following Freemarker code:

[#list project.expenses as expense]
...
[/#list]

3. Totals

project.servicesSubtotal 2.0 The total amount of money due for all the service items from this project.
project.productsSubtotal 2.5 The total amount of money due for all the product items from this project.
project.expensesSubtotal 1.0 The total amount of money due for all the expense items from this project.
project.profit 1.11 self-explained
project.total 1.0 The total project amount of money (no taxes included).

4. Time

project.billableTimeAsHour 1.5 The total time invoiced for a project in hour format. For instance 1 hour and 30 minutes is represented as 1:30.
project.billableTimeAsDecimal 1.5 The total time invoiced for a project in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

4.8.9. Time Entry

The following table shows the fields of a time entry. A time entry cannot be accessed directly. You have to access it from the list of time entries of a project item (item.timeEntries).

Usually, you don't need to work with time entries. They are useful only if you need to create a very detailed invoice that breaks down the time spent on each item.

Table 4.12. Time Entry Properties

Property Version Meaning
timeEntry.date 1.5 Use ${timeEntry.date?time} to access the exact time when time has been recorded for the item.
timeEntry.endDate 1.5 Use ${timeEntry.endDate?time} to access the exact time recording has stopped.
timeEntry.description 1.5 self-explained
timeEntry.elapsedTimeAsHour 1.5 The total time recorded in hour format. For instance 1 hour and 30 minutes is represented as 1:30.
timeEntry.elapsedTimeAsDecimal 1.5 The total time recorded in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.
timeEntry.pausedTimeAsHour 1.8 The pause associated with this time entry in hour format. For instance 1 hour and 30 minutes is represented as 1:30.
timeEntry.pausedTimeAsDecimal 1.8 The pause associated with this time entry in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

4.8.10. System

The following table shows the fields and methods that can be used to get information about the system.

Table 4.13. System Properties

Property Version Meaning
currentTime() 2.2

Returns the current system time as a date object. It can be formatted using the ?date and ?time built-ins. See this section for more details on built-ins.

Use ${currentTime()?date} to display the system date or ${currentTime()?time} to display the system time.