Accounting - Operational Workflows & State Machines
Journal entry lifecycle, fiscal year-end close, and state transition tables for financial documents.
The Accounting & FMS domain defines explicit workflows and state machines to ensure that every financial document moves through a controlled, auditable lifecycle.
1. Journal Entry Lifecycle
flowchart LR
A[Draft Preparation] --> B{Balance Validation}
B -->|Invalid| A
B -->|Valid| C[Maker-Checker Approval]
C -->|Rejected| A
C -->|Approved| D[Posting]
D --> E[General Ledger Lock]
| Stage | Business Responsibility |
|---|---|
| Draft Preparation | A user creates a journal voucher and attaches debit/credit lines. |
| Balance Validation | The system enforces the zero-sum rule before allowing progression. |
| Maker-Checker Approval | A second authorized user reviews and approves the voucher. |
| Posting | The voucher is committed to the GL and account balances are updated. |
| GL Lock | Posted entries become immutable and traceable in reporting. |
Maker-Checker Separation
The approver of a journal voucher must be a different actor than its creator. This separation of duties prevents single-actor fraud and satisfies common internal control frameworks.
2. Journal Entry State Transitions
| Current State | Trigger / Event | Next State | Business Validation Rule |
|---|---|---|---|
| Draft | Submit for review | Pending Approval | Voucher must balance; period must be open. |
| Pending Approval | Approver rejects | Rejected | Rejection reason is mandatory. |
| Pending Approval | Approver approves | Approved | Approver is not the voucher creator. |
| Approved | Post command issued | Posted | Period is open; no pending reversals exist. |
| Posted | Reverse command issued | Reversed | A reversing journal voucher is created and posted. |
State Invariants
- A voucher in
Rejectedstate can be edited and resubmitted. - A voucher in
Approvedstate cannot be edited; it must either be posted or sent back to draft by an authorized officer. - A voucher in
Postedstate can only transition toReversedthrough a formal reversal document.
3. Fiscal Year-End Close
flowchart TB
A[Period Reconciliation] --> B[Income Summary Transfer]
B --> C[Retained Earnings Transfer]
C --> D[Nominal Account Zeroing]
D --> E[Opening Balance Roll-forward]
E --> F[Period Lock]
| Step | Description |
|---|---|
| Period Reconciliation | All sub-ledgers, bank statements, and control accounts are reconciled. |
| Income Summary Transfer | Revenue and expense accounts are closed to a temporary Income Summary account. |
| Retained Earnings Transfer | The net result is transferred to Retained Earnings within Equity. |
| Nominal Account Zeroing | Revenue and expense accounts begin the new period with zero balance. |
| Opening Balance Roll-forward | Asset, liability, and equity balances are carried forward as opening balances. |
| Period Lock | The closed period is locked to prevent retroactive changes. |
Close Preconditions
Before a fiscal year can be closed, the system verifies:
- All journal vouchers for the period are posted.
- All sub-ledgers reconcile with the General Ledger.
- All required audit adjustments have been recorded.
4. Multi-Currency Conversion & Exchange Rate Ingestion Workflow
flowchart TD
A[Rate Ingestion Source<br/>Central Bank / Commercial Feed / Authorized User] --> B[Currency Validation<br/>Verify ISO 4217 code exists & active]
B --> C{Invariant Gate<br/>Base Currency?}
C -->|Yes: Rate != 1.0| D[Reject: Base Rate Must Equal 1.0]
C -->|No: Rate > 0| E[Compute Direct & Inverse Rates<br/>Direct: 1 Foreign = Rate Base<br/>Inverse: 1 Base = 1/Rate Foreign]
E --> F[Persist Historical Rate Snapshot<br/>Date-stamped effective rate record]
F --> G[Update Effective Current Rate<br/>Cached rate for operational conversions]
G --> H[Emit Event: ExchangeRateUpdated<br/>Append Forensic Audit Trail]
H --> I[Conversion Engine Ready<br/>Direct, Inverse, & Triangulated conversions]
Multi-Currency Conversion Rules
All multi-currency operations adhere to deterministic conversion and precision rules:
-
Direct Conversion (Foreign to Base): Transaction amounts denominated in foreign currencies are converted to the base functional currency by multiplying the transaction amount by the effective direct exchange rate: $$\text{Amount}{\text{functional}} = \operatorname{round}(\text{Amount}{\text{transaction}} \times \text{ExchangeRate}_{\text{direct}})$$
-
Inverse Conversion (Base to Foreign): For budgetary allocations and quotations originated in the functional currency, conversion to foreign denominations applies the reciprocal inverse rate ($1 / \text{Rate}$).
-
Cross-Rate Triangulation: Direct cross-currency conversions between two non-base foreign currencies ($A$ and $B$) route deterministically through the base functional currency to eliminate bilateral arbitrage and rounding inconsistencies: $$\text{Rate}(A \to B) = \frac{\text{RateToBase}(A)}{\text{RateToBase}(B)}$$
-
Integer Minor Unit Parity: All conversions are executed and rounded into integer minor units (such as cents, pence, or fils). This guarantees that rounding differences are captured explicitly in designated foreign exchange gain/loss accounts rather than contaminating ledger balance equations.
5. Reversal & Correction Workflow (Storno Pattern)
When an error is detected in a posted journal voucher, the immutability invariant prevents modification or deletion. Corrections follow a formal Storno reversal lifecycle:
sequenceDiagram
participant Auditor as Finance Officer / Maker
participant Validation as Invariant Engine
participant Checker as Authorized Approver
participant Ledger as General Ledger
participant Audit as Forensic Audit Log
Auditor->>Validation: Request Reversal for Posted Voucher #JV-1000
Validation->>Validation: Verify Target Voucher is in "Posted" State
Validation->>Validation: Verify Target Period or Active Period is Open
Validation->>Auditor: Generate Draft Reversal Voucher #JV-1001 (Storno)
Auditor->>Checker: Submit Reversal with Documented Reason
Checker->>Validation: Validate Zero-Sum Balance & Period Lock
Checker->>Ledger: Approve & Post Reversal Voucher #JV-1001
Ledger->>Ledger: Post Equal & Inverted Debits/Credits
Ledger->>Audit: Append Correction Chain Link (JV-1000 ↔ JV-1001)
Audit->>Audit: Emit Event: JournalEntryReversed
Correction Protocol Invariants
- Explicit Lineage: Every reversal voucher maintains an explicit reference to the original erroneous voucher.
- Current Period Posting: If the original voucher was posted in a closed fiscal period, the reversal voucher is posted into the earliest open fiscal period, preventing retroactive disruption of filed financial returns.
- Replacement Vouchers: When a corrected transaction is required to replace the reversed entry, the replacement voucher references both the original and reversal documents, completing a three-way correction chain.
- Segregation of Duties: Reversal vouchers require the same Maker-Checker approval protocol as standard commercial journal vouchers.