fix: calculate PREKOVREMENI as total hours minus regular 8h
Some checks failed
ERP CI/CD Pipeline / test (push) Has been cancelled
ERP CI/CD Pipeline / Deploy (server git pull + compose) (push) Has been cancelled

PREKOVREMENI (overtime hours) is now correctly calculated as the difference between total work+travel hours and the standard 8-hour workday.
This commit is contained in:
mariomitte
2026-08-08 01:50:11 +02:00
parent 181cab1f45
commit 681f73d85a

View File

@@ -320,6 +320,8 @@ export default function TaskCalendarWidget({ tasks = [], notes = [], workOrders
totalHours += Number(entry.totalHours || 0); totalHours += Number(entry.totalHours || 0);
} }
const regularHours = 8;
const overtimeHours = Math.max(0, totalHours - regularHours);
rows.push({ rows.push({
key, key,
clickable: false, clickable: false,
@@ -332,8 +334,8 @@ export default function TaskCalendarWidget({ tasks = [], notes = [], workOrders
joinUnique(locations) || '-', joinUnique(locations) || '-',
startTimes.length ? formatTime(new Date(Math.min(...startTimes.map((item) => item.getTime())))) : '-', startTimes.length ? formatTime(new Date(Math.min(...startTimes.map((item) => item.getTime())))) : '-',
endTimes.length ? formatTime(new Date(Math.max(...endTimes.map((item) => item.getTime())))) : '-', endTimes.length ? formatTime(new Date(Math.max(...endTimes.map((item) => item.getTime())))) : '-',
'8', formatHourValue(regularHours, '0'),
formatHourValue(totalHours, '0'), formatHourValue(overtimeHours, '0'),
joinUnique(workOrderLabels) || '-', joinUnique(workOrderLabels) || '-',
], ],
}); });