Commit graph

14 commits

Author SHA1 Message Date
4cba6a2ffa Expand compare diagnostic: location filter variants + per-day timesheets fallback
Adds four endpoint variants (A-D) to isolate the location filter discrepancy:
report_location_id vs location_id vs no filter vs timesheets range. If the
timesheets range 404s, auto-falls back to per-day /timesheets/on/{date} fetch
(variant E) so we can see timesheet totals regardless of API version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 13:48:42 +00:00
c15147b298 Add endpoint comparison diagnostic for cost figure discrepancies
GET /wages/api/sync/compare?from=YYYY-MM-DD&to=YYYY-MM-DD returns cost totals
from four Workforce endpoint variants side-by-side: shifts (all statuses),
shifts (APPROVED only), timesheets (all statuses), timesheets (APPROVED only).
Useful for identifying which endpoint matches the expected payroll figure.
Also adds data.timesheets to wfFetchPaged response unwrap chain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 13:43:19 +00:00
d04cd1e82c Monthly view: rota boundary, EOM PY card, % Budget headline; backfill 25 months
Rota forecasting: only trust Workforce rota for the current Mon–Sun week —
beyond that use prior-week actuals to avoid incomplete next-week rotas
deflating the EOM forecast.

% vs Budget cards (Weekly + Monthly): show as coloured headline number
(green/amber/red) instead of small pct-badge chip, matching other cards.

Forecast EOM: PY sub-label shows full prior-year month total + % delta,
replacing the static "rota + prior-week actual" note once PY data exists.
Achieves this by fetching the full PY month rather than MTD-capped range,
then deriving both MTD (for Actual MTD card) and full-month (for EOM card).

Backfill depth: 13 → 25 months so past months in Rolling 12 have PY wage
data available (viewing Dec 2024 needs Dec 2023 = 19 months ago).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 12:08:13 +00:00
c6166f31d0 Batch net-sales requests in ≤365-day chunks — forecasting API 422s at 396 days 2026-07-23 11:52:05 +00:00
95103280c3 Fix employee name lookup — use name field not first_name/last_name; remove temp logs 2026-07-23 11:33:45 +00:00
6661189127 Fix getUserNameMap location filter; fix detail cost filter to match aggregate 2026-07-23 11:32:28 +00:00
cf0cd0a5e4 Temp: log user fields + shift status cost breakdown 2026-07-23 11:31:03 +00:00
5372111f52 Add per-employee dept breakdown via modal popup
Stores per-employee shift costs in wage_actuals_detail (APPROVED shifts
only). Sync fetches employee name map from /api/v2/users alongside dept
names. Clicking any dept row in Weekly or Monthly opens a modal showing
Employee · Shifts · Cost · % of Dept, fetched on demand.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 11:02:11 +00:00
91936ab131 Remove temp shift sample log 2026-07-23 10:57:50 +00:00
21391d4122 Temp: log raw shift sample for field inspection 2026-07-23 10:55:54 +00:00
605feaab4e Batch scheduled sync in 7-day chunks (API limit is 7 days)
Schedules endpoint has same 7-day limit as shifts. The 14-day forward
window was being fetched in one call — split into two 7-day batches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 09:54:09 +00:00
3e1851fa6d Add department budget % allocation
- Budgets page: new dept split section with % inputs, equal-split button, save
- Weekly/Monthly: per-dept budget column using dept pcts from actuals response
- Backend: dept_budget_pcts in ALLOWED_KEYS; actuals returns dept_pcts map;
  budgets route adds GET /dept-config + PUT /dept-pcts endpoints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 09:43:39 +00:00
4d6e53a1f8 Fix rolling sync: batch actuals in 7-day chunks (API limit 31 days) 2026-07-23 09:18:15 +00:00
2e0592eb90 Initial scaffold: wages app
Full wage cost reporting app — weekly/monthly views, rolling 12-week/12-month
history, budget management, Workforce API sync with SSE backfill, net sales
via forecasting public API, department filter, CSV export.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 09:03:52 +00:00