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.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).

2. Contents

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

invoice.items 1.4

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>
invoice.expenses 1.4

A list with all the expenses 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>
3. Totals
invoice.itemsSubtotal 1.0 The total amount of money due for all the items from the invoice.
invoice.expensesSubtotal 1.0 The total amount of money due for all the expenses 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).
4. 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 == true>
...
</#if>

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

<#if invoice.taxable == false>
...
</#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.
5. 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 == true>
    ${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.regularRate field above.
6. 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.