feat(dashboard): revenue "year" tile toggles 365 days ↔ calendar YTD

Per request, keep the dashboard to four tiles rather than adding a fifth: the
"Revenue · last 365 days" tile is now clickable and toggles in place between
the trailing-365-day window and calendar year-to-date (since Jan 1).

- adminDashboard: new calendar-year cutoff + revenue.calendarYearMinor (same
  cash-basis paid_at window logic as the existing trio).
- StatCard gains an optional onClick (renders as a button); the year tile uses
  it, with a "Tap to switch window" hint for discoverability.
- bills.service CrmOverviewStats.revenue gains calendarYearMinor.
This commit is contained in:
Luca
2026-06-29 19:39:40 +02:00
parent e96ef4c5a3
commit d1c9e02bcf
3 changed files with 40 additions and 9 deletions
+3
View File
@@ -386,6 +386,9 @@ export interface CrmOverviewStats {
monthMinor: number;
quarterMinor: number;
yearMinor: number;
/** Revenue since Jan 1 of the current year (calendar YTD). The
* dashboard's "year" tile toggles between this and yearMinor. */
calendarYearMinor: number;
};
outstanding: {
totalMinor: number;