Zeiterfassung

* Anpassungen für Conny Reports für Jahresübersicht
This commit is contained in:
Daniel Spitzer
2025-07-29 15:24:03 +02:00
parent 8cc6e128ba
commit 9f63b56403
5 changed files with 333 additions and 13 deletions

View File

@@ -98,9 +98,8 @@ class TimerecordingReportController extends mfBaseController
$workinghourshistory = TimerecordingEmployeeWorkingHourHistoryModel::getAll();
if ($workinghourshistory) {
$workingHoursHistory[2147483500] = $workingHours;
foreach ($workinghourshistory as $workinghourhistory) {
$workingHoursHistory[$workinghourshistory->user_id][2147483500] = $workingHours;
$workingHoursHistory[$workinghourhistory->user_id][2147483500] = $workingHours[$workinghourhistory->user_id];
$whenddate = $workinghourhistory->enddate;
$workinghourhistoryhours = json_decode($workinghourhistory->workinghours, true);
foreach ($workinghourhistoryhours as $workinghourhistoryhour) {
@@ -112,12 +111,8 @@ class TimerecordingReportController extends mfBaseController
$workingHoursHistory[$workinghourhistory->user_id][$whenddate][$workinghourhistoryhour['day']] = $workingHoursHistory[$whenddate][$workinghourhistoryhour['day']] + $whend - $whstart;
}
}
// echo $workinghourhistory->user_id."<br>";
}
}
// var_dump($workingHoursHistory);
// die();
foreach ($this->holidays as $holiday) {
$holiDay[date('Y-m-d', $holiday->timestamp)] = $holiday->timestamp;
@@ -182,6 +177,30 @@ class TimerecordingReportController extends mfBaseController
}
} else if ($datatype == 5) {
$firstdate = strtotime(date("Y-01-01", $datayear));
$lastdate = strtotime(date("Y-12-31 23:59:59", $datayear));
$daycount = date("t", $datamonth);
$lastdate = strtotime(date("Y-m-d", $lastdate) . ' 23:59:59');
if ($calendar == "1") {
$lastdate = strtotime(" +3 years", $lastdate);
}
$searchArray = ['start' => $firstdate, 'end' => $lastdate];
$timestamp = $firstdate;
for ($i = 1; $i <= $daycount; $i++) {
$dDate = date('Y-m-d', $timestamp);
$dDay = date('w', $timestamp);
if (!$holiDay[$dDate]) {
//$mustSeconds = $mustSeconds + $workingHours[$dDay];
}
$timestamp = $timestamp + 86400;
}
}