Remove break deductions from shift hours — show raw on-site time
The planner needs to know who is available and for how long (scheduling), not paid hours after payroll deductions. Workforce was returning explicit break data for some shifts (e.g. a 30-min break on a 12:00–14:00 shift), causing those hours to display short. Strip all break logic and use raw start→finish duration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e0b0f2f275
commit
1a5de8d3fc
1 changed files with 1 additions and 5 deletions
|
|
@ -92,11 +92,7 @@ export async function fetchShifts(from, to, deptIds) {
|
|||
|
||||
const date = new Date(s.start * 1000).toISOString().slice(0, 10)
|
||||
|
||||
let breakHrs = 0
|
||||
if (Array.isArray(s.breaks) && s.breaks.length) {
|
||||
breakHrs = s.breaks.reduce((sum, b) => sum + (b.finish - b.start) / 3600, 0)
|
||||
}
|
||||
const shiftHrs = Math.max(0, (s.finish - s.start) / 3600 - breakHrs)
|
||||
const shiftHrs = (s.finish - s.start) / 3600
|
||||
|
||||
if (!byUser[uid]) byUser[uid] = {}
|
||||
if (!byUser[uid][date]) byUser[uid][date] = { hours: 0, shifts: [] }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue