Journals and accounts
The profile keeps one shared set of journals and one shared account hierarchy. Automatic source rows and manually entered journal lines both feed this same accounting model.
Journal lifecycle
Section titled “Journal lifecycle”open journal├── accepts new lines├── allows source-row replacement or deletion├── may be unbalanced└── can close only when debit = credit │ ▼closed journal├── lines and header are frozen├── contributes to the closed account projection└── may reopen only while its accounting period is mutableA journal has a unique short name, an accounting date, description, currency, debit and credit totals, active-line count, balance, and close metadata.
The reported balance is:
total credit - total debitA negative value therefore means debits exceed credits. The unbalanced-journal view also reports the missing side and amount required to reach zero.
Automatic and manual lines
Section titled “Automatic and manual lines”An automatic line records where it came from:
- source table definition;
- source row ID;
- source row revision.
That provenance allows journal readers to return the source table and record, and it allows a later source update to retire precisely the line created by the previous revision.
A manual line has no business-row source. Manual posting can create a journal with its first batch of lines or append a batch to an existing open journal. At least one positive line is required, but the batch itself does not have to balance the journal.
Line descriptions are optional. Deleting a journal line is a soft deletion, preserving the audit trail while excluding that line from active totals.
Closing and reopening journals
Section titled “Closing and reopening journals”Closing refreshes the totals and rejects the operation unless total debit equals total credit. Closing records who closed the journal and when, then freezes both the header and its lines.
Reopening moves the journal back to the open projection and makes it mutable again. It is allowed only if the accounting date is not protected by a closed period.
Database protections also prevent direct updates, deletes, or truncation from bypassing the journal state rules.
Account paths
Section titled “Account paths”Accounts form a tree. The public identity is a slash-delimited root-to-leaf path:
311311/001311/002Each segment is unique among siblings. Creating 311/001 ensures every missing ancestor exists. Ancestors use the profile accounting currency; the leaf has a denomination currency that cannot later be silently changed by resolving the same path with another currency.
An accounting-enabled source row must reference an account that already exists and whose denomination currency matches the source table’s debit and credit currency.
Manual journal posting may create a missing path as part of the same transaction. Automatic business-table posting deliberately does not: account setup remains an explicit prerequisite for business rows.
Account-path rules
Section titled “Account-path rules”An account path:
- contains between 1 and 16 segments;
- uses
/only as the separator; - cannot contain empty segments, whitespace, or control characters;
- may contain at most 128 characters across all segments.
Therefore 311/001 is valid, while /311, 311/, 311//001, and 311 /001 are not.
What the accounts table shows
Section titled “What the accounts table shows”Each account row maintains live projections:
| Value | Meaning |
|---|---|
debit |
Debit activity on this account and descendants |
credit |
Credit activity on this account and descendants |
subaccount_debit |
Debit portion contributed by descendants only |
subaccount_credit |
Credit portion contributed by descendants only |
open |
Signed net belonging to open journals |
closed |
Signed net belonging to closed journals |
total |
Signed net from all active lines |
denomination_balance |
Leaf balance in the account’s own denomination currency |
The account projection uses debit-positive signs: debit adds and credit subtracts. Parent accounts receive consolidated activity from descendants. Direct activity can be derived by subtracting the subaccount totals from the consolidated totals.
Closing a journal moves its signed amount from open to closed without changing total. Reopening moves it back. Replacing or deleting a line removes its old contribution before applying the new state.
Accounting currency and denomination currency
Section titled “Accounting currency and denomination currency”The current accounting implementation supports profiles whose books are kept in EUR. Business money columns and leaf accounts may use another ISO currency.
When a journal line is supplied in another currency, the stored journal amount is converted to the profile accounting currency. The line retains:
- the original amount;
- the original currency;
- the conversion evidence used for the result.
The conversion basis is the journal accounting date. Automatic lines from ACCOUNTING tables use their tax_point_date and the ECB reference-rate path. Manual journal posting can explicitly request a profile custom rate; if requested, a missing custom rate is an error rather than a fallback to ECB.
The custom_exchange_rates table stores one active rate per publication date and currency. Its units_per_eur convention matches the ECB observation convention.
See ECB conversion for rate selection and Money for currency and rounding behavior.
Why journals may remain unbalanced
Section titled “Why journals may remain unbalanced”The ledger is informational while a journal is open. This supports workflows where lines arrive from several source records or at different moments.
The system exposes profile-wide balance status and an oldest-first queue of unbalanced journals so incomplete work can be found. The hard boundary is journal close: an unbalanced journal cannot close, and a period cannot close while it still contains open journals through the period end.
What remains editable?
Section titled “What remains editable?”| Current state | What remains possible |
|---|---|
| Open journal, accounting date after every closed boundary | Add lines, soft-delete lines, and replace source-linked lines |
| Closed journal in a mutable period | Read it or reopen it; direct line and source changes are blocked |
| Journal date at or before a closed period end | Read it; mutations and reopening are blocked until the period is validly reopened |
| Approved profile periods | Read frozen journals and snapshots; approved periods cannot reopen |
Closing a journal and closing a period protect different scopes. Journal close freezes one journal. Period close protects every accounting date through its end, including journals that were already closed individually.