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

5.8.1. Business

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

Table 5.4. Business Properties

Property Version

1. General

business.name

self-explained

1.0

business.code

A short code that identifies your business.

2.3

business.businessNumber

The number assigned to your business when it was created.

2.3

business.otherNumber

A number that could be used as the trade register number.

2.3

business.taxNumber

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.

1.4

2. Taxes

business.taxLiable

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]
1.5

3. Contact

business.attention

self-explained

1.0

business.address

self-explained

1.0

business.city

self-explained

1.0

business.state

self-explained

1.0

business.zip

self-explained

1.0

business.country

self-explained

1.0

business.phone

self-explained

1.0

business.fax

self-explained

1.0

business.mobile

self-explained

2.1

business.other

self-explained

2.1

business.email

self-explained

1.0

business.website

self-explained

1.8

5.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 5.5. Client Properties

Property Version

1. General

client.name

The client name that is visible in the application.

1.0

client.code

The client code is especially useful if you want to number invoices automatically and to include the client code in the invoice number.

1.5

client.notes

self-explained

3.4

client.legalName

The legal name that can be displayed on invoices.

3.3

client.businessNumber

The number assigned to the business when it was created.

2.3

client.otherNumber

A number that could be used as the trade register number.

2.3

client.taxNumber

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.

1.4

client.taxExempt

Whether taxes are applied to invoices created for the client.

3.4

client.invoices

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]
2.0

client.balance

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

client.deposits

A list with all the deposits of a client. To access a deposit from the list use the following FreeMarker code:

[#list client.deposits as deposit]
...
[/#list]
3.1

client.depositsBalance

How much money the client has in its deposits account. The balance increases with each new deposit and decreases with each withdrawal.

3.1

2. Contact

client.attention

self-explained

1.0

client.address

self-explained

1.0

client.city

self-explained

1.0

client.state

self-explained

1.0

client.zip

self-explained

1.0

client.country

self-explained

1.0

client.phone

self-explained

1.0

client.fax

self-explained

1.0

client.mobile

self-explained

2.1

client.other

self-explained

2.1

client.email

self-explained

1.0

client.website

self-explained

1.8

5.8.3. Invoice

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

Table 5.6. Invoice Properties

Property Version

1. General

invoice.number

self-explained

1.0

invoice.reference

A reference number like the purchase order number.

Note: This field was known as contract.reference before version 3.1 and as contract.clientNumber before version 2.1

1.9, 2.1, 3.1

invoice.notes

self-explained

2.0

invoice.date

Use ${invoice.date?date} to access the value of the invoice date.

1.0

invoice.period

Indicates the date or period when the invoiced services were provided.

2.3

invoice.dueDate

Use ${invoice.dueDate?date} to access the date when an invoice is due.

1.5

invoice.dueDays

When the invoice must be paid (in days since the invoice date).

1.5

invoice.overdue

Indicates whether an invoice is overdue or not.

2.1.2

2. Payments

invoice.ageInDays

The number of days since an invoice was created until it was paid.

2.0

invoice.balance

How much money the client has to pay. Balance is the difference between the invoice total and payments total.

2.0

invoice.paymentsTotal

self-explained

2.0

invoice.payments

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]
2.0

invoice.paid

Indicates whether an invoice is paid (completely) or not.

2.0

invoice.paymentDate

Use ${invoice.paymentDate?date} to access the value of the date when the invoice was paid completely.

2.0

3. Contents

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

invoice.items

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 service items, the mileage items, the expense items and the product items separately using the invoice.serviceItems, invoice.expenseItems, invoice.mileageItems and invoice.productItems placeholders.

1.4, 2.0

invoice.regularItems

A list with all the regular (non-project) items of an invoice. If you don't invoice projects then ${invoice.regularItems} is the same as ${invoice.items}. To access an item from this list use the following FreeMarker code:

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

Note: invoice.regularItems replaces invoice.nonProjectItems which was used in version 3.0.

3.0, 3.1

invoice.serviceItems

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

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

Note: invoice.serviceItems replaces invoice.services which was used up until version 2.6.

2.0, 2.7

invoice.expenseItems

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

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

Note: invoice.expenseItems replaces invoice.expenses which was used up until version 2.6.

1.4, 2.7

invoice.mileageItems

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

[#list invoice.mileageItems as item]
...
[/#list]
3.0

invoice.productItems

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

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

Note: invoice.productItems replaces invoice.products which was used up until version 2.6.

2.5, 2.7

invoice.projects

A list with all the projects whose items 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]
1.0

4. Totals

invoice.serviceItemsSubtotal

The total amount of money due for all the service items from the invoice.

Note: invoice.serviceItemsSubtotal replaces invoice.servicesSubtotal which was used up until version 2.6.

2.0, 2.7

invoice.expenseItemsSubtotal

The total amount of money due for all the expense items from the invoice.

Note: invoice.expenseItemsSubtotal replaces invoice.expensesSubtotal which was used up until version 2.6.

1.0, 2.7

invoice.mileageItemsSubtotal

The total amount of money due for all the mileage items from the invoice.

3.0

invoice.productItemsSubtotal

The total amount of money due for all the product items from the invoice.

Note: invoice.productItemsSubtotal replaces invoice.productsSubtotal which was used up until version 2.6.

2.5, 2.7

invoice.regularItemsSubtotal

The total amount of money due for all the regular items from the invoice.

3.4

invoice.total

The total amount of money (no taxes included).

1.0

invoice.grandTotal

The total amount of money (all taxes included).

1.4

invoice.profit

The invoice profit is calculated as the difference between the invoice total and the total amount of all invoice expenses.

3.1

invoice.exchangeRates

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]
2.0

5. Taxes

invoice.taxable

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]
1.8

invoice.taxes

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]
1.4

invoice.getTaxTotal(tax)

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.

Note: invoice.getTaxTotal replaces invoice.taxTotal which was used up until version 3.2.

1.4, 3.3

invoice.taxesTotal

The taxes due for the invoice.

1.4

6. Discounts

invoice.regularTotal

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.

1.8

invoice.rawTotal

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.

1.8

invoice.totalDiscount

If the total value of an invoice is discounted, this field indicates the discount. It can be used to display the actual discount.

1.8

invoice.totalDiscounted

Indicates if the total of an invoice is discounted. See the item.regularPrice field above.
1.8

7. Time

invoice.billableTimeAsHour

The total invoiced time in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

Note: invoice.billedTimeAsHour was used instead of invoice.billableTimeAsHour in versions 3.1 and 3.2.

1.5, 3.1, 3.3

invoice.billableTimeAsDecimal

The total invoiced time in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

Note: invoice.billedTimeAsDecimal was used instead of invoice.billableTimeAsDecimal in versions 3.1 and 3.2.

1.5, 3.1, 3.3

8. Time Reporting

The following placeholders are useful if you need to create invoice templates that group time entries by date.

These placeholders are used by the invoice template editor (File » Template Editor) if time is displayed and time entris are grouped by date. It uses ${invoice.groupDatesByDate(item.timeEntries)} to determine the dates when time was recorded for a service item.

invoice.timeEntries

A list with all the time entries that belong to the service items of an invoice.

This list is useful if you want to determine the dates when the invoiced time was recorded (see invoice.groupDatesByDate).

If you need to access the date of the first and last time entry, you can use the following expressions:

  • ${invoice.timeEntries?sort_by("date")?first.date?date} for the first date

  • ${invoice.timeEntries?sort_by("date")?last.date?date} for the last date

3.1

invoice.groupDatesByDate(timeEntries)

A list with the dates when the specified time entries were recorded.

[#list invoice.groupDatesByDate(invoice.timeEntries)?sort as date]
...
[/#list]

Use ${date?date.iso} to print each date.

3.1

invoice.groupDatesByWeek(timeEntries)

A list with the weeks when the specified time entries were recorded.

[#list invoice.groupDatesByWeek(invoice.timeEntries)?sort as week]
...
[/#list]

Use ${week} to print each week. Use ${interval(week)?first?date} and ${interval(week)?last?date} to access the first and last date of the week.

3.4

invoice.groupDatesByMonth(timeEntries)

A list with the months when the specified time entries were recorded.

[#list invoice.groupDatesByMonth(invoice.timeEntries)?sort as month]
...
[/#list]

Use ${month?date("yyyy-MM")?string("MMM yyyy")} to print each month.

3.4

invoice.groupDatesByYear(timeEntries)

A list with the years when the specified time entries were recorded.

[#list invoice.groupDatesByYear(invoice.timeEntries)?sort as year]
...
[/#list]

Use ${year} to print each year.

3.4

invoice.filterByDate(timeEntries, period)

Finds the subset of the specified time entries that were recorded in the specified period. (their Date field belongs to the interval)

3.1

invoice.calculateBillableTimeAsHour(timeEntries)

The total billable time in hour format for the specified list of time entries.

Note: invoice.calculateRoundedElapsedTimeAsHour was used instead of invoice.calculateBillableTimeAsHour in versions 3.1 and 3.2.

3.1, 3.3

invoice.calculateBillableTimeAsDecimal(timeEntries)

The total billable time in decimal format for the specified list of time entries.

Note: invoice.calculateRoundedElapsedTimeAsDecimal was used instead of invoice.calculateBillableTimeAsDecimal in versions 3.1 and 3.2.

3.1, 3.3

invoice.calculateElapsedTimeAsHour(timeEntries)

The total elapsed time in hour format for the specified list of time entries.

3.1

invoice.calculateElapsedTimeAsDecimal(timeEntries)

The total elapsed time in decimal format for the specified list of time entries.

3.1

5.8.4. 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.serviceItems, invoice.productItems and invoice.expenseItems) or from the list of items of an invoice project (project.items or project.serviceItems, project.productItems and project.expenseItems).

Table 5.7. Item Properties

Property Version

1. General

The general fields are used to describe an item.

item.name

self-explained

1.0

item.description

self-explained

1.0

item.date

This placeholder is deprecated starting with version 3.0. Items don't actually have a date field.

  • for service items

    • with at least one time entry, the date represents the date of the oldest time entry

    • with no time entries, the date represents the start date of the task

  • for expense items the date represents the date when the expense was made

  • for mileage items the date represents the invoice date

  • for product items the date represents the date when the product was made

Use ${item.date?date} to access the value of the item date.

2.0, 3.0

item.catalogItem

self-explained

${item.catalogItem!"-"}

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

1.0, 2.0, 2.5

item.regularItem

Indicates whether this item is a regular item or not. All items that are added directly to an invoice (i.e. they don't invoice a project) are regular items. The following code prints a plus character if the item is a regular item.

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

To access the regular items of an invoice, see the invoice.regularItems placeholder.

3.1

item.serviceItem

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

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

To access the list of service item of an invoice project see the project.serviceItems placeholder. For an invoice, see invoice.serviceItems.

Note: item.serviceItem replaces item.service (used before version 2.7).

2.0, 2.7

item.expenseItem

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

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

To access the list of expense items of a project see the project.expenseItems placeholder. For an invoice, see invoice.expenseItems.

Note: item.expenseItem replaces item.expense (used before version 2.7).

2.0, 2.7

item.mileageItem

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

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

To access the list of mileage items of a project see the project.mileageItems placeholder. For an invoice, see invoice.mileageItems.

3.0

item.productItem

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

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

To access the list of product items of a project see the project.productItems placeholder. For an invoice, see invoice.productItems.

Note: item.productItem replaces item.product (used before version 2.7).

2.5, 2.7

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

Indicates whether this item is taxable or not. The following code prints a plus character if the item is non-taxable.

[#if !item.taxable]
    +
[/#if]

Note: item.taxable replaces item.taxExempt which was used up until version 3.3.

2.0, 3.3

item.price

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.

1.0, 2.0

item.quantity

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.

1.0, 2.0

item.quantityType

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]
2.0

item.unitOfMeasure

self-explained

2.3

item.total

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.

1.0, 2.0

item.regularPrice

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.

1.8, 2.0

item.regularQuantity

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.

1.8, 2.0

item.regularTotal

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.

1.8, 2.0

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

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.

1.8, 2.0

item.quantityDiscount

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.

1.8, 2.0

item.priceDiscounted

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.

1.8, 2.0

item.quantityDiscounted

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.

1.8, 2.0

item.discounted

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

1.8

4. Time

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

item.timeEntries

A list with all the time entries recorded for a service 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]
1.5

item.elapsedTimeAsHour

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

1.5

item.elapsedTimeAsDecimal

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

1.5

item.billableTimeAsHour

The total billable time of a service item in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

Note: item.billedTimeAsHour was used instead of item.billableTimeAsHour in versions 3.1 and 3.2.

1.5, 3.1, 3.3

item.billableTimeAsDecimal

The total billable time of a service item in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

Note: item.billedTimeAsDecimal was used instead of item.billableTimeAsDecimal in versions 3.1 and 3.2.

1.5, 3.1, 3.3

5. Trips

The trip fields can be used to get more detailed information about the trips recorded for a mileage item.

item.trips

A list with all the trips recorded for a mileage 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 trip from the list use the following FreeMarker code:

[#list item.trips as trip]
...
[/#list]
3.0

5.8.5. 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 5.8. Payment Properties

Property Version

payment.date

self-explained

2.0

payment.notes

self-explained

2.0

payment.amount

self-explained

2.0

payment.reference

self-explained

2.0


5.8.6. Deposit

The following table shows the fields of a deposit transaction. A deposit cannot be accessed directly. You can only access it from the list of deposits of a client (client.deposits).

Table 5.9. Deposit Properties

Property Version

deposit.date

self-explained

3.1

deposit.notes

self-explained

3.1

deposit.amount

The amount deposited in or withdrawn from the deposits account. Positive amounts are deposited while negative amounts are withdrawn.

3.1

deposit.reference

self-explained

3.1

deposit.invoiceDeposit

Indicates whether this deposit was used to pay an invoice. The following code prints the number of the invoice paid by this deposit.

[#if deposit.invoiceDeposit]
    ${deposit.invoiceNumber}
[/#if]

To access the list of deposits of a client see the client.deposits placeholder.

3.1

deposit.invoiceNumber

See deposit.invoiceDeposit .

3.1


5.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 5.10. Tax Properties

Property Version

tax.name

self-explained

1.4

5.8.8. Invoice 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 5.11. Project Properties

Property Version

1. General

project.name

self-explained

1.0

project.number

self-explained

2.6

project.reference

self-explained

2.6

project.description

self-explained

2.5

project.notes

self-explained

1.8

project.location

self-explained

3.3

project.startDate

self-explained

3.3

project.dueDate

self-explained

3.3

project.finishedDate

self-explained

3.3

2. Contents

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

project.items

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 expense items. 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.serviceItems, project.productItems and the project.expenseItems placeholders.

1.0, 2.0

project.serviceItems

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

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

Note: project.serviceItems replaces project.services which was used up until version 2.6.

2.0, 2.7

project.expenseItems

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

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

Note: project.expenseItems replaces project.expenses which was used up until version 2.6.

1.0, 2.7

project.mileageItems

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

[#list project.mileageItems as item]
...
[/#list]
3.0

project.productItems

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

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

Note: project.productItems replaces project.products which was used up until version 2.6.

2.5, 2.7

3. Totals

project.serviceItemsSubtotal

The total amount of money due for all the service items from this project.

Note: project.serviceItemsSubtotal replaces project.servicesSubtotal which was used up until version 2.6.

2.0, 2.7

project.expenseItemsSubtotal

The total amount of money due for all the expense items from this project.

Note: project.expenseItemsSubtotal replaces project.expensesSubtotal which was used up until version 2.6.

1.0, 2.7

project.mileageItemsSubtotal

The total amount of money due for all the mileage items from this project.

3.0

project.productItemsSubtotal

The total amount of money due for all the product items from this project.

Note: project.productItemsSubtotal replaces project.productsSubtotal which was used up until version 2.6.

2.5, 2.7

project.total

The total project amount of money (no taxes included).

1.0

4. Time

project.billableTimeAsHour

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

Note: project.billedTimeAsHour was used instead of project.billableTimeAsHour in versions 3.1 and 3.2.

1.5, 3.1, 3.3

project.billableTimeAsDecimal

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

Note: project.billedTimeAsDecimal was used instead of project.billableTimeAsDecimal in versions 3.1 and 3.2.

1.5, 3.1, 3.3

5.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 5.12. Time Entry Properties

Property Version

timeEntry.date

Use ${timeEntry.date?time} to access the exact time when time has been recorded for the item.

1.5

timeEntry.endDate

Use ${timeEntry.endDate?time} to access the exact time recording has stopped.

1.5

timeEntry.description

self-explained

1.5

timeEntry.elapsedTimeAsHour

The total recorded time in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

1.5

timeEntry.elapsedTimeAsDecimal

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

1.5

timeEntry.pausedTimeAsHour

The pause associated with this time entry in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

1.8

timeEntry.pausedTimeAsDecimal

The pause associated with this time entry in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

1.8

timeEntry.billableTimeAsHour

The total billable time in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

Note: timeEntry.billableTimeAsHour replaces timeEntry.roundedElapsedTimeAsHour which was used up until version 3.2.

3.1, 3.3

timeEntry.billableTimeAsDecimal

The total billable time recorded in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

Note: timeEntry.billableTimeAsDecimal replaces timeEntry.roundedElapsedTimeAsDecimal which was used up until version 3.2.

3.1, 3.3

timeEntry.units

self-explained

Here's how to use it in order to display the number of units as an integer:

${timeEntry.units?string.number}
3.3

timeEntry.unitsPerHour

self-explained

The calculated value can be null if the time is zero (00:00:00). The following example shows the best way to use this placeholder:

${timeEntry.unitsPerHour!"N/A"}
3.3

timeEntry.timePerUnitAsHour

self-explained

The calculated value can be null if the number of units is zero. The following example shows the best way to use this placeholder:

${timeEntry.timePerUnitAsHour!"N/A"}
3.3

timeEntry.total

The total value of a time entry. Billable time entries recorded on tasks billed in hours have a non-zero value while non-billable time entries or time entries recorded on tasks billed in units have a zero value.

3.3

5.8.10. Task

The following table shows the fields of a task. A task cannot be accessed directly. You have to access it from a project service item (item.task).

Usually, you don't need to work with tasks. They are useful only if you need to create a very detailed invoice that includes details not available in a service item (eg the task reference number).

Table 5.13. Task Properties

Property Version

1. General

task.name

self-explained

3.0

task.reference

self-explained

3.0

task.category

self-explained

3.0

task.description

self-explained

3.0

task.notes

self-explained

3.0

task.tags

self-explained

3.0

2. Planning

task.startDate

self-explained

3.0

task.dueDate

self-explained

3.0

task.completedDate

self-explained

3.0

task.completed

Indicates whether the task is completed or not. If you want to do something when the task is completed:

[#if task.completed]
...
[/#if]

If you want to do something when the task isn't completed:

[#if !task.completed]
...
[/#if]
3.0

task.overdue

Indicates whether the task is overdue or not. If you want to do something when the task is overdue:

[#if task.overdue]
...
[/#if]

If you want to do something when the task isn't overdue:

[#if !task.overdue]
...
[/#if]
3.0

3. Time tracking

task.timeEntries

A list with all the time entries of a task. To access a time entry from the list use the following FreeMarker code:

[#list task.timeEntries as timeEntry]
...
[/#list]
3.0

task.elapsedTimeAsHour

The total time recorded in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

3.0

task.estimatedTimeAsHour

The total estimated time in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

3.0

task.remainingTimeAsHour

The total remaining time in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

3.0

5.8.11. Expense

The following table shows the fields of an expense. An expense cannot be accessed directly. You have to access it from a project expense item (item.expense).

Usually, you don't need to work with expenses. They are useful only if you need to create a very detailed invoice that includes details not available in an expense item (eg the expense reference number).

Table 5.14. Expense Properties

Property Version

expense.reference

self-explained

3.0

expense.category

self-explained

3.0

expense.description

self-explained

3.0

expense.notes

self-explained

3.0

expense.date

self-explained

3.0

expense.amount

self-explained

3.0

expense.taxAmountsBag

3.3

5.8.12. Trip

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

Usually, you don't need to work with trips. They are useful only if you need to create a very detailed invoice that shows all the trips of each mileage item.

Table 5.15. Trip Properties

Property Version

trip.startTime

Use ${trip.startTime?time} to access the time when the trip started.

If you are only interested in the date, use ${trip.startTime?date}.

3.0

trip.endTime

Use ${trip.endTime?time} to access the time when the trip ended.

3.0

trip.durationAsHour

The duration of the trip in hour format. For instance 1 hour and 30 minutes is represented as 1:30.

3.0

trip.durationAsDecimal

The duration of the trip in decimal format. For instance 1 hour and 30 minutes is represented as 1.50.

3.0

trip.distance

The distance recorded by the trip. ${trip.distance} represents distance as value followed by unit (eg 30 km).

If you need to access each field separately then you should use ${trip.distance.value} and ${trip.distance.unit}.

3.0

trip.startLocation

self-explained

3.0

trip.endLocation

self-explained

3.0

trip.description

self-explained

3.0

trip.tags

self-explained

3.0

5.8.13. Projects Report

The following table shows the placeholders that can be used to create projects reports. Besides these placeholders you can also use business placeholders to print information about your business in a projects report.

Table 5.16. Projects Report Properties

Property Version

1. Parameters

The date interval used to build the report can be accessed from the template.

Each interval may or may not have a start date and an end date. If a date interval is defined only by its start date then the end date will not be defined and projectsreport.dateIntervalEnd?? will return false. The folowing code can be used to cover all situations, whether these fields are defined or not.

	[#if projectsreport.dateIntervalStart??]
		[#if projectsreport.dateIntervalEnd??]
	${projectsreport.dateIntervalStart?date} - ${projectsreport.dateIntervalEnd?date}
		[#else]
	After ${projectsreport.dateIntervalStart?date}
		[/#if]
	[#else]
		[#if projectsreport.dateIntervalEnd??]
	Before ${projectsreport.dateIntervalEnd?date}
		[#else]
	All dates
		[/#if]
	[/#if]

projectsreport.dateIntervalStart

self-explained

3.1

projectsreport.dateIntervalEnd

self-explained

3.1

2. Projects

The report allows you to obtain a list with all its projects and project elements (tasks, expenses, trips and products).

projectsreport.projects

A list with all the projects included in the report. This is probably most important placeholder because almost all reports need to use it.

3.1

projectsreport.getTimeEntries(task)

A list with all the time entries of a task that belong to the reporting period.

3.1

projectsreport.getTasks(project)

A list with all the tasks of a project that belong to the reporting period.

3.1

projectsreport.getTrips(project)

A list with all the trips of a project that belong to the reporting period.

3.1

projectsreport.getExpenses(project)

A list with all the expenses of a project that belong to the reporting period.

3.1

projectsreport.getProducts(project)

A list with all the products of a project that belong to the reporting period.

3.1

projectsreport.filterWithActivity(projects)

Finds the subset of the specified projects that have elements (tasks, time, expenses, trips or products) in the reporting period.

This filter is useful if you don't want to deal with projects that were active during the reporting period but nothing was recorded on them.

3.1

projectsreport.filterByClient(projects, client)

Finds the subset of the specified projects that belong to the specified client.

3.1

3. Grouping

Fields like clients can be extracted as separate groups from a list of projects.

projectsreport.groupClients(projects)

A list with all the clients.

[#list projectssreport.groupClients(projectsreport.projects)?sort as client]
...
[/#list]
3.1

4. Totals

The report can calculate totals for a list of projects. The list of projects can either be projectsreport.projects (all the projects included in the report) or a partial list determined by one of the filter functions.

projectsreport.calculateTaskTotal(task)

The total for the specified task.

3.1

projectsreport.calculateElapsedTimeAsHour(task)

The total elapsed time in hour format for the specified task.

3.1

projectsreport.calculateElapsedTimeAsHour(project)

The total elapsed time in hour format for the specified project.

3.1

projectsreport.calculateElapsedTimeAsHour(projects)

The total elapsed time in hour format for the specified list of projects.

3.1

projectsreport.calculateBillableTimeAsDecimal(task)

The total billable time in decimal format for the specified task.

3.3

projectsreport.calculateBillableTimeAsDecimal(project)

The total billable time in decimal format for the specified project.

3.3

projectsreport.calculateBillableTimeAsDecimal(projects)

The total billable time in decimal format for the specified list of projects.

3.3

projectsreport.calculateExpensesAmount(project)

The total expenses amount for the specified project.

3.1

projectsreport.calculateExpensesAmount(projects)

The total expenses amount for the specified list of projects.

3.1

projectsreport.calculateTripsDistance(project)

The total distance for the specified project.

3.1

projectsreport.calculateTripsDistance(projects)

The total distance for the specified list of projects.

3.1

projectsreport.calculateTotal(project)

The total for the specified project.

3.1

projectsreport.calculateTotal(projects)

The total for the specified list of projects.

3.1

projectsreport.calculateTasksTotal(project)

The tasks subtotal for the specified project.

3.1

projectsreport.calculateExpensesTotal(project)

The expenses subtotal for the specified project.

3.1

projectsreport.calculateTripsTotal(project)

The trips subtotal for the specified project.

3.1

projectsreport.calculateProductsTotal(project)

The products subtotal for the specified project.

3.1

5.8.14. Time Report

The following table shows the placeholders that can be used to create time reports. Besides these placeholders you can also use business placeholders to print information about your business in a time report.

Here's an example that shows how to calculate totals by date. It groups time entries by date and then it calculates the total elapsed time for each date.

[!-- Determine the dates when time was recorded. --]
[#assign dates=timereport.groupDatesByDate(timereport.timeEntries)]

[#list dates?sort as date]

  [!-- Use timereport.filterByDate to find time entries recorded on a specific date. --]
  [#assign dateTimeEntries=timereport.filterByDate(timereport.timeEntries, date)]

  [!-- Print the date and the total elapsed time for this date. --]
  ${date?date.iso}: ${timereport.calculateElapsedTimeAsHour(dateTimeEntries)}

[/#list]

[!-- Calculate the total elapsed time for all the time entries included in the report --]
Total: ${timereport.calculateElapsedTimeAsHour(timereport.timeEntries)}

Table 5.17. Time Report Properties

Property Version

1. Parameters

The date interval used to build the report can be accessed from the template.

Each interval may or may not have a start date and an end date. If a date interval is defined only by its start date then the end date will not be defined and timereport.dateIntervalEnd?? will return false. The folowing code can be used to cover all situations, whether these fields are defined or not.

	[#if timereport.dateIntervalStart??]
		[#if timereport.dateIntervalEnd??]
	${timereport.dateIntervalStart?date} - ${timereport.dateIntervalEnd?date}
		[#else]
	After ${timereport.dateIntervalStart?date}
		[/#if]
	[#else]
		[#if timereport.dateIntervalEnd??]
	Before ${timereport.dateIntervalEnd?date}
		[#else]
	All dates
		[/#if]
	[/#if]

timereport.dateIntervalStart

self-explained

3.0

timereport.dateIntervalEnd

self-explained

3.0

2. Time entries

The report allows you to obtain a list with all its time entries or partial lists (for instance time entries that were recorded in a certain month).

timereport.timeEntries

A list with all the time entries included in the report. This is probably most important placeholder because almost all reports need to use it.

3.0

timereport.filterByDate(timeEntries, period)

Finds the subset of the specified time entries that were recorded in the specified period (date, week, month or year). (their Date field belongs to the interval)

3.0

timereport.filterByTask(timeEntries, task)

Finds the subset of the specified time entries that belong to the specified task.

3.0

timereport.filterByTaskCategory(timeEntries, taskCategory)

Finds the subset of the specified time entries recorded on tasks that have the specified task category.

3.2

timereport.filterByTaskCategoryNone(timeEntries)

Finds the subset of the specified time entries recorded on tasks that don't have a task category.

3.2

timereport.filterByProject(timeEntries, project)

Finds the subset of the specified time entries that belong to the specified project.

3.0

timereport.filterByClient(timeEntries, client)

Finds the subset of the specified time entries that belong to the specified client.

3.0

3. Grouping

Fields like clients or dates can be extracted as separate groups from a list of time entries.

timereport.groupClients(timeEntries)

A list with all the clients.

[#list timereport.groupClients(timereport.timeEntries)?sort as client]
...
[/#list]
3.0

timereport.groupProjects(timeEntries)

A list with all the projects.

[#list timereport.groupProjects(timereport.timeEntries)?sort as project]
...
[/#list]
3.0

timereport.groupTasks(timeEntries)

A list with all the tasks.

[#list timereport.groupTasks(timereport.timeEntries)?sort as task]
...
[/#list]
3.0

timereport.groupTaskCategories(timeEntries)

A list with all the task categories.

[#list timereport.groupTaskCategories(timereport.timeEntries)?sort as category]
...
[/#list]
3.2

timereport.groupDatesByDate(timeEntries)

A list with the dates when the time entries included in the report were recorded.

[#list timereport.groupDatesByDate(timereport.timeEntries)?sort as date]
...
[/#list]

Use ${date?date.iso} to print each date.

3.0

timereport.groupDatesByWeek(timeEntries)

A list with the weeks when the time entries included in the report were recorded.

[#list timereport.groupDatesByWeek(timereport.timeEntries)?sort as week]
...
[/#list]

Use ${week} to print each week. Use ${interval(week)?first?date} and ${interval(week)?last?date} to access the first and last date of the week.

3.0

timereport.groupDatesByMonth(timeEntries)

A list with the months when the time entries included in the report were recorded.

[#list timereport.groupDatesByMonth(timereport.timeEntries)?sort as month]
...
[/#list]

Use ${month?date("yyyy-MM")?string("MMM yyyy")} to print each month.

3.0

timereport.groupDatesByYear(timeEntries)

A list with the years when the time entries included in the report were recorded.

[#list timereport.groupDatesByYear(timereport.timeEntries)?sort as year]
...
[/#list]

Use ${year} to print each year.

3.0

4. Totals

The report can calculate totals for a list of time entries. The list of time entries can either be timereport.timeEntries (all the time entries included in the report) or a partial list determined by one of the filter functions.

timereport.calculateElapsedTimeAsHour(timeEntries)

The total elapsed time in hour format for the specified list of time entries.

3.0

timereport.calculatePausedTimeAsHour(timeEntries)

The total pause time in hour format for the specified list of time entries.

3.0

timereport.calculateBillableTimeAsHour(timeEntries)

The total billable time in hour format for the specified list of time entries.

Note: timereport.calculateBillableTimeAsHour replaces timereport.calculateRoundedElapsedTimeAsHour which was used up until version 3.3.

3.1, 3.3

timereport.calculateUnits(timeEntries)

The total units for the specified list of time entries.

3.3

timereport.calculateUnitsPerHour(timeEntries)

The total units per hour for the specified list of time entries.

The calculated value can be null if the total time is zero (00:00:00). The following example shows the best way to use this placeholder:

${timereport.calculateUnitsPerHour(timereport.timeEntries)!"N/A"}
3.3

timereport.calculateTimePerUnitAsHour(timeEntries)

The time per unit for the specified list of time entries.

The calculated value can be null if the number of units is zero. The following example shows the best way to use this placeholder:

${timereport.calculateTimePerUnitAsHour(timereport.timeEntries)!"N/A"}
3.3

timereport.calculateElapsedTimeAsDecimal(timeEntries)

The total elapsed time in decimal format for the specified list of time entries.

3.0

timereport.calculatePausedTimeAsDecimal(timeEntries)

The total pause time in decimal format for the specified list of time entries.

3.0

timereport.calculateBillableTimeAsDecimal(timeEntries)

The total billable time in decimal format for the specified list of time entries.

Note: timereport.calculateBillableTimeAsDecimal replaces timereport.calculateRoundedElapsedTimeAsDecimal which was used up until version 3.3.

3.1, 3.3

timereport.calculateTotal(timeEntries)

The total value for the specified list of time entries.

3.3

5.8.15. Tasks Report

The following table shows the placeholders that can be used to create tasks reports. Besides these placeholders you can also use business placeholders to print information about your business in a tasks report.

Table 5.18. Tasks Report Properties

Property Version

1. Parameters

The date interval used to build the report can be accessed from the template.

Each interval may or may not have a start date and an end date. If a date interval is defined only by its start date then the end date will not be defined and tasksreport.dateIntervalEnd?? will return false. The folowing code can be used to cover all situations, whether these fields are defined or not.

	[#if tasksreport.dateIntervalStart??]
		[#if tasksreport.dateIntervalEnd??]
	${tasksreport.dateIntervalStart?date} - ${tasksreport.dateIntervalEnd?date}
		[#else]
	After ${tasksreport.dateIntervalStart?date}
		[/#if]
	[#else]
		[#if tasksreport.dateIntervalEnd??]
	Before ${tasksreport.dateIntervalEnd?date}
		[#else]
	All dates
		[/#if]
	[/#if]

tasksreport.dateIntervalStart

self-explained

3.0

tasksreport.dateIntervalEnd

self-explained

3.0

2. Tasks

The report allows you to obtain a list with all its tasks or partial lists (for instance tasks that were recorded for a certain project).

tasksreport.tasks

A list with all the tasks included in the report. This is probably most important placeholder because almost all reports need to use it.

3.0

tasksreport.getTimeEntries(task)

A list with all the time entries of task that belong to the reporting period.

3.0

tasksreport.filterWithTimeOrMoney(tasks)

Finds the subset of the specified tasks that have time or money in the reporting period.

This filter is useful if you don't want to deal with tasks that were active during the reporting period but nothing was recorded on them.

3.0

tasksreport.filterByProject(tasks, project)

Finds the subset of the specified tasks that belong to the specified project.

3.0

tasksreport.filterByClient(tasks, client)

Finds the subset of the specified tasks that belong to the specified client.

3.0

3. Grouping

Fields like clients or projects can be extracted as separate groups from a list of tasks.

tasksreport.groupClients(tasks)

A list with all the clients.

[#list tasksreport.groupClients(tasksreport.tasks)?sort as client]
...
[/#list]
3.0

tasksreport.groupProjects(tasks)

A list with all the projects.

[#list tasksreport.groupProjects(tasksreport.tasks)?sort as project]
...
[/#list]
3.0

4. Totals

The report can calculate totals for a list of tasks. The list of tasks can either be tasksreport.tasks (all the tasks included in the report) or a partial list determined by one of the filter functions.

tasksreport.calculateEstimatedTimeAsHour(tasks)

The total estimated time in hour format for the specified list of tasks.

3.1

tasksreport.calculateEstimatedTimeAsDecimal(tasks)

The total estimated time in decimal format for the specified list of tasks.

3.2

tasksreport.calculateRemainingTimeAsHour(tasks)

The total remaining time in hour format for the specified list of tasks.

3.1

tasksreport.calculateRemainingTimeAsDecimal(tasks)

The total remaining time in decimal format for the specified list of tasks.

3.2

tasksreport.calculateElapsedTimeAsHour(task)

The total elapsed time in hour format for the specified task.

3.0

tasksreport.calculateElapsedTimeAsHour(tasks)

The total elapsed time in hour format for the specified list of tasks.

3.0

tasksreport.calculateElapsedTimeAsDecimal(tasks)

The total elapsed time in decimal format for the specified list of tasks.

3.2

tasksreport.calculateBillableTimeAsDecimal(task)

The total billable time in decimal format for the specified task.

3.3

tasksreport.calculateBillableTimeAsDecimal(tasks)

The total billable time in decimal format for the specified list of tasks.

3.3

tasksreport.calculateUninvoicedTotal(task)

The uninvoiced total for the specified task.

How much money could be invoiced for the task in the reporting period.

Note: tasksreport.calculateUninvoicedTotal replaces tasksreport.calculateBillableTotal which was used up until version 3.3.

3.0, 3.3

tasksreport.calculateUninvoicedTotal(tasks)

The uninvoiced total for the specified list of tasks.

How much money could be invoiced for the list of tasks in the reporting period.

Note: tasksreport.calculateUninvoicedTotal replaces tasksreport.calculateBillableTotal which was used up until version 3.3.

3.0, 3.3

tasksreport.calculateInvoicedTotal(task)

The invoiced total for the specified task.

How much money was invoiced for the task in the reporting period.

For instance, if a task started on January 1st and it was invoiced on February 10th for the whole month of January for $100 then the invoiced total for January will be $100.

Note: tasksreport.calculateInvoicedTotal replaces tasksreport.calculateBilledTotal which was used up until version 3.3.

3.0, 3.3

tasksreport.calculateInvoicedTotal(tasks)

The invoiced total for the specified list of tasks.

How much money was invoiced for the list of tasks in the reporting period.

Note: tasksreport.calculateInvoicedTotal replaces tasksreport.calculateBilledTotal which was used up until version 3.3.

3.0, 3.3

tasksreport.calculateTotal(task)

The total (uninvoiced + invoiced) for the specified task.

How much money is the task worth in the reporting period.

3.0

tasksreport.calculateTotal(tasks)

The total (uninvoiced + invoiced) for the specified list of tasks.

How much money is the list of tasks worth in the reporting period.

3.0

5.8.16. Expenses Report

The following table shows the placeholders that can be used to create expenses reports. Besides these placeholders you can also use business placeholders to print information about your business in an expenses report.

Table 5.19. Expenses Report Properties

Property Version

1. Parameters

The date interval used to build the report can be accessed from the template.

Each interval may or may not have a start date and an end date. If a date interval is defined only by its start date then the end date will not be defined and expensesreport.dateIntervalEnd?? will return false. The folowing code can be used to cover all situations, whether these fields are defined or not.

	[#if expensesreport.dateIntervalStart??]
		[#if expensesreport.dateIntervalEnd??]
	${expensesreport.dateIntervalStart?date} - ${expensesreport.dateIntervalEnd?date}
		[#else]
	After ${expensesreport.dateIntervalStart?date}
		[/#if]
	[#else]
		[#if expensesreport.dateIntervalEnd??]
	Before ${expensesreport.dateIntervalEnd?date}
		[#else]
	All dates
		[/#if]
	[/#if]

expensesreport.dateIntervalStart

self-explained

3.1

expensesreport.dateIntervalEnd

self-explained

3.1

2. Expenses

The report allows you to obtain a list with all its expenses or partial lists (for instance expenses that were recorded for a certain project).

expensesreport.expenses

A list with all the expenses included in the report. This is probably most important placeholder because almost all reports need to use it.

3.1

expensesreport.filterByDate(expenses, period)

Finds the subset of the specified expenses that were recorded in the specified period (date, week, month or year). (their Date field belongs to the period)

3.2

expensesreport.filterByProject(expenses, project)

Finds the subset of the specified expenses that belong to the specified project.

3.1

expensesreport.filterByClient(expenses, client)

Finds the subset of the specified expenses that belong to the specified client.

3.1

3. Grouping

Fields like clients or projects can be extracted as separate groups from a list of expenses.

expensesreport.groupClients(expenses)

A list with all the clients.

[#list expensesreport.groupClients(expensesreport.expenses)?sort as client]
...
[/#list]
3.1

expensesreport.groupProjects(expenses)

A list with all the projects.

[#list expensesreport.groupProjects(expensesreport.expenses)?sort as project]
...
[/#list]
3.1

expensesreport.groupDatesByDate(expenses)

A list with the dates when the expenses included in the report were recorded.

[#list expensesreport.groupDatesByDate(expensesreport.expenses)?sort as date]
...
[/#list]

Use ${date?date.iso} to print each date.

3.2

expensesreport.groupDatesByWeek(expenses)

A list with the weeks when the expenses included in the report were recorded.

[#list expensesreport.groupDatesByWeek(expensesreport.expenses)?sort as week]
...
[/#list]

Use ${week} to print each week. Use ${interval(week)?first?date} and ${interval(week)?last?date} to access the first and last date of the week.

3.2

expensesreport.groupDatesByMonth(expenses)

A list with the months when the expenses included in the report were recorded.

[#list expensesreport.groupDatesByMonth(expensesreport.expenses)?sort as month]
...
[/#list]

Use ${month?date("yyyy-MM")?string("MMM yyyy")} to print each month.

3.2

expensesreport.groupDatesByYear(expenses)

A list with the years when the expenses included in the report were recorded.

[#list expensesreport.groupDatesByYear(expensesreport.expenses)?sort as year]
...
[/#list]

Use ${year} to print each year.

3.2

expensesreport.groupTaxAmountsTaxes(expenses)

A list with the years when the expenses included in the report were recorded.

[#list expensesreport.groupTaxAmountsTaxes(expensesreport.expenses)?sort as tax]
...
[/#list]

Use ${tax.name} to print the tax name and ${tax.defaultRate} to print the tax rate.

3.3

4. Totals

The report can calculate totals for a list of expenses. The list of expenses can either be expensesreport.expenses (all the expenses included in the report) or a partial list determined by one of the filter functions.

expensesreport.calculateAmount(expenses)

The total amount for the specified list of expenses.

Amount specifies the total amount of money spent.

3.1

expensesreport.calculateTaxAmountsBag(expenses)

The total tax amount for the specified list of expenses. The following code display tax amounts by tax:

[#assign taxes = expensesreport.groupTaxAmountsTaxes(expensesreport.expenses)]
[#assign allTaxAmountsBag = expensesreport.calculateTaxAmountsBag(expensesreport.expenses)]

[#list taxes?sort as tax]
${allTaxAmountsBag.getAmount(tax)!""}
[/#list]

Use .getAmount(tax) to get the amount for a specific tax.

3.3

expensesreport.calculateTotal(expenses)

The total for the specified list of expenses.

Total specifies the total amount of money billed if the expense is billable.

3.1

5.8.17. Trips Report

The following table shows the placeholders that can be used to create trips reports. Besides these placeholders you can also use business placeholders to print information about your business in a trips report.

Table 5.20. Trips Report Properties

Property Version

1. Parameters

The date interval used to build the report can be accessed from the template.

Each interval may or may not have a start date and an end date. If a date interval is defined only by its start date then the end date will not be defined and tripssreport.dateIntervalEnd?? will return false. The folowing code can be used to cover all situations, whether these fields are defined or not.

	[#if tripsreport.dateIntervalStart??]
		[#if tripsreport.dateIntervalEnd??]
	${tripsreport.dateIntervalStart?date} - ${tripsreport.dateIntervalEnd?date}
		[#else]
	After ${tripsreport.dateIntervalStart?date}
		[/#if]
	[#else]
		[#if tripsreport.dateIntervalEnd??]
	Before ${tripsreport.dateIntervalEnd?date}
		[#else]
	All dates
		[/#if]
	[/#if]

tripsreport.dateIntervalStart

self-explained

3.1

tripsreport.dateIntervalEnd

self-explained

3.1

2. Trips

The report allows you to obtain a list with all its trips or partial lists (for instance trips that were recorded for a certain project).

tripsreport.trips

A list with all the trips included in the report. This is probably most important placeholder because almost all reports need to use it.

3.1

tripsreport.filterByStartTime(trips, period)

Finds the subset of the specified trips that were recorded in the specified period. (their Start Time field belongs to the period)

3.2

tripsreport.filterByProject(trips, project)

Finds the subset of the specified trips that belong to the specified project.

3.1

tripsreport.filterByClient(trips, client)

Finds the subset of the specified trips that belong to the specified client.

3.1

3. Grouping

Fields like clients or projects can be extracted as separate groups from a list of trips.

tripsreport.groupClients(trips)

A list with all the clients.

[#list tripsreport.groupClients(tripsreport.trips)?sort as client]
...
[/#list]
3.1

tripsreport.groupProjects(trips)

A list with all the projects.

[#list tripsreport.groupProjects(tripsreport.trips)?sort as project]
...
[/#list]
3.1

tripsreport.groupStartTimesByDate(trips)

A list with the dates when the trips included in the report were recorded.

[#list tripsreport.groupStartTimesByDate(tripsreport.trips)?sort as date]
...
[/#list]

Use ${date?date.iso} to print each date.

3.2

tripsreport.groupStartTimesByWeek(trips)

A list with the weeks when the trips included in the report were recorded.

[#list tripsreport.groupStartTimesByWeek(tripsreport.trips)?sort as week]
...
[/#list]

Use ${week} to print each week. Use ${interval(week)?first?date} and ${interval(week)?last?date} to access the first and last date of the week.

3.2

tripsreport.groupStartTimesByMonth(trips)

A list with the months when the trips included in the report were recorded.

[#list tripsreport.groupStartTimesByMonth(tripsreport.trips)?sort as month]
...
[/#list]

Use ${month?date("yyyy-MM")?string("MMM yyyy")} to print each month.

3.2

tripsreport.groupStartTimesByYear(trips)

A list with the years when the trips included in the report were recorded.

[#list tripsreport.groupStartTimesByYear(tripsreport.trips)?sort as year]
...
[/#list]

Use ${year} to print each year.

3.2

expensesreport.groupTaxAmountsTaxes(expenses)

A list with the years when the expenses included in the report were recorded.

[#list expensesreport.groupTaxAmountsTaxes(expensesreport.expenses)?sort as tax]
...
[/#list]

Use ${tax.name} to print the tax name and ${tax.defaultRate} to print the tax rate.

3.3

4. Totals

The report can calculate totals for a list of trips. The list of trips can either be tripsreport.trips (all the trips included in the report) or a partial list determined by one of the filter functions.

tripsreport.calculateDistance(trips)

The total distance for the specified list of trips.

3.1

tripsreport.calculateTotal(trips)

The total for the specified list of trips.

3.1

5.8.18. Sales Report

The following table shows the placeholders that can be used to create sales reports. Besides these placeholders you can also use business placeholders to print information about your business in a sales report.

Here's an example that shows how to calculate totals by month. It groups invoices by month and then it calculates the total for each month.

[!-- Determine the months when invoices where issued. --]
[#assign months=salesreport.groupDatesByMonth(salesreport.invoices)]

[#list months?sort as month]

  [!-- Use salesreport.filterByDate to find invoices issued on a specific month. --]
  [#assign monthInvoices=salesreport.filterByDate(salesreport.invoices, month)]

  [!-- Print the month and calculate the total for the invoices issued on that month --]
  ${month?date("yyyy-MM")?string("MMM yyyy")}: ${salesreport.calculateTotal(monthInvoices)}

[/#list]

[!-- Calculate the total for all the invoices included in the report --]
Total: ${salesreport.calculateTotal(salesreport.invoices)}

Table 5.21. Sales Report Properties

Property Version

1. Parameters

The date and paid date intervals used to build the report can be accessed from the template.

Each interval may or may not have a start date and an end date. If a date interval is defined only by its start date then the end date will not be defined and salesreport.dateIntervalEnd?? will return false. The folowing code can be used to cover all situations, whether these fields are defined or not.

	[#if salesreport.dateIntervalStart??]
		[#if salesreport.dateIntervalEnd??]
	${salesreport.dateIntervalStart?date} - ${salesreport.dateIntervalEnd?date}
		[#else]
	After ${salesreport.dateIntervalStart?date}
		[/#if]
	[#else]
		[#if salesreport.dateIntervalEnd??]
	Before ${salesreport.dateIntervalEnd?date}
		[#else]
	All dates
		[/#if]
	[/#if]

salesreport.dateIntervalStart

self-explained

3.0

salesreport.dateIntervalEnd

self-explained

3.0

salesreport.paidDateIntervalStart

self-explained

3.0

salesreport.paidDateIntervalEnd

self-explained

3.0

2. Invoices

The report allows you to obtain a list with all its invoices or partial lists (for instance invoices that were issued in a certain month).

salesreport.invoices

A list with all the invoices included in the report. This is probably most important placeholder because almost all reports need to use it.

3.0

salesreport.paidInvoices

A list with all the paid invoices included in the report.

3.0

salesreport.filterByDate(invoices, period)

Finds the subset of the specified invoices that were issued in the specified period. (their Date field belongs to the period)

3.0

salesreport.filterByPaidDate(invoices, period)

Finds the subset of the specified invoices that were paid in the specified period. (their Paid Date field belongs to the period)

3.0

salesreport.filterByClient(invoices, client)

Finds the subset of the specified invoices that belong to the specified client.

3.0

3. Grouping

Fields like clients or dates can be extracted as separate groups from a list of invoices. Dates can be grouped by month or year.

salesreport.groupClients(invoices)

A list with all the invoiced clients.

[#list salesreport.groupClients(salesreport.invoices)?sort as client]
...
[/#list]
3.0

salesreport.groupTaxes(invoices)

A list with all the taxes.

[#list salesreport.groupTaxes(salesreport.invoices)?sort as tax]
...
[/#list]
3.3

salesreport.groupDatesByMonth(invoices)

A list with the months when the invoices included in the report were issued.

[#list salesreport.groupDatesByMonth(salesreport.invoices)?sort as month]
...
[/#list]

Use ${month?date("yyyy-MM")?string("MMM yyyy")} to print each month.

3.0

salesreport.groupDatesByYear(invoices)

A list with the years when the invoices included in the report were issued.

[#list salesreport.groupDatesByYear(salesreport.invoices)?sort as year]
...
[/#list]

Use ${year} to print each year.

3.0

salesreport.groupPaidDatesByMonth(invoices)

A list with the months when the invoices included in the report were paid.

3.0

salesreport.groupPaidDatesByYear(invoices)

A list with the years when the invoices included in the report were paid.

3.0

4. Totals

The report can calculate totals for a list of invoices. The list of invoices can either be salesreport.invoices (all the invoices included in the report) or a partial list determined by one of the filter functions.

salesreport.calculateTaxTotal(invoices, tax)

The total for the specified list of invoices and tax.

3.3

salesreport.calculateBalance(invoices)

The balance for the specified list of invoices.

3.0

salesreport.calculatePaymentsTotal(invoices)

The total amount paid for the specified list of invoices.

3.2

salesreport.calculateTotal(invoices)

The total for the specified list of invoices.

3.0

salesreport.calculateGrandTotal(invoices)

The grand total for the specified list of invoices.

3.0

salesreport.calculateTaxesTotal(invoices)

The taxes total for the specified list of invoices.

3.0