Zeiterfassung Update

* Check der vorhandenen Buchungen geändert.
 * Exakte überschneidungen von Start und Endzeit können nun verbucht werden und muss nicht die 1 Minute differenz haben
 * Fix: Berechnung Mehrstunden wenn kein Startdatum festgelegt wurde
This commit is contained in:
Spitzer Daniel
2024-02-29 13:32:24 +01:00
parent cfb0efff62
commit 6e00cc3568
4 changed files with 41 additions and 28 deletions

View File

@@ -365,7 +365,6 @@ class TimerecordingController extends mfBaseController
$data['holidays_now'] = $holidays_now;
$employeeupdate->update($data);
$employeeupdate->save();
}
}
}
@@ -386,10 +385,13 @@ class TimerecordingController extends mfBaseController
$endtime = date("Y-m-d", $endtime);
$endtime = strtotime($endtime . " 23:59:00");
$return = $this->getTimerecordingsApi(5, null, null, null, $plushours_timestamp, $endtime);
$diffTime = $return['is'] - $return['must'];
$plushours_now = $plushours_now + $diffTime;
if ($plushours_timestamp > 0) {
$return = $this->getTimerecordingsApi(5, null, null, null, $plushours_timestamp, $endtime);
$diffTime = $return['is'] - $return['must'];
$plushours_now = $plushours_now + $diffTime;
} else {
$diffTime = 0;
}
if ($employee->plushours_now != $diffTime) {
$employeeupdate = new TimerecordingEmployee($employee->id);
$data = [];