From 1a5de8d3fc8923bd191180cbe7b1d92bd9869636 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Tue, 21 Jul 2026 15:50:33 +0000 Subject: [PATCH] =?UTF-8?q?Remove=20break=20deductions=20from=20shift=20ho?= =?UTF-8?q?urs=20=E2=80=94=20show=20raw=20on-site=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- backend/src/lib/workforce.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/src/lib/workforce.js b/backend/src/lib/workforce.js index a533236..090685a 100644 --- a/backend/src/lib/workforce.js +++ b/backend/src/lib/workforce.js @@ -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: [] }