Zeiterfassung Update

* Berechnungen BP
 * Möglichkeit Mehrstunden in Gutstunden umzuwandeln
This commit is contained in:
Spi
2024-05-07 08:53:19 +02:00
parent b821c9f2c4
commit fe1a3e7948
4 changed files with 64 additions and 4 deletions

View File

@@ -527,6 +527,11 @@ class TimerecordingBillingController extends mfBaseController
$data['transfer_plushours'] = $data['transfer_plushours'] + ($diff - $maxplushours);
}
if ($timerecording['employee_id'] == "12") {
$data['transfer_plushours'] = $data['transfer_plushours'] - $data['overtime50free'] ;
$data['overtime50free'] = 0;
}
if ($data['transfer_plushours'] > 0) {
$timerecordingEmployee = new TimerecordingEmployee($timerecording['employee_id']);
@@ -586,6 +591,7 @@ class TimerecordingBillingController extends mfBaseController
$dataemployee['plushours'] = $timerecordingEmployee->plushours + $timerecordingBillingEmployee->transfer_plushours;
$dataemployee['overtime_now'] = $timerecordingEmployee->overtime_now + $timerecordingBillingEmployee->transfer_overtime;
$dataemployee['overtime'] = $timerecordingEmployee->overtime + $timerecordingBillingEmployee->transfer_overtime;
$dataemployee['bpahours'] = $timerecordingEmployee->bpahours + $timerecordingBillingEmployee->transfer_bpahours;
$timerecordingEmployee->update($dataemployee);
$timerecordingEmployee->save();
}
@@ -617,6 +623,7 @@ class TimerecordingBillingController extends mfBaseController
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
$dataemployee = [];
$dataemployee['bpahours'] = $timerecordingEmployee->bpahours + $this->request->overtimebpa * 3600;
$data['transfer_bpahours'] = $timerecordingbillingsemployee->transfer_overtimebpa - $this->request->overtimebpa * 3600;
$sum += $this->request->overtimebpa * 3600;
$timerecordingEmployee->update($dataemployee);
$timerecordingEmployee->save();
@@ -645,6 +652,7 @@ class TimerecordingBillingController extends mfBaseController
$data['overtime50free'] = $timerecordingbillingsemployee->overtime50free + $this->request->overtime50 * 3600;
$sum += $this->request->overtime50 * 3600;
}
if ($this->request->overtime100) {
$data['overtime100free'] = $timerecordingbillingsemployee->overtime100free + $this->request->overtime100 * 3600;
$sum += $this->request->overtime100 * 3600;
@@ -654,10 +662,22 @@ class TimerecordingBillingController extends mfBaseController
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
$dataemployee = [];
$dataemployee['bpahours'] = $timerecordingEmployee->bpahours + $this->request->overtimebpa * 3600;
$data['transfer_bpahours'] = $timerecordingbillingsemployee->transfer_overtimebpa - $this->request->overtimebpa * 3600;
$sum += $this->request->overtimebpa * 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 ($sum > 0) {
$data['transfer_plushours'] = $timerecordingbillingsemployee->transfer_plushours + $sum;
$data['plushours_all'] = $timerecordingbillingsemployee->plushours_all - $sum;