Finance — Posting lifecycle
Product version: 1.0.0+1
Last updated: 2026-10-07
Audience: Tenant Owners, Finance operators
Automated postings (Sales & Inventory)
Finance listens on the shared event bus and posts balanced journal entries through an idempotent poster keyed by (tenant, source_type, source_id, posting_kind).
| Trigger (ops owner) | Typical posting_kind |
Effect (simplified) |
|---|---|---|
| Sales invoice created | sale_revenue |
DR AR / CR Revenue |
| Sales payment recorded | sale_payment |
DR Cash/Bank / CR AR. Cash a sales representative records on their own sale debits their custody cash (1050-…) instead — see Cash settlements |
| Sales invoice voided | sale_void |
Reverse revenue / AR |
| Sales return completed | sale_return |
DR Revenue; CR AR and/or Customer Credits (AR-first) |
| Sales refund recorded | sale_refund |
Cash/credits effect when kind is cash refund |
| Sales payment reversed | sale_payment_reversal |
Reverse that payment’s JE. If the payment went to custody cash that has since been handed in, the cash leaves the company cash book instead |
| New inventory item created with stock | inventory_opening_stock |
DR Inventory / CR Opening Balance Equity (3900) — quantity × cost, no profit |
| Inventory movement (sale) | inventory_cogs |
DR COGS / CR Inventory |
| Inventory return / reversed sale issue | inventory_cogs_return |
Reverse COGS |
| Approved adjustment — cycle count, physical count, correction | inventory_adjustment |
Inventory vs Inventory Shrinkage & Count Variance (5110) |
| Approved adjustment — damage (or loss) | inventory_adjustment |
Inventory vs Inventory Damage & Loss (5120) |
| Approved adjustment — expiry | inventory_adjustment |
Inventory vs Inventory Expiry Write-offs (5130) |
| Unit cost corrected by an approved adjustment (stock on hand) | inventory_adjustment |
(new − old cost) × quantity; Inventory vs Inventory Revaluation (5140) |
| Internal use / other movements | inventory_adjustment |
Inventory vs Inventory Adjustments (5100) — no sales revenue |
| Warehouse-to-warehouse transfer | — | Not posted (value stays in Inventory) |
Adjustments are valued at the item's carrying cost. A decrease debits the expense account and credits Inventory; a count overage does the reverse, so each expense account shows the net variance for the period. Adjustment journals are dated on the adjustment date (never later than approval), so a period-end count approved after the period still lands in the counted period. If that period is already closed, the journal posts on the approval date instead.
Duplicate event delivery does not double-post. Failures (for example no open period) mark the posting FAILED; a later retry with an open period can succeed on the same key.
Review outcomes under Finance → Postings (/finance/postings).
Manual / ops surfaces in Finance
| Action | Notes |
|---|---|
| Chart of accounts | Accounts → Add account creates a custom account (code, name, type) with finance:account:create. Codes must be unique, and system codes such as 1000–6000 and 3900, plus every 1050-… code (representative custody cash), are reserved. Tap a custom account to rename or deactivate it (finance:account:update). An inactive account keeps its history but can't be used in new entries. System accounts can't be edited, and an account behind an active cash book can't be deactivated. Missing system accounts are restored the next time the list loads. |
| Cash books & payment routing | Cash & bank → Add cash book links a new cash or bank book to an active asset account (finance:cash:transfer). Inventory Asset and non-asset accounts are refused. Where sales payments go picks the cash book that receives each sales payment method (cash, card, transfer, other). A missing method is restored to its default book. Representatives' custody cash books are not listed here and cannot receive a payment method, an expense, a transfer, or a manual or opening-balance line. |
| Cash settlement | Finance → Cash settlements confirms a representative's hand-over (finance:settlement:approve): DR the chosen company cash book / CR their custody cash, with any difference to 1150, 2200 or 6100 (posting_kind cash_settlement). See Cash settlements |
| Record expense | Expense JE from Expenses (finance:expense:create) |
| Record other revenue | Non-sales income JE (finance:journal:create); not counted in Sales MTD |
| Cash transfer | Between cash books when permitted (finance:cash:transfer). Posts a balanced journal (kind=cash_transfer: DR destination / CR source). Cash & bank shows book balances from the ledger and lists recent transfers (tap → journal detail). |
| Opening balances | Initial / migration balances via Opening balances (finance:journal:create). Posts kind=opening_balance into the selected open fiscal year (balanced CoA lines). While the year is open, Revise reverses the prior manual opening-balance journal and posts a corrected one (audit trail). Year-close carry (opening_balance_carry) is not editable here. Year-close still auto-carries balances into the next year. Inventory Asset is not entered here: its value is Σ quantity × cost of your inventory items and grows each time you add an item with stock, so the page shows it read-only. Manual and opening-balance journals that use Inventory Asset are rejected. An older opening balance that already holds an Inventory Asset line is flagged; Revise drops that line, then reduce the matching equity line by the same amount. |
| Close period / fiscal year | Closes P&L into retained earnings and opens the next year (finance:period:close). A fiscal year (always 1 Jan – 31 Dec) can only be closed after it ends. Reopen a closed year (same permission) to correct it |
National e-invoicing
Finance → E-invoicing (/finance/e-invoicing) lists sales documents reported to the tax authority. Jordan (ISTD JoFotara) is the only registered jurisdiction today.
| Step | Behaviour |
|---|---|
| Tracking | Each new sales invoice is tracked as an invoice; each completed sales return as a credit note linked to its invoice. Duplicate events do not create a second record. |
| Settings | E-invoicing settings (finance:einvoice:configure): jurisdiction, seller tax number and legal name, authority settings, credentials, auto-submit. Credentials are write-only and stored encrypted. Enabling requires credentials; changing jurisdiction clears stored credentials. |
| Preview | Validates the document and renders the payload without sending it (finance:einvoice:read). |
| Submit | Send one document, or select up to 50 and submit them as a batch (finance:einvoice:submit). Each attempt is recorded with the authority response. |
| Auto-submit | When the profile is enabled with auto-submit on, a new invoice is sent as soon as it is tracked. A credit note auto-submits only once its original invoice is accepted. |
| Void | Voiding the sales invoice cancels its e-invoice unless the authority already accepted it. |
Statuses: Pending, Submitting, Submitted, Accepted, Rejected, Failed, Needs action, Cancelled.
Dashboard cutover
Merchant Sales MTD / COGS / Gross Profit update from Finance journal events (FinanceJournalPostedEvent and related), not from Sales invoice create alone. Rebuild can replace KPI projections from a Finance snapshot feed.
Related: Overview · Boundaries · Events · Dashboard KPIs · Sales invoices