Overview

The system automatically generates draft invoices overnight for eligible bookings. This removes the need to manually create invoices for routine bookings, while still allowing you to review and approve each invoice before it is exported to your accounting system.

The overnight job runs at 5:00 AM on weekdays (Monday to Friday). It evaluates all uninvoiced bookings and creates draft invoices for those that meet the eligibility criteria.

Key benefits:

How it works

Each morning, the overnight job performs the following steps:

  1. Identify eligible bookings — The system queries all bookings that meet the invoicing criteria.
  2. Determine invoice settings — For each booking, the system looks up the billing customer's account settings to determine which template and line type to use.
  3. Render invoice descriptions — The appropriate invoice template is applied to each booking, replacing tokens with actual booking data.
  4. Create draft invoices — One draft invoice is created per eligible booking, with lines structured according to the billing customer's line type preference.

❕Note: Each booking produces its own invoice. The overnight job does not group multiple bookings into a single invoice.

Eligibility criteria

A booking must meet all of the following conditions to be included:

Condition Description
Not already invoiced The booking must not already have an invoice number assigned.
Not cancelled The booking status must not be Cancelled or Cancelled In Progress.
Invoicing not suspended The booking must not have invoicing suspended.
Customer set to automatic The billing customer's Invoice Generation Mode must be set to Automatic (Overnight).

In addition, the booking must meet one of the following timing conditions depending on the customer type:

Trading account customers

All trips in the booking must have ended (i.e. the last trip end date is before today). This ensures the service has been fully delivered before an invoice is raised.

Non-trading account (prepaid) customers

At least one trip in the booking must start within the lead time window. The lead time is configured via the Prepaid Customer Invoice Lead Time Days setting in Accounting Settings.

For example, if the lead time is 14 days and a booking has a trip starting on 20 July, the draft invoice is generated on or after 6 July.

Invoice line structure

Single Line Per Booking

One invoice line is created for the entire booking. The line description is rendered using the billing customer's invoice template (or the system default). The line price is the total booking price.

Split Into Trip Lines

A non-exported parent line is created to group the trips. One exportable line is created per trip, with a description rendered using the billing customer's trip template and priced at the individual trip price.

Template selection

The overnight job selects invoice templates in the following order:

  1. If the billing customer has Use Default Template disabled, the customer's own templates are used.
  2. If the billing customer has Use Default Template enabled, the system-wide default templates configured in Accounting Settings are used.

Invoice date calculation

After generation

Draft invoices appear in the Invoices list with a status of Draft. From there, you can review, edit, approve, or cancel each invoice before it is exported.

Excluding bookings from automatic generation

In This Topic