- 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>
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>