Accounting - Domain Invariants & Business Rules
Invariants governing the zero-sum rule, immutability of posted entries, closed fiscal period locks, and precision integrity.
Domain Invariants & Business Rules (“The Law”)
Domain invariants represent absolute truths that the Accounting & FMS domain enforces. Any transaction violating these invariants is aborted.
1. Mathematical Zero-Sum Rule
Every posted journal voucher must satisfy the fundamental accounting equation within the transaction:
$$ \sum \text{Debits} - \sum \text{Credits} = 0 $$
- The Law: Total debits must equal total credits for every journal voucher.
- Transaction Rule: If the zero-sum rule is violated, the system rejects the posting operation entirely. No partial posting is permitted.
- Multi-Currency Rule: For vouchers involving multiple currencies, the zero-sum rule applies separately to each transaction currency and to the functional currency after conversion.
Structural Consequence of Violation
If a journal voucher were posted with unequal debits and credits, the General Ledger would drift from the fundamental accounting equation. This would produce invalid Trial Balance totals, inaccurate Balance Sheets, and unreconcilable financial statements.
2. Immutability of Posted Entries
Once a journal entry transitions to Posted, it becomes immutable.
- The Law: A posted journal voucher can never be updated or deleted in place.
- Prohibited Operations: Editing amounts, adding or removing lines, changing accounts, altering cost centers, backdating the document, or deleting the voucher.
- Corrective Path: All corrections must be performed through reversal documents, preserving the complete audit trail.
Audit Rationale
Immutability is essential for regulatory compliance and forensic auditing. If posted entries could be silently modified, financial statements would lose their evidential value, and auditors could no longer rely on the ledger as a source of truth.
3. Closed Fiscal Period Lock
A closed or locked accounting period rejects any new posting.
- The Law: Zero transactions can be posted into a locked or closed accounting period.
- Transaction Rule: Any posting command targeting a closed period is rejected with a clear business exception.
- Reopening Rule: Reopening a closed period requires an explicit administrative action and is itself logged in the audit trail with a mandatory reason.
Reporting Consequence
The period lock invariant protects historical financial statements from retroactive alteration. Once a period is closed, its reports can be published to regulators, investors, and management with confidence.
4. Precision Integrity
All monetary values within the Accounting domain are maintained using enterprise-grade decimal precision.
- The Law: Currency calculations avoid floating-point representation and use a standardized scale (for example, four decimal places) for intermediate allocations.
- Rounding Rule: Final presentation amounts are rounded to the legal currency precision using a deterministic rounding strategy (e.g., half-up).
- Allocation Rule: When an amount is allocated across multiple lines, the remainder is distributed deterministically so that the sum of allocated lines exactly equals the source amount.
Numerical Correctness
Without precision integrity, repeated rounding or binary floating-point errors could accumulate across thousands of transactions, causing Trial Balance totals to disagree with source document sums by fractional but materially significant amounts.