Add a dashboard PDF generator that renders the metrics, an Income & Expenses
bar chart, a Top Expenses donut, the invoices overview, and recent transactions
as native PDF vector graphics + selectable text (not a screenshot), using the
shared branded header/footer. Wire an "Export PDF" button into the dashboard
header (association logo, ACM fallback).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Remove the Zoho Books integration (edge functions, sync libs, settings,
reports/overview, banking links, fees tab, import dialog); preserve fee
rules as a standalone FeesTab and the COA accounting_system classification.
- Financial Overview/Reports (staff + board) render the Accounting dashboard
and reports; board reports mirror the rich Accounting Reports.
- New Reserve Fund Schedule report + an is_reserve flag on accounts.
- Unify all report exports to a branded format (logo + centered header +
footer): shared ReportSheet (on-screen) and reportHeader (PDF). Budget vs
Actuals and Bank Reconciliation PDFs now match the reference layout.
- Render financial reports inline (no preview pop-up).
- Budget Management mirrors Accounting Budgeting (staff-accessible) with SPA
navigation; editable bills in the Accounting Bills page.
- Negative opening balances flow through to the GL and reports (allow negative
input; keep non-zero on save; signed CSV import).
- Upload a per-account trial balance via CSV on Opening Balances.
- Board members: read-only RLS access to their association's accounting ledger;
editable board-members panel on the association page; share vendor contacts
with the board (toggle + directory section).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Movement of Equity derived net income from sub-ledgers (calcNetIncome over
invoices/expenses/bills), while the P&L and Balance Sheet use the GL. With any
direct bank-categorized income/expense the two disagreed — Ashley Manor's SCE
was off from the Balance Sheet equity by 9,257.44. Rebuild Movement of Equity
from the GL (current-year earnings + GL equity balances) so all three statements
tie by construction.
Complete the §9 reconciliation matrix: R3 (P&L net income == raw-GL period net
income — guards the P&L builder) and R5 (Movement of Equity ending == Balance
Sheet total equity) are now computed by cross-checking the report builders against
the raw GL; checks render in numeric order. R6 (GL == TB/BS, satisfied by
construction) and R9 (direct vs indirect CFO, only indirect built) shown as N/A
for matrix completeness. Adds 5 reconcile unit tests (12 total).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bridgewater's GL was imported as single-sided postings missing its opening fund
balance, leaving the trial balance off by 130,348.76 with an abnormal debit
equity balance. Record the gap as an Opening Fund Balance equity credit (migration
20260602150000); R1 and the Balance Sheet now tie out exactly.
A/R-A/P sub-ledger checks (R7/R8) only apply to platform-managed companies whose
invoices/bills post to the GL. Imported-GL companies (Bent Oak, Bridgewater) keep
their own AR/AP, so scope R7/R8 to gl_managed companies (new arApApplicable flag
on reconcile + gl_auto_post surfaced in useReportData). Every company now passes
the Reconciliation report.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
renderReportPdf now matches the on-screen comparison: when a comparison period
is active it renders Amount | Comparative | Change | Change % columns (was
Previous | Amount), switches to landscape for room, and underlines each numeric
column on totals. Applies to P&L, Cash Flow, Movement of Equity, and Balance
Sheet exports.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- StructuredTable now renders Comparative + Change + Change % columns when a
comparison period is on (P&L, Cash Flow, Movement of Equity, Balance Sheet).
- Balance Sheet supports an as-of comparison period (prior as-of balances per
account + totals); comparison toggle enabled for it (buildBalanceSheet takes
prior dataset). Current Year Earnings stays independently computed.
- Budget vs Actuals: optional "Compare to" date range adds Compare + Δ-vs-Compare
columns; actuals computation factored into a shared helper for both windows.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Cash Flow Statement now supports a comparison period (prior-period/prior-year/
custom): refactored into computeCashFlow() and renders the comparison column
for Net Income, CFO/CFI/CFF, beginning/ending cash. Previously it ignored the
compare toggle. (P&L and Movement of Equity already had comparison.)
- Budget vs Actuals: budget is now pro-rated to the selected actuals window
(sum each budget period weighted by overlap with the range) instead of always
using the full annual figure — honors monthly/quarterly/annual period_type.
Noted in the on-screen card and the PDF header (B4).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add From/To date inputs to the Budget vs Actuals report (Accounting section
Reports) so actuals can be compared to the budget over any custom range,
independent of the page period preset. Defaults to the report period; drives
the actuals queries and CSV/PDF export labels.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
In the Accounting section Reports (AccountingReportsPage):
- Rebuild the Cash Flow Statement as an indirect-method report derived from the
GL: Net Income + working-capital/non-cash movements, classified into
CFO/CFI/CFF, with Beginning/Ending Cash. Ties to the change in Balance Sheet
cash by construction (R4); surfaces an explicit residual row if it ever doesn't.
- Add R4 to the Reconciliation Checks report.
- Extract the reconciliation matrix into a pure, tested library
(lib/reconcile.ts) and route the Reconciliation report through it.
- Add §10 synthetic-ledger vitest suite (lib/reconcile.test.ts): empty, single
balanced entry, full period, partial settlement (open vs gross §1.5), and
fault ledgers (single-sided → R1; payment-not-applied → R7). Verified R4 ties
for Ashley Manor ($35,727.08 = ΔCash).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Per the Financial Reports Master Spec:
- §1.5 A/R fix: invoice settlements now post to the GL (Dr Undeposited / Cr A/R
from invoice.paid_amount); payments are the cash sub-ledger only and no longer
separately credit A/R (avoids double-count). A/R control = open balance, so
recon R7 passes for managed companies (Ashley Manor 39,248 -> 0). Bills already
settled (R8 ok). Migration applied + backfilled managed companies.
- §9/§10: add a "Reconciliation Checks" report that surfaces R1/R2/R7/R8
residuals (never plugged) so imbalances are visible — e.g. Bridgewater's
imported GL is unbalanced (R1) and its sub-ledgers don't tie (R7/R8).
Imported companies (Bridgewater/Bent Oak) left untouched per decision; their
residuals now surface in the Reconciliation report.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Opening balances now post a single "Opening Balances" journal entry to the GL
(migration applied to prod), scoped to managed companies (imported-GL
associations already carry theirs). Triggers on opening_balances /
opening_balances_setup keep it in sync; Ashley Manor backfilled.
- Balance Sheet: read balances from the GL only (drop the separate opening add,
which also double-counted imported companies).
- Trial Balance: compute balances from journal_entry_lines as of the report date
(was accounts.balance).
- General Ledger report: read from journal_entry_lines (was transactions); opening
rolls in from the GL.
All four reports now share one source. Verified Ashley Manor TB balances
(debits = credits = $90,073.23) with opening cash (BOA +$47,304.31) flowing through.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Drop the branded cover page from all financial/accounting report exports
(P&L, Balance Sheet, Cash Flow, Movement of Equity, AR/AP flats, Trial
Balance, General Ledger, Budget vs Actuals, and the Zoho/Board financial
reports). The general Report Generator's own cover is unchanged.
- Budget vs Actuals now orders accounts as a parent→child tree with
indentation (on screen and in CSV/PDF) instead of flat by account number.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Homeowner "Export/Email Statement" now uses the same generateLedgerStatement
layout as the main-app account statement (account holder, amounts-due
breakdown, categorized columns incl. Pay (AR), no cover page) instead of the
branded-cover table.
- Ledger view: default the "To" date to the latest entry when it's beyond
today, so a payment dated when an invoice was marked paid (updated_at) is no
longer filtered out of the rows / Total Paid.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The customer Ledger tab + statement defaulted to the current calendar year,
so older payments looked missing and didn't line up with the main-app owner
ledger (all-time). Default the "From" date to the earliest transaction
(user can still narrow), so the accounting ledger/statement matches the
main owner ledger.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Budget vs Actuals now exports (CSV + branded PDF); previously the page's
export buttons were disabled for it. Wired into hasOwnExport with its own
buttons in the report.
- Apply the shared branded cover page to the remaining PDF exports so they
match the main scheme: homeowner account Statement (AccountingCustomer
DetailPage), Trial Balance, and General Ledger.
Note: payments already render on the accounting customer ledger/statement
via payments_received (phase 3+4).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extract the general Report Generator's branded cover (cover image/band,
logo, title, prepared-for/by) into shared src/lib/reportCover.ts. Financial
reports now open with the same cover: platform AccountingReportsPage via new
renderReportPdfWithCover(), and the Zoho/Board financial reports
(zohoFinancialReportPdf generators). ReportGeneratorPage refactored to use
the shared module (removes duplicated cover code).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mergeHomeownersByAddress reassigned invoices/transactions/work_orders/
estimates but missed payments_received, orphaning payment references on
the deleted duplicate. Add it to the FK reassignment list.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>