Skip to content
Invoice Joins | Omni Manual Book

Invoice Joins

Consolidate several unissued customer invoices into one document and one receivable, with per-source allocation and reversal.

The Invoice Joins screen consolidates several customer invoices that have not yet been issued into one invoice. The customer receives one document, one number and one receivable — instead of five separate bills demanding five separate payments.

  • Menu Sales → Invoice Joins (route o2c/invoice-joins).
  • Requires read:invoice-join to view the register, create:invoice-join to consolidate, and reverse:invoice-join to undo.
  • By default Finance/Admin holds all three; Sales holds read and create only.

This is the rule the whole feature is built on, and it is not a convenience.

Invoice statusJoinable?Why
DRAFT✅No AR journal exists.
PENDING✅Awaiting approval; no AR journal exists.
APPROVED, SENT, OVERDUE❌Already issued; carries an AR journal.
PARTIAL_PAID, PAID❌Money is already allocated.
CANCELLED, MERGED❌Already terminal.

Even within the unissued band, further guards apply. All of them are reported together, never one at a time:

CodeMeaning
TOO_FEW_SOURCESFewer than the minimum number of invoices (2 by default).
TOO_MANY_SOURCESMore than the maximum per consolidation.
DUPLICATE_SOURCEThe same invoice appears more than once.
CUSTOMER_MISMATCHInvoices belong to different customers.
CURRENCY_MISMATCHInvoices use different currencies.
SOURCE_NOT_ELIGIBLEStatus outside the policy’s allow-list.
SOURCE_ALREADY_JOINEDThe invoice is already part of another consolidation.
SOURCE_HAS_PAYMENTIt has a payment or a balance reduced by a credit.
SOURCE_DATE_AFTER_JOIN_DATEThe invoice date is later than the join date.
ORGANIZATIONAL_UNIT_MISMATCHDifferent org unit (when the policy requires the same one).
SALESPERSON_MISMATCHDifferent salesperson (when the policy requires the same one).

Two things are reported as warnings rather than refusals, because they are legitimate but change what the resulting document means:

  • The sources span more than one accounting period. The merged invoice takes the latest period’s date, so be aware if a period is already closed.
  • The sources were taxed at different PPN rates. The merged invoice carries the blended effective rate (ppn_amount / net_amount, 4 dp). The authoritative figure is always ppn_amount, never the rate.

Totals are copied exactly, never recomputed

Section titled “Totals are copied exactly, never recomputed”

The merged invoice’s figures are the exact sum of each source’s stored columns. They are not recomputed from lines, because round(a×r) + round(b×r) is not round((a+b)×r) — and invoices with different PPN treatment (one taxable, one exempt) make that the normal case rather than an edge case.

Recomputing would leave a permanent sub-cent residue in the general ledger that reconciles to nothing. Therefore:

  • The merged header is supplied explicitly from the source totals.
  • Source lines are copied value-for-value (quantity, unitPrice, discountPct), so computeLine reproduces the same figures.
  • Before writing, the server verifies that the line sum equals the stored subtotal. If it does not (for example, a header that was edited by hand), the consolidation is refused with a message naming the offending invoice — refusing is better than issuing a document whose lines do not foot.

By default the merged invoice takes the earliest source due date. Consolidation is an administrative courtesy, not new credit. Using the latest date would turn consolidation into a quiet way of granting a customer extra days nobody approved.

A tenant whose commercial policy really is to normalise a customer’s schedule can select the LATEST strategy through the invoice.join.v1 setting — and that is recorded as a decision rather than being the default.

The merged invoice shows one number; the allocation table shows how that number was arrived at. Each source is stored with:

  • its invoice number (snapshotted, so the historical document stays readable even if the source row is later deleted),
  • the status it held before the merge (used to restore it),
  • its invoice and due dates,
  • all five money columns (subtotal, discount, net, PPN, total),
  • its AR journal id.

Storing one merged total and re-splitting it on reversal is lossy: a discount, an exempt line, or an already-rounded PPN cannot be divided back into its original parts and survive.

Undoing a consolidation will:

  1. Cancel the merged invoice — its AR journal is reversed, with a narration naming the join number and the reason.
  2. Restore every source to the status it held before the merge (DRAFT or PENDING).
  3. Mark the join REVERSED, recording the reason, the actor and the time.

Because the sources never posted a journal, their restoration is purely a status change — the ledger lands exactly where it started. That is the reason the “unissued only” rule exists.

Undo is only possible while the merged invoice is untouched: not cancelled, and with no payment or credit allocated. If money has been applied, it must be unapplied first — the same condition the sources had to meet on the way in. Symmetry is the point.

  • The Invoice Joins register lists every consolidation with filters (status, date range, number/title search), multi-column sort, and a CSV export that applies exactly the same filters.
  • The merged invoice is an ordinary invoice: it appears in the invoice list, ages, is dunned, sits in receivables, and counts for commission.
  • Source invoices are MERGED and do not appear as receivables. The status is terminal and is automatically excluded from every “what is still owed?” reader — ageing, dunning, credit exposure and commission — because they all filter in the open statuses.

The policy is stored under invoice.join.v1 and read through SettingsService:

FieldDefaultMeaning
minSources2Minimum invoices per consolidation.
maxSources100Maximum invoices per consolidation (hard ceiling 500).
allowedSourceStatuses["DRAFT","PENDING"]Joinable statuses; cannot widen the forbidden set.
requireSameOrganizationalUnitfalseWhen on, every source must share one org unit.
requireSameSalespersonfalseWhen on, every source must share one salesperson.
dueDateStrategyEARLIESTEARLIEST or LATEST.

A corrupt or partial value never widens a guard: normalisation falls back to the safe status list, so a settings typo cannot make an issued invoice joinable.

Why is the “Join” button missing for some customers? Their invoices may already be issued. Check the status: only DRAFT and PENDING can be joined.

Can invoices in different currencies be joined? No. The merged invoice has one currency, and a cross-currency consolidation produces a legally wrong document.

What happens to the source sales orders or contracts? Nothing. The source invoices already consumed them when they were created, and the merged invoice deliberately does not reference them again, so consumption is not advanced twice.

Can a merged invoice be joined again? No. It is an ordinary invoice, but source invoices left in MERGED can never be selected again.

Open in the app