Zeiterfassung Update
* Fix Summe bei Urlauben und Feiertagen (Buchungen und Auswertungen)
This commit is contained in:
@@ -538,6 +538,7 @@ class TimerecordingController extends mfBaseController
|
|||||||
$day = $daysgerm[date("w", $timerecording->start)];
|
$day = $daysgerm[date("w", $timerecording->start)];
|
||||||
$isSeconds = $isSeconds + $seconds;
|
$isSeconds = $isSeconds + $seconds;
|
||||||
} else if ($timerecording->timerecordingCategory->hourday == 2 || ($timerecording->timerecordingCategory->hourday == 3 && $timerecording->end)) {
|
} else if ($timerecording->timerecordingCategory->hourday == 2 || ($timerecording->timerecordingCategory->hourday == 3 && $timerecording->end)) {
|
||||||
|
|
||||||
$date = date("d.m.", $timerecording->start) . " - " . $daysgerm[date("w", $timerecording->end)] . " " . date("d.m.Y", $timerecording->end);
|
$date = date("d.m.", $timerecording->start) . " - " . $daysgerm[date("w", $timerecording->end)] . " " . date("d.m.Y", $timerecording->end);
|
||||||
$datadate = date("Y-m-d", $timerecording->start);
|
$datadate = date("Y-m-d", $timerecording->start);
|
||||||
$enddate = date("Y-m-d", $timerecording->end);
|
$enddate = date("Y-m-d", $timerecording->end);
|
||||||
@@ -559,8 +560,11 @@ class TimerecordingController extends mfBaseController
|
|||||||
$savecounter = 0;
|
$savecounter = 0;
|
||||||
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
||||||
$holidaycounter = $workingHours[date("w", $i)];
|
$holidaycounter = $workingHours[date("w", $i)];
|
||||||
$isSeconds = $isSeconds + $holidaycounter;
|
$daycheck = date("Y-m-d", $i);
|
||||||
$summcounter = $summcounter + $holidaycounter;
|
if (!$holiDay[$daycheck]) {
|
||||||
|
$isSeconds = $isSeconds + $holidaycounter;
|
||||||
|
$summcounter = $summcounter + $holidaycounter;
|
||||||
|
}
|
||||||
if ($savecounter == 1000) {
|
if ($savecounter == 1000) {
|
||||||
echo $savecounter;
|
echo $savecounter;
|
||||||
die();
|
die();
|
||||||
@@ -575,14 +579,19 @@ class TimerecordingController extends mfBaseController
|
|||||||
} else if ($timerecording->timerecordingCategory->hourday == 3 && !$timerecording->end) {
|
} else if ($timerecording->timerecordingCategory->hourday == 3 && !$timerecording->end) {
|
||||||
$date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time());;
|
$date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time());;
|
||||||
$datadate = date("Y-m-d", $timerecording->start);
|
$datadate = date("Y-m-d", $timerecording->start);
|
||||||
|
$enddatetemp = date("Y-m-d", time());
|
||||||
|
$enddatetemp = strtotime($enddatetemp . " 23:59:59");
|
||||||
|
$enddate = date("Y-m-d", $enddatetemp + 7200);
|
||||||
$start = "-";
|
$start = "-";
|
||||||
$end = "-";
|
$end = "-";
|
||||||
$day = $daysgerm[date("w", $timerecording->start)];
|
$day = $daysgerm[date("w", $timerecording->start)];
|
||||||
if ($lastdate < $timerecording->end) {
|
|
||||||
|
if ($lastdate < time()) {
|
||||||
$endtimecalc = $lastdate;
|
$endtimecalc = $lastdate;
|
||||||
} else {
|
} else {
|
||||||
$endtimecalc = $timerecording->end;
|
$endtimecalc = time();
|
||||||
}
|
}
|
||||||
|
$summcounter = 0;
|
||||||
if ($firstdate > $timerecording->start) {
|
if ($firstdate > $timerecording->start) {
|
||||||
$starttimecalc = $firstdate;
|
$starttimecalc = $firstdate;
|
||||||
} else {
|
} else {
|
||||||
@@ -590,10 +599,14 @@ class TimerecordingController extends mfBaseController
|
|||||||
}
|
}
|
||||||
$summcounter = 0;
|
$summcounter = 0;
|
||||||
$savecounter = 0;
|
$savecounter = 0;
|
||||||
|
// echo $starttimecalc."<br>";
|
||||||
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
||||||
$holidaycounter = $workingHours[date("w", $i)];
|
$holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)];
|
||||||
$isSeconds = $isSeconds + $holidaycounter;
|
$daycheck = date("Y-m-d", $i);
|
||||||
$summcounter = $summcounter + $holidaycounter;
|
if (!$holiDay[$daycheck]) {
|
||||||
|
$isSeconds = $isSeconds + $holidaycounter;
|
||||||
|
$summcounter = $summcounter + $holidaycounter;;
|
||||||
|
}
|
||||||
if ($savecounter == 1000) {
|
if ($savecounter == 1000) {
|
||||||
echo $savecounter;
|
echo $savecounter;
|
||||||
die();
|
die();
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
case "getTimerecordings":
|
case "getTimerecordings":
|
||||||
$return = $this->getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear);
|
$return = $this->getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear);
|
||||||
break;
|
break;
|
||||||
case "getTimerecordingsTimes":
|
case "getTimerecordingsTimes":
|
||||||
$return = $this->getTimerecordingsTimes($datatype, $dataweek, $datamonth, $datayear);
|
$return = $this->getTimerecordingsTimes($datatype, $dataweek, $datamonth, $datayear);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -103,7 +103,7 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
$dDate = date('Y-m-d', $timestamp);
|
$dDate = date('Y-m-d', $timestamp);
|
||||||
$dDay = date('w', $timestamp);
|
$dDay = date('w', $timestamp);
|
||||||
if (!$holiDay[$dDate]) {
|
if (!$holiDay[$dDate]) {
|
||||||
// $mustSeconds = $mustSeconds + $workingHours[$dDay];
|
// $mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||||
}
|
}
|
||||||
|
|
||||||
$timestamp = $timestamp + 86400;
|
$timestamp = $timestamp + 86400;
|
||||||
@@ -120,7 +120,7 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
$dDate = date('Y-m-d', $timestamp);
|
$dDate = date('Y-m-d', $timestamp);
|
||||||
$dDay = date('w', $timestamp);
|
$dDay = date('w', $timestamp);
|
||||||
if (!$holiDay[$dDate]) {
|
if (!$holiDay[$dDate]) {
|
||||||
// $mustSeconds = $mustSeconds + $workingHours[$dDay];
|
// $mustSeconds = $mustSeconds + $workingHours[$dDay];
|
||||||
}
|
}
|
||||||
$timestamp = $timestamp + 86400;
|
$timestamp = $timestamp + 86400;
|
||||||
}
|
}
|
||||||
@@ -192,8 +192,11 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
// echo $starttimecalc."<br>";
|
// echo $starttimecalc."<br>";
|
||||||
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
||||||
$holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)];
|
$holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)];
|
||||||
$isSeconds = $isSeconds + $holidaycounter;
|
$daycheck = date("Y-m-d", $i);
|
||||||
$summcounter = $summcounter + $holidaycounter;;
|
if (!$holiDay[$daycheck]) {
|
||||||
|
$isSeconds = $isSeconds + $holidaycounter;
|
||||||
|
$summcounter = $summcounter + $holidaycounter;;
|
||||||
|
}
|
||||||
if ($savecounter == 1000) {
|
if ($savecounter == 1000) {
|
||||||
echo $savecounter;
|
echo $savecounter;
|
||||||
die();
|
die();
|
||||||
@@ -231,8 +234,11 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
// echo $starttimecalc."<br>";
|
// echo $starttimecalc."<br>";
|
||||||
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) {
|
||||||
$holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)];
|
$holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)];
|
||||||
$isSeconds = $isSeconds + $holidaycounter;
|
$daycheck = date("Y-m-d", $i);
|
||||||
$summcounter = $summcounter + $holidaycounter;;
|
if (!$holiDay[$daycheck]) {
|
||||||
|
$isSeconds = $isSeconds + $holidaycounter;
|
||||||
|
$summcounter = $summcounter + $holidaycounter;;
|
||||||
|
}
|
||||||
if ($savecounter == 1000) {
|
if ($savecounter == 1000) {
|
||||||
echo $savecounter;
|
echo $savecounter;
|
||||||
die();
|
die();
|
||||||
|
|||||||
Reference in New Issue
Block a user