Commit Graph

107 Commits

Author SHA1 Message Date
admin 0e34d18adf Accounting homeowner ledger/statement defaults to full history
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>
2026-06-01 22:06:06 -04:00
admin b77860772e Fix report exports: Budget vs Actuals + branded cover everywhere
- 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>
2026-06-01 22:00:57 -04:00
admin 8360363a15 Unify financial report styling with branded cover page
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>
2026-06-01 21:49:34 -04:00
admin 2d216e24c9 Sync owner ledger + payments into Accounting
DB triggers on public.owner_ledger_entries (migration applied to prod):
charges (debit) -> accounting.invoices; payments (credit) ->
accounting.payments_received (deposited=false, Undeposited Funds). Customer
balance recomputed authoritatively from the source ledger; ledger payments
FIFO-applied to ledger invoices. Keyed external_source='acmacc_ledger'.
Backfilled 6,756 invoices + 4,253 payments; balances reconcile exactly.

Frontend: customer Ledger tab now renders real payments_received credits
(true dates/amounts); Make Deposit page surfaces undeposited payments_received
alongside Undeposited Funds transactions and deposits both.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 21:36:55 -04:00
admin 8ac0edfbd9 Admin-only Accounting tab + platform COA consolidation
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>
2026-06-01 21:21:48 -04:00
admin 64aad1d283 Reassign payments_received when merging homeowners
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>
2026-06-01 21:00:25 -04:00
admin 183fe0a93c Add ACMCC app source, Supabase backend, and project config
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 20:19:26 -04:00