---
title: Finance collections
description: Record what customers paid and apply it to their invoices with withholding, bank charges, exchange differences and small write-offs. See ageing, DSO and a printable statement, write off larger amounts through approvals, and send payment reminders.
section: finance
order: 81
audience: [user, operator, agent]
sources: [services/nodejs-cloud/lib/finance/billing/receipts.ts, services/nodejs-cloud/lib/finance/billing/writeoffs.ts, services/nodejs-cloud/lib/finance/billing/dunning.ts, services/nodejs-cloud/lib/finance/billing/collections-pure.ts, services/nodejs-cloud/lib/finance/billing/collections-settings-pure.ts, services/nodejs-cloud/lib/finance/billing/collections-views.ts, services/nodejs-cloud/lib/finance/billing/collections-mcp.ts, services/nodejs-cloud/lib/finance/billing/receipt-suggest.ts, services/nodejs-cloud/lib/finance/billing/receipt-suggest-pure.ts, services/nodejs-cloud/lib/finance/billing/receipt-suggest-mcp.ts, services/nodejs-cloud/app/(finance)/finance/collections, services/nodejs-cloud/app/(console)/(print)/finance/collections/statement, services/nodejs-cloud/migrations/0446_fin_collections.sql, services/nodejs-cloud/migrations/0470_fin_receipt_suggestions.sql]
features: [cloud.page-finance, cloud.console-finance]
---

Collections belong to the **Billing** module (`finance.billing`), next to [sales invoices](/docs/finance/sales-invoices.md). Open them
in **Finance > Collections** (`/finance/collections`). There are four views: **Receipts**, **Suggested**, **Ageing**
and **Reminders**. An issued invoice's panel in **Finance > Invoices** shows its payments, write-offs and reminders, and a
customer's page in **Finance > Parties** shows whether their reminders are paused, the credit they hold and a link to
their statement.

## Receipts {#receipts}

A receipt is money a customer paid into one of your bank accounts. **New receipt** records one: the entity, the
customer, the amount, the currency, the day it arrived and the bank's reference. It lands in the entity's bank account
for collections (see [Settings](#settings)) and gets the entity's next gapless receipt number, `RCT-000001` and on. A
new receipt is unapplied until you apply it.

**Import receipts from CSV** brings in many at once from a bank export. The columns are `customer` (the customer's
external reference, tax id or exact name), `received_on`, `currency` and `amount` (major units, like `1250.50`), and
optionally `reference` and `memo`. Every row is checked first; one bad row imports none, and each problem is listed with
its line.

Incoming lines on your bank statements can also become receipts with a click: see [Suggested receipts](#suggested).

## Suggested receipts {#suggested}

The **Suggested** view (`/finance/collections?view=suggested`) lists incoming lines from your bank statements that look
like a customer's payment, each as a draft receipt with the invoices it would pay. It reads the lines
[Reconciliation](/docs/finance/reconciliation-sources.md) imported into the statement source of one of your
[bank accounts](/docs/finance/payments.md) (the account's `recon_source_id`), from the last 90 days. Petawork never contacts your bank
and moves no money: it only reads the statement you imported. It needs Reconciliation on for your organisation as well
as Billing; without it the view and the tools say so.

A line is suggested when one of these rules finds it, tried in this order:

| Rule | What it finds |
|---|---|
| `receipt_invoice` | An open invoice's number in the line's reference, and the amount is exactly what is open on it |
| `receipt_customer` | The line's customer, and the amount is exactly what is open on one of their invoices |
| `receipt_customer_sum` | The line's customer, and several of their open invoices (2 to 12, due within 62 days of the line) add up exactly to it |
| `receipt_invoice_diff` | An open invoice's number in the reference, with another amount: a short or over payment |
| `receipt_customer_diff` | The line's customer, and the one invoice of theirs closest in amount, within 25%: short or over |

The customer of a line is the one whose name is the line's payer, or whose external reference appears in its reference
or payer. The rules run through the same matching engine as [reconciliation rules](/docs/finance/reconciliation-rules.md). Each
suggestion shows the line, the customer, each invoice with what is open on it, the rule, a confidence from 0 to 100, and
for a short or over payment the difference.

Nothing is recorded until someone decides, even for an exact match: putting a customer's money against invoices is a
judgement. For each suggestion you can:

- **Confirm**: the receipt is recorded (source `recon`, linked to its bank line) and applied to the invoices, oldest due
  first, each taking at most what is open on it. A short payment leaves the last invoice partly paid; an over payment
  leaves the rest unapplied on the receipt. Nothing is written off by itself.
- **Record, apply by hand**: the receipt is recorded and linked but left unapplied, so you can apply it yourself with
  withholding, bank charges, an exchange difference or a write-off within the tolerance ([Applying a receipt](#apply)).
  With the tool, you can also confirm with your own `applications` in one step.
- **Dismiss**, with a reason: the line is never suggested again.

Confirming is one transaction: the receipt, its applications and their journals are written exactly as by hand, and
the bank line leaves reconciliation (it is marked excluded, with a reason that names the receipt, and its open
reconciliation case is closed). A bank line becomes at most one receipt, even when two people confirm at once. A line
that [payment settlement](/docs/finance/payment-settlement.md) uses for a payment or a return is never suggested, and a line that is a
receipt is never offered to settlement; the database refuses either one twice.

An agent may confirm or dismiss only within its job's authority (action `billing.issue`, document type
`receipt_suggestion`, with the line's amount and the suggestion's confidence and difference for the job's conditions);
otherwise its call is a recommendation for a person. Finance home's receipts card counts the suggestions waiting along
with the receipts not fully applied.

## Applying a receipt {#apply}

Open a receipt to apply it. The grid lists the customer's open invoices for that entity. For each invoice you enter:

| Field | Currency | What it is |
|---|---|---|
| Cash | the receipt's | The part of the receipt this invoice takes |
| Withholding | the invoice's | Tax the customer withheld and pays to the tax office for you |
| Bank charge | the invoice's | What the banks took on the way |
| FX difference | the invoice's | Only for a receipt in another currency: the exchange difference, a loss positive, a gain negative |
| Write-off | the invoice's | A small shortfall written off, within the entity's tolerance |

What each application settles on the invoice is exactly:

> settled = cash (in the invoice's currency) + withholding + bank charge + FX difference + write-off

and the receipt always balances: amount = applied + kept as credit + unapplied. The database checks both. An
application never settles more than is open on the invoice. A write-off while applying must clear the invoice and stay
within the tolerance; anything larger is a [write-off request](#write-offs).

**Apply oldest first** spreads what is unapplied over the customer's open invoices in the receipt's currency, the
earliest due date first, each taking at most what is open on it. **Keep what is left as customer credit** turns the rest
of the receipt into a credit for that customer. A credit is applied later like a receipt (it carries no withholding or
bank charge): open it from the receipt or the customer.

An application is dated the day it is applied (`applied_on`, default today in the entity's time zone), never before the
receipt arrived: that would credit the receivable before the money was there.

A receipt in another currency than the invoice is converted at the exchange rate for the day it is applied
([exchange rates](/docs/finance/reference-data.md#exchange-rates)). If there is no rate for that day or before, the application is
refused with `fx_missing`. Petawork never guesses a rate.

Two people applying to the same invoice at once cannot pay it twice: each application locks the receipt and then the
invoices in a fixed order, and the second one reads what the first wrote.

Each application posts a balanced [journal](/docs/finance/journals.md) through the outbox. In one currency, the bank is debited with
the cash, the bank charges, withholding and write-off accounts with theirs, and the receivable is credited with what was
settled. In two currencies, each balances in its own currency: the cash moves through the exchange difference account,
and what stays there in your functional currency is the realised difference. A customer credit's journal debits the bank
and credits the customer credit account; applying the credit debits that account instead of the bank.

An invoice's paid amount, balance and status (issued, partly paid, paid, written off) are worked out from its
applications, credit memos and write-offs every time it is read. The issued invoice itself is never changed.

### Unapplying {#unapply}

**Unapply** takes one application back, with a reason. Its journal is reversed (or voided if it never became ready), the
receipt's or credit's amounts come back, and the invoice is open again by what the application settled. The application
stays, marked unapplied, with who did it, when and why.

## Larger write-offs {#write-offs}

**Ask to write off** on an open invoice asks to write off what is left on it (or part of it), with a reason. The request
goes to the [approvals engine](/docs/finance/approvals.md) as a document of type `write_off`, under your approval policies for
write-offs; with none, any controller on the invoice's entity approves it. Whoever asks, a person or an agent, never
approves their own request.

Once approved, the write-off journal posts (the write-off account debited, the receivable credited), the invoice reads as
written off and no reminder goes to it. If the customer pays after all, applying the payment reverses the write-off first
and then applies the payment. A rejected request changes nothing.

## Reminders {#reminders}

Each entity has a reminder schedule, in the **Reminders** view. Its steps sit at a number of days from the due date:
negative before it, 0 on the day, positive after it. Each step uses one of four templates (before the due date, on the
due date, overdue, final reminder), written in all seven languages. A new schedule starts from four steps: 3 days before,
on the due date, 7 and 21 days after, the last one final.

Once a day the sweep looks at each open invoice of an entity whose schedule is on. It sends the latest step whose day has
come, once per invoice and step. A step that was missed is not sent late, so a customer never gets a burst of reminders.
The email goes through your organisation's Comms email to the customer's billing contacts, each in their own language,
with the amount still open and how to pay.

No reminder goes to:

- an invoice that is paid or written off;
- a disputed invoice (**Mark disputed**, with a reason, until **Dispute settled**);
- a paused invoice or a paused customer (**Pause reminders** on the invoice or on the customer's page).

If your organisation has no Comms email, nothing is sent. The step is logged as skipped with the reason, and a
`reminder_skipped` [exception](/docs/finance/exceptions.md) of high severity tells whoever works the entity's exceptions, usually the
AR clerk. The same happens when the customer has no billing contact. Finance never sends email any other way.

When the final step goes out, a `final_reminder` exception is assigned to the schedule's owner (or, with none, whoever
issued the invoice), so the person who owns the account hears of it in the bell.

The first day an invoice is past its due date, the sweep also records that it became overdue, once.

A sent step is remembered by its day (for example 7 days after the due date) and whether it is final, not by its place
in the schedule. Adding, removing or moving other steps therefore never makes the sweep think a step was already sent,
and an invoice still gets its final reminder after the schedule changes.

Reminders logged before this rule were remembered by their place in the schedule. They are never rewritten. Such a
reminder counts as covering every step whose day is on or before the day it was sent (in the entity's time zone), so no
step it covered is sent again. It covers a final step only if that invoice also has a `final_reminder` exception, so an
invoice whose final reminder was never sent still gets it.

## Ageing and days sales outstanding {#views}

**Ageing** shows what each customer still owes, per currency, in buckets of days past the due date: not yet due, 1-30,
31-60, 61-90 and over 90 days, with totals per currency. Amounts in different currencies are never added together. Each
entity's own date is used, in its time zone.

Days sales outstanding (DSO) is shown per currency:

> DSO = receivables open today ÷ invoiced in the last 90 days × 90

rounded to one decimal place. Invoiced means issued and not void, by issue date. Nothing invoiced in the window shows
"Nothing invoiced".

## Statement {#statement}

**Statement** on an ageing row, or on a customer's page, opens the customer's statement of account at
`/finance/collections/statement?party=…`, in the customer's language. It lists every open invoice with what is left and
how many days late it is, the totals per currency by age, the payments received in the last 90 days (`from` and `to` in
the address change the period) and the credit they hold. It is as at the entity's own date, in its time zone (for a
shared customer, the latest date among your entities), so a payment that arrived this morning is on it. Print it, or save it as a PDF from the browser's print dialog.

## Settings {#settings}

Collections post to the accounts in the entity's settings, under `settings.collections` (kept with
`finance_entity_update`, like the [invoice settings](/docs/finance/sales-invoices.md#settings)):

| Setting | Account type | Used for |
|---|---|---|
| `bank_account_id` | asset | Where receipts land, unless a receipt names another |
| `withholding_account_id` | asset | Withholding tax customers deducted |
| `bank_charge_account_id` | expense | Bank charges |
| `fx_account_id` | any | Exchange differences |
| `write_off_account_id` | expense | Write-offs, small and approved |
| `credit_account_id` | liability | Customer credit |
| `tolerance_minor` | | The largest shortfall written off while applying, in minor units of the entity's functional currency (default 0) |

An application that needs an account the entity has not set is refused and names the setting.

## Who may do what {#roles}

| Action | Who |
|---|---|
| See receipts, ageing, statements and reminders | `billing.read`: an AR clerk, a controller, an auditor |
| Enter, apply and unapply receipts; confirm or dismiss a suggested receipt; ask for a write-off; change the reminder schedule; pause and dispute | `billing.issue`: an AR clerk or a controller |
| Approve a write-off | whoever the approval policy names; by default a controller on the entity |
| Collections settings | a controller with `finance:admin` |

A member scoped to some entities sees and works only those. Another entity's receipt or invoice answers as if it did not
exist. With Billing off for the organisation, every page, tool and REST call answers `403 product_not_enabled`. Every
change is on the [event chain](/docs/finance/audit-trail.md).

## Tools and API {#tools}

| Tool | REST | What it does |
|---|---|---|
| `finance_receiptin_list` | `GET /api/v1/finance/receipts` | Receipts, filtered by `entity_id`, `party_id`, `open`, `from`, `to`; with `id`, one receipt with its applications; with `party_id`, that customer's open credits too |
| `finance_receiptin_create` | `POST /api/v1/finance/receipts` | One receipt: `entity_id`, `party_id`, `amount_minor`, `currency`, optional `received_on`, `reference`, `memo`, `bank_account_id`; or many with `csv` (and `dry_run`) |
| `finance_receiptin_apply` | `POST /api/v1/finance/receipts/apply` | `id` (a receipt) or `credit_id`, with `applications` or `oldest_first`, optional `surplus_to_credit` and `applied_on` |
| `finance_receiptin_unapply` | `POST /api/v1/finance/receipts/unapply` | `application_id`, `reason` |
| `finance_writeoff_request` | `POST /api/v1/finance/write-offs` | `invoice_id`, `reason`, optional `amount_minor` |
| `finance_dunning_get` | `GET /api/v1/finance/dunning` | An entity's schedule and log (`entity_id`), or one invoice's with its holds (`invoice_id`) |
| `finance_dunning_update` | `PATCH /api/v1/finance/dunning` | `entity_id`, `active`, `owner`, `steps` |
| `finance_dunning_pause` | `POST /api/v1/finance/dunning/pause` | `invoice_id` or `party_id`, `paused`, `disputed` (an invoice), `reason` |
| `finance_receiptsuggest_list` | `GET /api/v1/finance/receipt-suggestions` | Suggested receipts from incoming bank lines, filtered by `entity_id` and `from` (the first statement day read) |
| `finance_receiptsuggest_decide` | `POST /api/v1/finance/receipt-suggestions/{record_id}/decide` | `decision` `confirm` (optional `applications`, `surplus_to_credit`, `party_id`, `apply`) or `dismiss` (with `reason`) |

Amounts are minor units, as numbers or decimal text (`125050` is 1,250.50). Reading needs OAuth scope `finance:read`,
every change `finance:write`.
