From 681f73d85add946da7aa82cb28fae80974281b47 Mon Sep 17 00:00:00 2001 From: mariomitte Date: Sat, 8 Aug 2026 01:50:11 +0200 Subject: [PATCH] fix: calculate PREKOVREMENI as total hours minus regular 8h PREKOVREMENI (overtime hours) is now correctly calculated as the difference between total work+travel hours and the standard 8-hour workday. --- frontend/src/components/dashboard/TaskCalendarWidget.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/dashboard/TaskCalendarWidget.jsx b/frontend/src/components/dashboard/TaskCalendarWidget.jsx index c3f871b..71aab62 100644 --- a/frontend/src/components/dashboard/TaskCalendarWidget.jsx +++ b/frontend/src/components/dashboard/TaskCalendarWidget.jsx @@ -320,6 +320,8 @@ export default function TaskCalendarWidget({ tasks = [], notes = [], workOrders totalHours += Number(entry.totalHours || 0); } + const regularHours = 8; + const overtimeHours = Math.max(0, totalHours - regularHours); rows.push({ key, clickable: false, @@ -332,8 +334,8 @@ export default function TaskCalendarWidget({ tasks = [], notes = [], workOrders joinUnique(locations) || '-', startTimes.length ? formatTime(new Date(Math.min(...startTimes.map((item) => item.getTime())))) : '-', endTimes.length ? formatTime(new Date(Math.max(...endTimes.map((item) => item.getTime())))) : '-', - '8', - formatHourValue(totalHours, '0'), + formatHourValue(regularHours, '0'), + formatHourValue(overtimeHours, '0'), joinUnique(workOrderLabels) || '-', ], });