diff --git a/backend/src/lib/workforce.js b/backend/src/lib/workforce.js index 28a87c2..58028d2 100644 --- a/backend/src/lib/workforce.js +++ b/backend/src/lib/workforce.js @@ -94,10 +94,9 @@ function weeklyFetchDates(from, to) { } // Fetch timesheets for a single date — no location param (mirrors PBI pattern). -// Returns the weekly timesheet record(s) containing this date. -// Each record: { id, user_id, shifts: [{ department_id, date, cost, leave_request_id, ... }] } +// include_oncosts=true is required to get cost_with_oncosts on nested shifts[]. async function fetchTimesheetsForDate(dateStr) { - try { return await wfFetchPaged(`/api/v2/timesheets/on/${dateStr}?show_costs=true`) } + try { return await wfFetchPaged(`/api/v2/timesheets/on/${dateStr}?show_costs=true&include_oncosts=true`) } catch { return [] } }