Zeiterfassung Update

* Erstberechnung Überstunden 50%/100% Steuerfrei/Steuerpflichtig
 * Feiertag werden nun in der Buchungsübersicht angezeigt
This commit is contained in:
Spi
2024-04-29 20:15:39 +02:00
parent 258067ef4d
commit 45a07abf0e
5 changed files with 93 additions and 8 deletions
@@ -599,6 +599,7 @@ class TimerecordingController extends mfBaseController
protected function getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear, $startime = null, $endtime = null, $userid = null)
{
$holidayrows = [];
$mustSeconds = 0;
$isSeconds = 0;
$holiDays = 0;
@@ -635,7 +636,7 @@ class TimerecordingController extends mfBaseController
}
}
foreach ($holidays as $holiday) {
$holiDay[date('Y-m-d', $holiday->timestamp)] = $holiday->timestamp;
$holiDay[date('Y-m-d', $holiday->timestamp)] = $holiday->description;
}
if ($datatype == 1) {
@@ -655,6 +656,8 @@ class TimerecordingController extends mfBaseController
$dDay = date('w', $timestamp);
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
$mustSeconds = $mustSeconds + $workingHours[$dDay];
} elseif ($holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
$holidayrows[$timestamp] = $holiDay[$dDate];
}
$timestamp = $timestamp + 86400;
@@ -672,6 +675,8 @@ class TimerecordingController extends mfBaseController
$dDay = date('w', $timestamp);
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
$mustSeconds = $mustSeconds + $workingHours[$dDay];
} elseif ($holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
$holidayrows[$timestamp] = $holiDay[$dDate];
}
$timestamp = $timestamp + 86400;
}
@@ -683,11 +688,13 @@ class TimerecordingController extends mfBaseController
$searchArray = ['user_id' => $userid, 'start' => $firstdate, 'end' => $lastdate];
$timestamp = $firstdate;
for ($i = 1; $i <= $daycount; $i++) {
for ($i = 1; $i <= 366; $i++) {
$dDate = date('Y-m-d', $timestamp);
$dDay = date('w', $timestamp);
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
$mustSeconds = $mustSeconds + $workingHours[$dDay];
} elseif ($holiDay[$dDate]) {
$holidayrows[$timestamp] = $holiDay[$dDate];
}
$timestamp = $timestamp + 86400;
}
@@ -928,6 +935,18 @@ class TimerecordingController extends mfBaseController
);
}
endforeach;
foreach ($holidayrows as $key => $holidayrow) {
$day = $daysgerm[date("w", $key)];
$rows[] = array(
'date' => array('date' => '<span class="text-bold holiday-text">'.$day." ".date("d.m.Y",$key).'</span>', 'order' => $key),
'start' => array('start' => "-", 'order' => "-"),
'end' => array('end' => "-", 'order' => "-"),
'sum' => array('sum' => "-", 'order' => "-"),
'category' => array('category' => '<span class="text-bold holiday-text">Feiertag <i class="far fa-fw fa-umbrella-beach "></i></span>', 'order' => 'Feiertag'),
'comment' => array('comment' => '<span class="text-bold holiday-text">'.$holidayrow.'</span>', 'order' => $holidayrow),
'edit' => array('edit' => "", 'order' => ""),
);
}
if ($datatype == 5) {
$response['is'] = $isSeconds;
$response['must'] = $mustSeconds;