Zeiterfassung Update
* Berechnungen für Austritte implementiert.
This commit is contained in:
@@ -553,7 +553,13 @@ class TimerecordingController extends mfBaseController
|
||||
$overtime_timestamp = $employee->startdate;
|
||||
$overtime_now = $overtime;
|
||||
}
|
||||
$endtime = time() - 86400;
|
||||
if ($employee->enddate && $employee->enddate < time() - 86400) {
|
||||
$endtime = strtotime(date("Y-m-d", $employee->enddate) . " 23:59:00");
|
||||
} else {
|
||||
$endtime = time() - 86400;
|
||||
}
|
||||
|
||||
|
||||
$endtime = date("Y-m-d", $endtime);
|
||||
$endtime = strtotime($endtime . " 23:59:00");
|
||||
|
||||
@@ -608,6 +614,12 @@ class TimerecordingController extends mfBaseController
|
||||
$plusHours = $employee[0]->plushours_now;
|
||||
$auto_workinghours = $employee[0]->auto_workinghours;
|
||||
$startdate = $employee[0]->startdate;
|
||||
if ($employee[0]->enddate) {
|
||||
$enddate = strtotime(date('Y-m-d', $employee[0]->enddate) . " 23:59:59");
|
||||
} else {
|
||||
$enddate = 2208985200;
|
||||
}
|
||||
|
||||
$overtime = $employee[0]->overtime_now;
|
||||
}
|
||||
$workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $userid]);
|
||||
@@ -641,7 +653,7 @@ class TimerecordingController extends mfBaseController
|
||||
for ($i = 1; $i <= 7; $i++) {
|
||||
$dDate = date('Y-m-d', $timestamp);
|
||||
$dDay = date('w', $timestamp);
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) {
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
|
||||
$mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||
}
|
||||
|
||||
@@ -658,7 +670,7 @@ class TimerecordingController extends mfBaseController
|
||||
for ($i = 1; $i <= $daycount; $i++) {
|
||||
$dDate = date('Y-m-d', $timestamp);
|
||||
$dDay = date('w', $timestamp);
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) {
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
|
||||
$mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||
}
|
||||
$timestamp = $timestamp + 86400;
|
||||
@@ -674,7 +686,7 @@ class TimerecordingController extends mfBaseController
|
||||
for ($i = 1; $i <= $daycount; $i++) {
|
||||
$dDate = date('Y-m-d', $timestamp);
|
||||
$dDay = date('w', $timestamp);
|
||||
if (!$holiDay[$dDate]) {
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
|
||||
$mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||
}
|
||||
$timestamp = $timestamp + 86400;
|
||||
|
||||
@@ -411,6 +411,11 @@ class TimerecordingReportController extends mfBaseController
|
||||
$overtime_now = $employee[0]->overtime_now;
|
||||
$auto_workinghours = $employee[0]->auto_workinghours;
|
||||
$startdate = $employee[0]->startdate;
|
||||
if ($employee[0]->enddate) {
|
||||
$enddate = strtotime(date('Y-m-d', $employee[0]->enddate) . " 23:59:59");
|
||||
} else {
|
||||
$enddate = 2208985200;
|
||||
}
|
||||
$bpahours = $employee[0]->bpahours;
|
||||
}
|
||||
$workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $user_id]);
|
||||
@@ -445,7 +450,7 @@ class TimerecordingReportController extends mfBaseController
|
||||
$dDate = date('Y-m-d', $timestamp);
|
||||
$dDay = date('w', $timestamp);
|
||||
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) {
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
|
||||
$mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||
}
|
||||
|
||||
@@ -466,7 +471,7 @@ class TimerecordingReportController extends mfBaseController
|
||||
for ($i = 1; $i <= $daycount; $i++) {
|
||||
$dDate = date('Y-m-d', $timestamp);
|
||||
$dDay = date('w', $timestamp);
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) {
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
|
||||
$mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user