6.4. Invoice

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

Table 6.4. 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.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 and expenses.

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 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 invoice.services and the 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.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.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.