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>
Migration applied to prod: approved/paid public.bills mirror into
accounting.bills (Payables) with find-or-create vendor + line item
(external_source='acmacc_bill'/'acmacc_vendor'). When an accounting bill is
marked paid (paid_amount>=total), the linked public.bills is set status=paid
(+paid_date, amount_paid) and its bill_approvals marked paid. Loop-guarded
with is-distinct-from. Backfilled 370 bills/45 vendors; totals reconcile.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phase 1: gate the Accounting sidebar item and /dashboard/accounting route
behind isAdmin via a RequireAdmin guard; Financial Reports stay visible.
Phase 2: platform associations now read the Chart of Accounts from
accounting.accounts (single source) instead of public.chart_of_accounts.
Shared fetchChartOfAccounts() normalizes both sources; central COA hooks
and ChartOfAccountsDropdown route through it (reads only, no migration).
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>
Adds DB triggers + backfill so accounting.customers is driven by the
public units/owners roster: one customer per unit, all owners combined,
Units/Owners as source of truth for contact fields. Balances and ledger
links (invoices, payments_received, transactions, work_orders, estimates)
are always preserved. Scoped to associations with an accounting company.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>