diff --git a/Layout/default/TimerecordingEmployee/Index.php b/Layout/default/TimerecordingEmployee/Index.php
index 6d4534690..760210ad2 100644
--- a/Layout/default/TimerecordingEmployee/Index.php
+++ b/Layout/default/TimerecordingEmployee/Index.php
@@ -97,8 +97,8 @@ $type[3] = "Lehrling";
= $sum ?> |
= $plusHours ?> |
- = sprintf('%02d:%02d', floor($timerecordingemployees[$timerecordinguser->id]['overtime_now'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['overtime_now'] / 60 % 60)) ?> |
- = ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> |
+ = sprintf('%02d:%02d', floor($timerecordingemployees[$timerecordinguser->id]['overtime'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['overtime'] / 60 % 60)) ?> |
+ = ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> |
= ($timerecordingemployees[$timerecordinguser->id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?> |
$timerecordingemployees[$timerecordinguser->id]['id'], "userid" => $timerecordinguser->id]) ?>">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));
diff --git a/public/js/pages/timerecording/index.js b/public/js/pages/timerecording/index.js
index 62dad2845..8d19af624 100644
--- a/public/js/pages/timerecording/index.js
+++ b/public/js/pages/timerecording/index.js
@@ -270,7 +270,9 @@ $(document).ready(function () {
$('#date').val($(this).data('date'));
$('#start').val($(this).data('start'));
$('#end').val($(this).data('end'));
+ $('#end').prop("min", $('#start').val());
$('#enddate').val($(this).data('enddate'));
+ $('#enddate').prop("min", $('#date').val());
$('#comment').val($(this).data('comment'));
if ($(this).data('businesstrip') == 1) {
$('#businesstrip').prop("checked", true);
diff --git a/public/js/pages/timerecordingReport/index.js b/public/js/pages/timerecordingReport/index.js
index 8fc15eedb..780213d81 100644
--- a/public/js/pages/timerecordingReport/index.js
+++ b/public/js/pages/timerecordingReport/index.js
@@ -303,8 +303,10 @@ $(document).ready(function () {
$('#date').val($(this).data('date'));
$('#start').val($(this).data('start'));
$('#end').val($(this).data('end'));
+ $('#end').prop("min", $('#start').val());
$('#days').val($(this).data('days'));
$('#enddate').val($(this).data('enddate'));
+ $('#enddate').prop("min", $('#date').val());
$('#comment').val($(this).data('comment'));
if ($(this).data('businesstrip') == 1) {
$('#businesstrip').prop("checked", true);
|