# Financial invariants

These rules are non-negotiable for ledger integrity in a multi-tenant ERP.

## 1. Debits equal credits

For every journal entry (and, where enforced, for each accounting period roll-up):

\[
\sum \text{debit amounts} = \sum \text{credit amounts}
\]

Currency must be homogeneous per entry unless an explicit, audited FX split exists (out of scope for foundation phase).

## 2. No orphan lines

- Every journal line belongs to **exactly one** journal entry header.
- Every line points to a **valid account** in the same tenant and, when policy requires, to a **postable** account.
- Lines cannot exist without a balancing counterpart within the same entry.

## 3. No mutation of posted facts

- Posted amounts and account assignments are **immutable**.
- Adjustments appear as **new** entries; reversal pairs maintain **bidirectional traceability** to the original.

## 4. Non-interference with operational truth

- Accounting **never** changes inventory on-hand, reservations, sales line quantities, or procurement receipt quantities.
- If reconciliation detects drift between finance and operations, resolution is **operational correction + compensating financial entry**, not silent ledger edits.

## 5. Tenant isolation

Ledger aggregates, trial balance, and account balances are computable **per tenant only**; cross-tenant aggregation is an explicit admin/reporting concern with its own controls.
