Merge branch 'spidev' into 'master'
Zeiterfassung Update See merge request fronk/thetool!282
This commit is contained in:
@@ -343,7 +343,7 @@ class TimerecordingController extends mfBaseController
|
||||
$this->redirect("Timerecording");
|
||||
}
|
||||
|
||||
protected function updateHolidays($userid)
|
||||
public function updateHolidays($userid)
|
||||
{
|
||||
$employee = TimerecordingEmployeeModel::search(['user_id' => $userid]);
|
||||
if ($employee) {
|
||||
@@ -387,7 +387,7 @@ class TimerecordingController extends mfBaseController
|
||||
}
|
||||
//check if holiday is already in the list
|
||||
foreach ($holidayDays as $key => $holidayDay) {
|
||||
if ($realholiDay[$key]) {
|
||||
if (($realholiDay[$key])) {
|
||||
|
||||
} else if ($workingHours[date('w', strtotime($key))]) {
|
||||
$holidays_now--;
|
||||
@@ -457,6 +457,7 @@ class TimerecordingController extends mfBaseController
|
||||
$plusHours = $employee[0]->plushours_now;
|
||||
$auto_workinghours = $employee[0]->auto_workinghours;
|
||||
$startdate = $employee[0]->startdate;
|
||||
$overtime = $employee[0]->overtime;
|
||||
}
|
||||
$workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $userid]);
|
||||
$holidays = TimerecordingHolidayModel::getAll();
|
||||
@@ -509,11 +510,8 @@ class TimerecordingController extends mfBaseController
|
||||
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) {
|
||||
$mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||
}
|
||||
|
||||
$timestamp = $timestamp + 86400;
|
||||
}
|
||||
|
||||
|
||||
} else if ($datatype == 3) {
|
||||
$firstdate = strtotime(date("Y-01-01", $datayear));
|
||||
$lastdate = strtotime(date("Y-12-31 23:59:59", $datayear));
|
||||
@@ -528,11 +526,8 @@ class TimerecordingController extends mfBaseController
|
||||
if (!$holiDay[$dDate]) {
|
||||
$mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||
}
|
||||
|
||||
$timestamp = $timestamp + 86400;
|
||||
}
|
||||
|
||||
|
||||
} else if ($datatype == 5) {
|
||||
$firstdate = $startime;
|
||||
$lastdate = $endtime;
|
||||
@@ -565,7 +560,6 @@ class TimerecordingController extends mfBaseController
|
||||
$state = "";
|
||||
$enddate = "";
|
||||
$sum = "-";
|
||||
|
||||
$day = "";
|
||||
$orderdate = $timerecording->start;
|
||||
if ($timerecording->timerecordingCategory->hourday == 1) {
|
||||
@@ -742,6 +736,7 @@ class TimerecordingController extends mfBaseController
|
||||
$response['must'] = $mustSeconds;
|
||||
return $response;
|
||||
} else {
|
||||
$plusHours = $overtime + $plusHours;
|
||||
if ($plusHours < 0) {
|
||||
$plusHours = $plusHours * -1;
|
||||
$plusHours = "-" . sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHours / 60 % 60));
|
||||
|
||||
Reference in New Issue
Block a user