Fix ? / 0.00h display for in-progress shifts

Frontend: pivotWfShifts now skips entries where times='?' and hours=0
— immediately removes the visual glitch from any stale DB rows.

Backend: when today's timesheet pull finds no completed shifts, write
a source='workforce' row instead of skipping, so the stale timesheet
entry is overwritten and rota sync can restore schedule data for today.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-23 12:21:31 +00:00
parent e3c8f143ef
commit b194cf1278
5 changed files with 30 additions and 28 deletions

View file

@ -836,6 +836,8 @@ function pivotWfShifts(wfShifts: Record<string, WfDayData>, dates: string[]): Wf
const day = wfShifts[date]
if (!day) continue
for (const s of day.staff) {
// Skip in-progress timesheet entries — clocked in but no clock-out time yet
if (s.times === '?' && s.hours === 0) continue
if (!members[s.id]) members[s.id] = { id: s.id, name: s.name, days: {} }
members[s.id].days[date] = { hours: s.hours, times: s.times, status: s.status }
}