---
title: Finance period close
description: Close an entity's month with a live checklist, lock it (with a written reason when items are still open), unlock it with a reason, give auditors read-only access to some entities and months, and export a reproducible audit sample.
section: finance
order: 80
audience: [user, operator, agent]
sources: [services/nodejs-cloud/lib/finance/close/pure.ts, services/nodejs-cloud/lib/finance/close/checks.ts, services/nodejs-cloud/lib/finance/close/close.ts, services/nodejs-cloud/lib/finance/close/sample.ts, services/nodejs-cloud/lib/finance/close/mcp.ts, services/nodejs-cloud/app/(finance)/finance/close, services/nodejs-cloud/app/api/workspace/finance/close/sample/route.ts, services/nodejs-cloud/migrations/0450_fin_close.sql]
features: [cloud.page-finance]
---

Closing a month means checking that nothing is left half done for one entity, then locking the month so nothing new
posts into it. Open **Finance > Close** (`/finance/close`), pick the entity and the month, and work down the
checklist. The page's address keeps both, so a link opens the same month.

## The checklist {#checklist}

The checklist is worked out each time you open it, from the records themselves. Nothing is stored that could go stale.
Each line shows how many items are open, the sums at stake per currency (never added across currencies), and a link to
the page where you work them.

| Line | What it counts | Blocks a lock |
|---|---|---|
| Open exceptions | [Exceptions](/docs/finance/exceptions.md) of the entity raised before the month ended and still open or in review | Yes |
| Pending approvals | [Approval requests](/docs/finance/approvals.md) of the entity asked before the month ended and still pending | Yes |
| Journals blocked or failed | [Journals](/docs/finance/journals.md) posting in the month that are drafts or whose export failed (a failed sync of an accounting connection is the line below) | Yes |
| Journals not yet exported | Ready journals posting in the month that are neither in a confirmed [export file](/docs/finance/exports-and-imports.md) nor posted through an accounting connection ([Xero](/docs/finance/connectors-xero.md), [QuickBooks Online](/docs/finance/connectors-quickbooks.md)) | No |
| Journals whose sync failed | Journals the entity's accounting connection refused or could not take yet, each with a `sync_failed` exception; the connection page lists why | No |
| Missing exchange rates | Currencies on the month's journals with no rate yet, one item per currency | Yes |
| Unverified parties | [Parties](/docs/finance/parties.md) on the month's journals that are not verified, or whose bank details wait for verification | No |
| Documents not yet settled | [Documents](/docs/finance/documents.md) of the entity that arrived before the month ended and are still waiting, being read, to review or failed | No |
| Sales invoices still in draft | [Sales invoices](/docs/finance/sales-invoices.md) of the entity still in draft, dated in the month or undated and made before it ended, with their totals | No |
| Receipts not fully applied | Customer receipts in [Collections](/docs/finance/collections.md) received by the month's end with an amount still unapplied, with that amount | No |
| Billing run lines that failed | Subscriptions a [billing run](/docs/finance/subscriptions.md) of the month could not invoice and no later run has, with what they would have charged | No |
| Bills not yet approved | [Bills](/docs/finance/bills.md) of the month (their accounting period) still in draft, to review or in approval, with their totals | No |
| Expense reports not yet approved | [Expense reports](/docs/finance/expenses.md) of the month, or with no month and made before it ended, still in draft, submitted or in approval | No |
| Payment runs not settled | [Payment runs](/docs/finance/payments.md) with a value date in the month that are neither settled nor cancelled | No |
| Reconciliation runs not completed | [Reconciliation runs](/docs/finance/reconciliation-runs.md) over the month still queued, running or failed | No |
| Card lines without a receipt | [Company card](/docs/finance/expense-cards.md) lines posted in the month still unmatched or with a suggestion nobody confirmed | No |
| Purchase orders not fully received | [Purchase orders](/docs/finance/purchase-orders.md) ordered before the month ended that are issued or partly received, with their totals | No |
| Advances not yet accounted for | [Advances](/docs/finance/expense-advances.md) paid out before the month ended and still open: receipts or a refund still to come | No |
| Event chain breaks | The [audit trail](/docs/finance/audit-trail.md) over the month's events is recomputed; a break is one item | Yes |
| Your own items | Lines a controller adds for the entity ("Bank statement filed"), with an assignee, ticked done per month | Yes, until done |

The month is the entity's own: from midnight on the first in the entity's time zone to midnight on the first of the
next month.

Below the checks come four exception reports. They never block a lock; they are there so whoever signs off has seen
them:

| Report | What it lists |
|---|---|
| Over policy | Exceptions of kind `over_policy` raised in the month |
| No receipt | Exceptions of kind `missing_receipt` raised in the month |
| Out of period | Journals posting in this month that are dated in an earlier, locked month (rolled forward with a note) |
| Self-approved | Approval requests approved in the month by the person who asked for them, break-glass included |

Checks for modules that are not released yet (purchase orders, account reconciliation, the "split under threshold" report) join the checklist when those modules arrive.

## Locking and unlocking {#lock}

A locked month refuses new postings. A late item, such as a bill dated in a locked month, is posted in the next month
that is not locked, with a note saying so (see [journals](/docs/finance/journals.md#periods)).

- **Lock month** locks it when no blocking line has open items. Only a controller on the entity may lock.
- When a blocking line still has items, a plain lock is refused and the refusal names the lines. A controller may
  **Lock with open items** by writing a reason of 10 to 2000 characters. The lock goes through, and the reason and
  the checklist as it stood are kept.
- The checklist that decides is worked out again inside the lock itself. An item that appears while you press Lock is
  seen: it refuses a plain lock, and a lock with a reason records it among the open items.
- **Unlock month** takes a locked month back to closing (or open). It always needs a written reason, and only a
  controller may do it.
- An agent never locks or unlocks a month, whatever roles it holds.

Every lock and unlock is a sign-off in the **Close history**: who, when, the reason, whether the month was locked with
open items, and each checklist line's count at that moment, so you can see later what was open when the month closed.
Each sign-off is also its own event on the [audit trail](/docs/finance/audit-trail.md): `finance.close.locked`,
`finance.close.locked_with_open_items` or `finance.close.unlocked`, beside the period's own `finance.period.locked` or
`finance.period.unlocked`.

Setting a period to locked in **Finance > Settings > Periods** (or with `finance_period_update`) goes through the same
check. Unlocking there is refused: use **Unlock month**, which takes the reason.

## Auditors {#auditors}

An auditor is a member holding the `auditor` [Finance role](/docs/finance/roles.md). Grant it on one entity (or all) and,
if you like, for a range of months (`period_from` and `period_to`, first of the month). An auditor:

- reads only the entities and months of the grant: the checklist, the close history, journals, events and the other
  read pages and tools. Another entity reads as unknown; a month outside the range is refused;
- writes nothing: no write tool is listed for them over MCP, and every write is refused;
- is logged: each tool an auditor calls, and each sample they download, is recorded with the entity, month and record
  it named. Controllers read the log with `finance_auditorview_list`.

To end an auditor's access, revoke the grant in **Finance > Settings > Roles**.

## The sampling export {#sample}

Members who read the audit trail and the journals (a controller, or an auditor in their months) can draw a sample in
**Finance > Close > Sampling export**:

- **From** and **To**: up to 24 months.
- **Population**: the journals posting in those months (ready or posted), or the entity's events in those months.
- **Stratify by**: nothing (simple random), amount band, vendor, category or month. Events can be stratified by
  category (their action) or month only.
- **Size**: 1 to 500 items.
- **Seed**: any text of letters, digits, `_` and `-`. The page suggests one; write down the one you use.

**Download ZIP** gives one file with:

| File | What it holds |
|---|---|
| `README.txt` | The entity, the months, the seed, the method in words, and how to re-derive the sample |
| `manifest.json` | The same as data, with the population's count and fingerprint |
| `population.csv` | Every item of the population with its stable id and its stratum |
| `sample.csv` | The sampled items, with their rank, stratum and draw key |
| `items/<rank>-<number>/` | For each sampled journal: `journal.json` (its lines and coding), `events.json` (its history and its source's), `approvals.json` (its source's approval requests and decisions) and `documents.json` (the source document's reference). For an event: `event.json` |

Each CSV starts with `#` lines naming the seed, the method and the population. Cells a spreadsheet would run as a
formula (starting with `=`, `+`, `-` or `@`; a minus is left alone only on a plain number such as `-12.50`) get a
leading apostrophe. Nothing sealed is ever in the export: bank
details are not read at all, and event details are masked when they are recorded. The export itself is recorded on the
audit trail as `finance.sample.exported`, with who, the entity, the months, the seed and the counts.

An auditor draws the same sample as a controller. Their `events.json` files leave out events recorded outside their
months, as everywhere else in Finance, so their ZIP can be smaller than a controller's. The ZIP carries a document's
reference (its name, type, size and SHA-256), not the file itself.

### Re-deriving a sample {#rederive}

The method is `sha256-rank-v1`. Anyone with `population.csv` and the seed can redo the draw:

1. For each id in the population, compute SHA-256 of the text `<seed>:<id>` and write it as lowercase hex. That is the
   item's key (the `sample_key` column in `sample.csv`).
2. Sort the items by key, lowest first, and take the first *size* of them.
3. Stratified: split the population into its strata first. Each stratum gets *size* times its share of the population,
   rounded down, and the items left over go one each to the strata with the largest remainders (a tie goes to the
   stratum whose name sorts first). Then take the lowest keys inside each stratum.

Amount bands are four groups of nearly equal count by the journal's amount in the functional currency (A1 lowest).
A journal's vendor is the party on its first line that names one; its category is the account of its largest debit
line. The same seed over the same data always gives the same sample and the same bytes; the manifest's
`population_sha256` (SHA-256 of the sorted ids, one per line) tells you whether the population is still the same.

## Keeping records {#retention}

An entity's `settings.retain_until` (a date, `YYYY-MM-DD`, set with `finance_entity_update`) keeps its Finance
records. Until that date, deleting a journal, a journal line, a document, an exception, an approval request, a close
sign-off or an auditor log entry of that entity is refused by the database. The checklist shows the date. Deleting the
whole organisation still removes everything.

## For agents {#agents}

| Tool | What it does | Scope |
|---|---|---|
| `finance_close_get` | The checklist of one entity's month | `finance:read` |
| `finance_close_history` | An entity's locks and unlocks, with the checklist as it stood | `finance:read` |
| `finance_period_lock` | Lock a month; `reason` to lock with open items | `finance:admin` |
| `finance_period_unlock` | Unlock a month, with a reason | `finance:admin` |
| `finance_closeitem_save` | Add, change, archive or tick a controller's own checklist item | `finance:admin` |
| `finance_sample_run` | Draw a sample: the manifest and the sample as CSV (the ZIP is downloaded in the app) | `finance:read` |
| `finance_auditorview_list` | What members holding an auditor grant read | `finance:read` |

The REST twins are under `/api/v1/finance/close`: `GET /finance/close`, `GET /finance/close/history`,
`POST /finance/close/lock`, `POST /finance/close/unlock`, `POST /finance/close/items`, `POST /finance/close/sample` and
`GET /finance/close/auditor-views`. An agent can read the checklist and draw a sample, but never locks or unlocks a
month.
