Zeiterfassung Update
* Transfer Überstunden50/100,Mehrstunden20 zurück in Gutstunden/Mehrstunden * Textuelle Anzeige von transferierten Stunden * Kalender Anzeige verbesserungen * Offene Krankenstände werden virtuell 2 Wochen in die Zukunft angezeit im Kalender
This commit is contained in:
@@ -690,6 +690,75 @@ class TimerecordingBillingController extends mfBaseController
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
} else if ($type == "bpa") {
|
||||
$sum = 0;
|
||||
$data = [];
|
||||
if ($this->request->plushours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['plushours_now'] = $timerecordingEmployee->plushours_now + $this->request->plushours * 3600;
|
||||
$dataemployee['plushours'] = $timerecordingEmployee->plushours + $this->request->plushours * 3600;
|
||||
$data['transfer_plushours'] = $timerecordingbillingsemployee->transfer_plushours - $this->request->plushours * 3600;
|
||||
$data['plushours_all'] = $timerecordingbillingsemployee->plushours_all + $this->request->plushours * 3600;
|
||||
$sum += $this->request->plushours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
if ($this->request->overtimehours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['overtime_now'] = $timerecordingEmployee->overtime_now + $this->request->overtimehours * 3600;
|
||||
$dataemployee['overtime'] = $timerecordingEmployee->overtime + $this->request->overtimehours * 3600;
|
||||
$data['transfer_overtime'] = $timerecordingbillingsemployee->transfer_overtime - $this->request->overtimehours * 3600;
|
||||
$sum += $this->request->overtimehours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
$data['transfer_bpahours'] = $timerecordingbillingsemployee->transfer_bpahours + $sum;
|
||||
$timerecordingbillingsemployee->update($data);
|
||||
$timerecordingbillingsemployee->save();
|
||||
$dataemployee = [];
|
||||
$dataemployee['bpahours'] = $timerecordingEmployee->bpahours - $sum;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
|
||||
} else if ($type == "plushours25" || $type == "overtime50free" || $type == "overtime100free") {
|
||||
$sum = 0;
|
||||
$data = [];
|
||||
if ($this->request->plushours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['plushours_now'] = $timerecordingEmployee->plushours_now + $this->request->plushours * 3600;
|
||||
$dataemployee['plushours'] = $timerecordingEmployee->plushours + $this->request->plushours * 3600;
|
||||
$data['transfer_plushours'] = $timerecordingbillingsemployee->transfer_plushours - $this->request->plushours * 3600;
|
||||
$data['plushours_all'] = $timerecordingbillingsemployee->plushours_all + $this->request->plushours * 3600;
|
||||
$sum += $this->request->plushours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
if ($this->request->overtimehours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['overtime_now'] = $timerecordingEmployee->overtime_now + $this->request->overtimehours * 3600;
|
||||
$dataemployee['overtime'] = $timerecordingEmployee->overtime + $this->request->overtimehours * 3600;
|
||||
$data['transfer_overtime'] = $timerecordingbillingsemployee->transfer_overtime - $this->request->overtimehours * 3600;
|
||||
$sum += $this->request->overtimehours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
$data[$type] = $timerecordingbillingsemployee->{$type} - $sum;
|
||||
$timerecordingbillingsemployee->update($data);
|
||||
$timerecordingbillingsemployee->save();
|
||||
}
|
||||
}
|
||||
$response['state'] = "success";
|
||||
echo json_encode($response);
|
||||
|
||||
Reference in New Issue
Block a user