Skip to content

Accounting page — period-aware Overview dashboard tiles (collapsible)

Why

The Accounting page's three "stat cards" (Accounts / Journal Entries / Posted Entries) were vanity counts the owner didn't find useful. They wanted period- aware, decision-useful tiles governed by the global Period selector (T-058), and the cards made collapsible.

What shipped (origin/nightly d2ea5425)

New components/accounting/AccountingOverview.tsx replacing the 3 cards. Five tiles, all governed by useAccountingPeriod() (the single period source):

  1. Cash position — Σ balance of GL asset accounts whose linkedBankAccount is set, summed from the Balance Sheet assets[] as of the period end. Robust signal (the seed COA links 1000/1001/… → ERL-DSB-*), NOT a GL-code-range guess.
  2. Net · {period}pnl.data.netIncome (+ revenue / expenses sub-line), green/red by sign.
  3. Receivablesar.data.summary.total (+ ['90+'] overdue in red).
  4. To review — unmatched + partial bank-tx count from useTransactionStats (intentionally a GLOBAL inbox metric, not period-scoped). Clicking deep-links to the Bank Transactions tab pre-filtered to unmatched.
  5. Months closed — closed / total months in the selected period, with a progress bar (fetches /api/accounting/periods, counts via monthsInRange).

  6. Consumes the SAME report query results the page already fetched (pnl/bs/ar are passed in as props — no second fetch). Single source of truth.

  7. Collapsible; state persisted to localStorage (eop.accounting.overviewCollapsed). Default expanded (these tiles are useful, unlike the old vanity cards).
  8. Deep-link wiring: BankTransactionsTab gained a controlled Status-column filteredValue (synced via the table onChange) + a reviewSignal prop; the tile bumps the signal and setActiveTab("transactions"), pre-filtering to unmatched and clearing the date range so every unmatched tx shows.

Verification

tsc + lint clean (new file lint-clean; edits added zero new errors). Full suite 325/325. Couldn't browser-verify — the Accounting page is auth-gated, so the local preview can't reach it; eyeball on the nightly preview (p-eop).

T-058 (period selector this builds on), T-060 (table column widths, same owner request).