RUBRIC Money Tab — Revenue Chips + YTD Comparison

Shipped: 2026-08-07 (Dustin-requested; /opt/scripts commits 4ab3df4 + same-day follow-ups — collector v6). Extends the Money tab (fleet.json money.revenue) with all-time revenue context above the four cash chips.

Layout

Row 1: Revenue — since inception (spans both columns). Row 2: Revenue — {year} YTD (left) + YTD by year — through {month day} (right). Below: the original four cash chips (Outstanding AR — now with per-branch invoice count + total inline — Received 30d, Parked, Written off).

Calculation (collect_revenue in /opt/scripts/rubric-fleet-collector.py)

  • Collected revenue only: paid invoices, by invoice date. Union of the Xero archive’s ACCREC PAID rows (blkhse era — /data/xero-archive/ invoices.json, archive final) and Supabase invoice_status=Paid (paginated past the 1000-row PostgREST cap).
  • Dedup by invoice number — legacy Supabase rows carry their Xero INV-#### numbers verbatim (~1,266 overlaps at launch). Supabase wins on overlap but falls back to the Xero amount when its invoice_total is null.
  • Write-off invoices excluded entirely (they read Paid but no cash was collected — reference_invoice_writeoff convention).
  • Prior-year YTD (ytd_prior + ytd_cutoff): same Jan-1→today month-day window applied to each complete-record year (2023+). 2022 excluded — Xero coverage begins 2022-03-22, so a Jan-anchored window would fake a bad year. Feb-29 cutoffs are harmless (string-range compare, no date construction).

Record boundaries (verified 2026-08-07)

Earliest invoice anywhere: 2019-04-15 (three JES 6-digit-numbered invoices, 2,963,851 inception / 2,395 invoices; 2026 YTD 437,900 / 2024 267,652 through Aug 7.

Data flow

collector (claude crontab */15) → data/fleet.json money.revenue → renderMoney in templates/scaffold/index.html (#money-rev grid; CSS .money-rev-span spans the inception card). revenue_ytd also lands in fleet-history.jsonl per run for trends. Patch inventory: templates/money/README.md.