olsch01 739ccaeed4 Fix account balances showing $0 and dashboard KPIs on new tenants
Root cause: multiple issues with balance computation across the system.

Accounts list:
- findAll() was doing SELECT * FROM accounts, returning the stale
  denormalized `balance` column (always 0). Now computes balances from
  journal entries using proper double-entry logic (debit-credit for
  assets/expenses, credit-debit for liabilities/equity/income).

Dashboard KPIs:
- Total Cash filtered by name LIKE '%Cash%' which missed accounts not
  named "Cash". Now queries ALL asset accounts regardless of name.
- Reserve Fund queried the legacy reserve_components.current_fund_balance
  column. Now computes from journal entries on reserve asset accounts.

Opening balance journal entries:
- On blank tenants, equity offset accounts (3000/3100) don't exist, so
  the balancing journal entry line was silently skipped, leaving entries
  unbalanced. Now auto-creates Operating Fund Balance (3000) and Reserve
  Fund Balance (3100) equity accounts when needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 19:11:00 -05:00
Description
HOA Financial Intelligence Platform - Multi-tenant financial management for homeowner associations
2.3 MiB
Languages
TypeScript 97.6%
Shell 1.8%
PLpgSQL 0.2%
Dockerfile 0.2%
HTML 0.1%