Module 17 · Finance Hub & ERP

Finance
Hub & ERP

Campus-scoped operations under /dashboard/finance: AR/cash visibility, journals, budgets, expense claims, day-close, payables, and doctor-share payouts. Invoice pay/refund mutations stay in Billing.

Purpose

Give finance officers a Working-in campus ledger view of receivables, collections, cash close, ERP posting (COA/journals/budgets/claims), supplier AP, and doctor-share settlement — without conflating clinical Branch geography with HR OrgUnit.

Who uses it

  • → Finance officers / CFO delegates
  • → Billing supervisors (read companions on AR/cash tabs)
  • → Cashier leads (day-close / cashier shift)
  • → Procurement (supplier payables); share settlement clerks
Workflows

How Finance Relates to Billing

1

Observe Campus Cash & AR

Overview KPIs, Receivables aging, Collections, Advances/Refunds mirrors, Revenue-by-source, Payer mix, AR SLA, Claims queue.

Behind the scenes: Mutations for pay/refund/advance remain in Billing. finance:view opens Overview only — other tabs need their own finance:*:view (or manage).
2

Close the Day / Shift

Cash summary + variance → Day close snapshot → optional Cashier shift with declared cash. Reopen mis-closed packets with audited reason.

Behind the scenes: Close and reopen require finance:*-close (+ manage) AND branches:create:mine|all. Concrete Working-in campus required (not All).
3

ERP: Journals, Budgets, Claims

Maintain COA; post/reverse journals; budget draft→approve→freeze; expense claims with optional budget lines and media receipts.

Behind the scenes: Auto-posting from payments, GRN payables, payroll pay, and expense pay when mapping rules exist. Feature flag finance_hub required.
4

Payables & Doctor Share

Pay GRN supplier AP; settle doctor share (single Pay or Settle batch ≤25) with optional soft AI narrative; void / sync accruals with edit geo.

Behind the scenes: Pay needs create geo; void/accruals sync need edit geo. billing:manage alone cannot heal accruals or pay share. No invented finance:doctor-share:batch grant.
Hub Sections

Major Sidebar Areas

Journals & COA

What

Campus chart of accounts and balanced journal entries (manual + system sourceType).

Why

External accounting needs a posted ledger, not only invoice screens.

How

finance:journals:view|create|reverse; reverse posts an offsetting entry with reason.

Budgets & Utilization

What

Budget plans (draft→submit→approve→active/freeze) and utilization dashboards.

Why

PO and expense commits must stay inside fiscal envelopes.

How

finance:budget:*; inventory PO approve may call budgets/check.

Expense Claims

What

Staff expense claims with categories, budget lines, receipt uploads, approvals, pay.

Why

Operational spend outside payroll needs controlled reimbursement.

How

finance:expenses:* workflow; distinct from Payroll cost read tab under Expenses nav.

Day Close & Cashier Shift

What

Persisted daily cash packets and per-cashier declared counts with reopen.

Why

End-of-day control and variance investigation.

How

Create geography for close/reopen; history endpoints; payroll outflows included in draft.

Supplier Payables

What

Open AP from posted GRN; record payment; optional budget consumption + GL.

Why

Procurement liabilities must clear into cash and ledger.

How

finance:payables:view|pay; Working-in campus lists.

Doctor Share & Payouts

What

Accrual ledger, payouts, Settle batch wizard, void, share-basis reconciliation.

Why

Clinician revenue share settles independently of patient collections UI.

How

finance:doctor-share:view|pay|void; cash shareBase* math; MFA step-up on batch when enrolled.

Insights & Exports

What

AI briefing/anomalies, duplicate payments, refund leakage, watchlist, CSV/Xero-style exports.

Why

Controls and external systems need extracts without inventing new RBAC for each detector.

How

finance:ai:* / section view grants; finance:exports alone does not open the hub.

Technical Architecture

FieldTypeInstitutional Role
branchIdUUIDClinical campus stamp from Working-in.
sourceTypeEnum/StringJournal origin (manual vs auto-posting).
statusEnumDay-close/cashier: closed|reopened; budgets: draft→active/frozen.
shareAccruedDecimalDoctor-share accrual balance (cash share base).

Note: Sensitive fields use AES-256 field-level encryption where applicable.

Governance & Power

finance:view
finance:journals:view
finance:budget:view
finance:day-close:view
finance:payables:view
finance:doctor-share:view
finance:doctor-share:pay
finance:manage
1
Billing settles

Cashier pays / refunds / advances in Billing module.

2
Finance observes

AR, collections, cash summary update for Working-in.

3
Close & ERP

Day-close + journals/budgets/payables as required.

4
Share payout

Settle doctor share with create geo; void with edit geo.

Sidebar-only navigation (no in-page tabs). Bookmark /dashboard/finance redirects to first permitted section.