Kalender Anpassungen

- Anpassungen bei neuen Kalenderbenutzern
This commit is contained in:
Daniel Spitzer
2025-06-06 09:29:25 +02:00
parent a71ae02128
commit df2dd9c596
5 changed files with 68 additions and 35 deletions

View File

@@ -333,6 +333,22 @@ class TimerecordingReportController extends mfBaseController
} else {
$sum = $hoursbpa . " St";
}
} else if ($timerecording->timerecordingCategory->hourday == 9) {
$date = date("d.m.Y", $timerecording->start);
$start = "-";
$end = "-";
$datadate = date("Y-m-d", $timerecording->start);
$day = $daysgerm[date("w", $timerecording->start)];
// $hours = number_format($timerecording->hours_bpa / 60 / 60, "2", ",", '');
$timerecording->hours = $timerecording->hours * -1;
$hoursbpa = round($timerecording->hours / 60 / 60, 2);
$hoursbpa = str_replace(".", ",", $hoursbpa);
if ($timerecording->hours > 0) {
$sum = "+" . $hoursbpa . " St";
} else {
$sum = $hoursbpa . " St";
}
} else if ($timerecording->timerecordingCategory->hourday == 6) {
$date = date("d.m.Y", $timerecording->start);
$datadate = date("Y-m-d", $timerecording->start);
@@ -389,6 +405,9 @@ class TimerecordingReportController extends mfBaseController
$ddays = $timerecording->days;
if ($timerecording->timerecordingCategory->hourday == 8) {
$ddays = round($timerecording->hours_bpa / 60 / 60, 2);
} elseif ($timerecording->timerecordingCategory->hourday == 9) {
$ddays = round($timerecording->hours / 60 / 60, 2);
// $ddays = $ddays * -1;
}
$edit = '<i class="far fa-edit edit-button" data-id="' . $timerecording->id . '"
@@ -561,7 +580,7 @@ class TimerecordingReportController extends mfBaseController
$workinghourshistory = TimerecordingEmployeeWorkingHourHistoryModel::search(['user_id' => $user_id]);
if ($workinghourshistory) {
$workingHoursHistory[9732489200]=$workingHours;
$workingHoursHistory[9732489200] = $workingHours;
foreach ($workinghourshistory as $workinghourhistory) {
$whenddate = $workinghourhistory->enddate;
$workinghourhistoryhours = json_decode($workinghourhistory->workinghours, true);
@@ -600,14 +619,12 @@ class TimerecordingReportController extends mfBaseController
}
$dDate = date('Y-m-d', $timestamp + $WintertimeCompensation);
$dDay = date('w', $timestamp + $WintertimeCompensation);
if ($workingHoursHistory)
{
if ($workingHoursHistory) {
foreach ($workingHoursHistory as $whkey => $whdata) {
$whtimestamp = strtotime(date('Y-m-d 23:59:59', $whkey));
if ($whtimestamp >= $timestamp)
{
$workingHours = $whdata;
}
$whtimestamp = strtotime(date('Y-m-d 23:59:59', $whkey));
if ($whtimestamp >= $timestamp) {
$workingHours = $whdata;
}
}
}
@@ -636,12 +653,10 @@ class TimerecordingReportController extends mfBaseController
}
$dDate = date('Y-m-d', $timestamp + $WintertimeCompensation);
$dDay = date('w', $timestamp + $WintertimeCompensation);
if ($workingHoursHistory)
{
if ($workingHoursHistory) {
foreach ($workingHoursHistory as $whkey => $whdata) {
$whtimestamp = strtotime(date('Y-m-d 23:59:59', $whkey));
if ($whtimestamp >= $timestamp)
{
if ($whtimestamp >= $timestamp) {
$workingHours = $whdata;
}
}
@@ -670,12 +685,10 @@ class TimerecordingReportController extends mfBaseController
}
$dDate = date('Y-m-d', $timestamp + $WintertimeCompensation);
$dDay = date('w', $timestamp + $WintertimeCompensation);
if ($workingHoursHistory)
{
if ($workingHoursHistory) {
foreach ($workingHoursHistory as $whkey => $whdata) {
$whtimestamp = strtotime(date('Y-m-d 23:59:59', $whkey));
if ($whtimestamp >= $timestamp)
{
if ($whtimestamp >= $timestamp) {
$workingHours = $whdata;
}
}
@@ -778,13 +791,10 @@ class TimerecordingReportController extends mfBaseController
} else {
$overtimes = $this->checkOvertime($timerecording);
$isSecondscleanarray[$timerecording->timerecordingCategory->short] = $isSecondscleanarray[$timerecording->timerecordingCategory->short] - $overtimes['sum'];
if ($employee->only_admin!=1)
{
if ($employee->only_admin != 1) {
}
else
{
$isSeconds = $isSeconds - $overtimes['sum'];
} else {
$isSeconds = $isSeconds - $overtimes['sum'];
}
$O100pfl = $O100pfl + $overtimes['O100pfl'];
$O100free = $O100free + $overtimes['O100free'];
@@ -815,12 +825,10 @@ class TimerecordingReportController extends mfBaseController
$sumdays = 0;
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
if ($workingHoursHistory)
{
if ($workingHoursHistory) {
foreach ($workingHoursHistory as $whkey => $whdata) {
$whtimestamp = strtotime(date('Y-m-d 23:59:59', $whkey));
if ($whtimestamp >= $i)
{
if ($whtimestamp >= $i) {
$workingHours = $whdata;
}
}
@@ -881,12 +889,10 @@ class TimerecordingReportController extends mfBaseController
$summcounter = 0;
$savecounter = 0;
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
if ($workingHoursHistory)
{
if ($workingHoursHistory) {
foreach ($workingHoursHistory as $whkey => $whdata) {
$whtimestamp = strtotime(date('Y-m-d 23:59:59', $whkey));
if ($whtimestamp >= $i)
{
if ($whtimestamp >= $i) {
$workingHours = $whdata;
}
}