# Voucher and Journal Engine

Implemented as the next accounting phase after the four-level Chart of Accounts.

Scope implemented:

- Company-scoped voucher types with document prefixes.
- Transaction-safe document sequencing for vouchers and journal entries.
- Draft journal vouchers with debit/credit lines.
- Posting a balanced voucher creates a posted journal entry and journal lines atomically.
- Posted vouchers are immutable and cannot be deleted through the service.
- Voucher and journal tables carry company, branch, fiscal year, and fiscal period context.
- Posting rejects closed fiscal years or periods.
- Posting rejects accounts that are not active Level 4 postable Chart of Accounts records.
- Posting rejects unbalanced debit/credit totals.
- Audit logs are written for voucher creation, posting, deletion, and journal creation.

Out of scope for this module:

- Cash vouchers and bank vouchers.
- Ledger, trial balance, and financial statements.
- Sales, purchase, inventory, POS, receipts, and payments.
- Reversal workflows beyond data structure support for future reversed journal entries.

Financial values use database `DECIMAL(18,4)` columns and service-level string/bcmath validation.
