Zeiterfassung Update

* Soll zeiten nun vom Startdatum abhängig
 * Neue Summierung der Sollzeiten in der Personalverwaltung
 * Urlaubstage werden nun Tage statt Stunden angezeigt (in Buchungen und Auswertungen)
 * Urlaube werden nun bis 1.1.2024 berücksichtigt
This commit is contained in:
Spitzer Daniel
2024-03-04 12:26:35 +01:00
parent cc00f70cd6
commit 65d313b6d1
2 changed files with 28 additions and 9 deletions

View File

@@ -325,7 +325,8 @@ class TimerecordingController extends mfBaseController
$realholiDay[date('Y-m-d', $realHoliday->timestamp)] = $realHoliday->timestamp;
}
if (!$holidays_timestamp) {
$holidays_timestamp = $employee->startdate;
//$holidays_timestamp = $employee->startdate;
$holidays_timestamp = strtotime('2024-01-01 00:00:00');
$holidays_now = $holidays;
}
$timerecordings = TimerecordingModel::search(['user_id' => $userid, 'start' => $holidays_timestamp, 'timerecordingCategory_id' => 3]);
@@ -408,7 +409,7 @@ class TimerecordingController extends mfBaseController
$isSeconds = 0;
$holiDays = 0;
$plusHours = 0;
$startdate=time();
$startdate = time();
if (!$userid) {
$userid = $this->me->id;
}
@@ -527,6 +528,7 @@ class TimerecordingController extends mfBaseController
$state = "";
$enddate = "";
$sum = "-";
$day = "";
$orderdate = $timerecording->start;
if ($timerecording->timerecordingCategory->hourday == 1) {
@@ -561,12 +563,16 @@ class TimerecordingController extends mfBaseController
}
$summcounter = 0;
$savecounter = 0;
$sumdays = 0;
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
$holidaycounter = $workingHours[date("w", $i)];
$daycheck = date("Y-m-d", $i);
if (!$holiDay[$daycheck]) {
$isSeconds = $isSeconds + $holidaycounter;
$summcounter = $summcounter + $holidaycounter;
if ($holidaycounter) {
$isSeconds = $isSeconds + $holidaycounter;
$summcounter = $summcounter + $holidaycounter;
$sumdays++;
}
}
if ($savecounter == 1000) {
echo $savecounter;
@@ -577,8 +583,12 @@ class TimerecordingController extends mfBaseController
$seconds = $summcounter;
$minutes = floor(($seconds % 3600) / 60);
$hours = floor($seconds / 3600);
$sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes);
// $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes);
if ($sumdays == 1 || $sumdays == 0) {
$sum = $sumdays . " Tag";
} else if ($sumdays > 1) {
$sum = $sumdays . " Tage";
}
} else if ($timerecording->timerecordingCategory->hourday == 3 && !$timerecording->end) {
$date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time());;
$datadate = date("Y-m-d", $timerecording->start);

View File

@@ -189,13 +189,17 @@ class TimerecordingReportController extends mfBaseController
}
$summcounter = 0;
$savecounter = 0;
$sumdays = 0;
// echo $starttimecalc."<br>";
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
$holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)];
$daycheck = date("Y-m-d", $i);
if (!$holiDay[$daycheck]) {
$isSeconds = $isSeconds + $holidaycounter;
$summcounter = $summcounter + $holidaycounter;;
if ($holidaycounter) {
$isSeconds = $isSeconds + $holidaycounter;
$summcounter = $summcounter + $holidaycounter;
$sumdays++;
}
}
if ($savecounter == 1000) {
echo $savecounter;
@@ -206,7 +210,12 @@ class TimerecordingReportController extends mfBaseController
$seconds = $summcounter;
$minutes = floor(($seconds % 3600) / 60);
$hours = floor($seconds / 3600);
$sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes);
// $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes);
if ($sumdays == 1 || $sumdays == 0) {
$sum = $sumdays . " Tag";
} else if ($sumdays > 1) {
$sum = $sumdays . " Tage";
}
} else if ($timerecording->timerecordingCategory->hourday == 3 && !$timerecording->end) {
$date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time());;