Zeiterfassung
Neue Features: * BP Stunden Aufbuchen/Mindern * Spezialbuchungen ohne Verechnungstechnische relevanz
This commit is contained in:
@@ -55,9 +55,13 @@
|
|||||||
<label class="col-lg-2 col-form-label" for="hourday">Buchungszeitraum</label>
|
<label class="col-lg-2 col-form-label" for="hourday">Buchungszeitraum</label>
|
||||||
<div class="col-lg-2">
|
<div class="col-lg-2">
|
||||||
<select id="hourday" name="hourday" class="select2 form-control">
|
<select id="hourday" name="hourday" class="select2 form-control">
|
||||||
<?php foreach ($timerecordingcategorieshourday as $key => $value) : ?>
|
<?php foreach ($timerecordingcategorieshourday as $key => $value) :
|
||||||
|
if (($me->superexpertEnabled() && $key == 8) || $key!= 8):
|
||||||
|
?>
|
||||||
<option value="<?= $key ?>" <?= ($key == $timerecordingcategoriess->hourday) ? "selected='selected'" : "" ?>><?= $value ?></option>
|
<option value="<?= $key ?>" <?= ($key == $timerecordingcategoriess->hourday) ? "selected='selected'" : "" ?>><?= $value ?></option>
|
||||||
<?php endforeach; ?>
|
<?php
|
||||||
|
endif;
|
||||||
|
endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -59,7 +59,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($timerecordingcategoriess as $timerecordingcategories): ?>
|
<?php foreach ($timerecordingcategoriess as $timerecordingcategories):
|
||||||
|
if (($me->superexpertEnabled() && $timerecordingcategories->hourday==8) || $timerecordingcategories->hourday!=8):
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-center"><?= $timerecordingcategories->name ?></td>
|
<td class="text-center"><?= $timerecordingcategories->name ?></td>
|
||||||
<td class="text-center"><?= $timerecordingcategories->short ?></td>
|
<td class="text-center"><?= $timerecordingcategories->short ?></td>
|
||||||
@@ -76,7 +78,9 @@
|
|||||||
title="Löschen"><i class="fas fa-trash"></i></a>
|
title="Löschen"><i class="fas fa-trash"></i></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php
|
||||||
|
endif;
|
||||||
|
endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ $daysSelect .= "</select>";
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-lg-2 col-form-label" for="user_id">Mitarbeiter *</label>
|
<label class="col-lg-2 col-form-label" for="user_id">Mitarbeiter *</label>
|
||||||
<div class="col-lg-3">
|
<div class="col-lg-3">
|
||||||
@@ -191,6 +192,19 @@ $daysSelect .= "</select>";
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if ($me->superexpertEnabled()): ?>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label class="col-lg-2 col-form-label"
|
||||||
|
for="bmd_active">Nur im Admin-Mode sichtbar</label>
|
||||||
|
<div class="col-lg-3">
|
||||||
|
<div class="form-check">
|
||||||
|
<input id="only_admin"
|
||||||
|
class="form-check-input" <?php if ($timerecordingemployees->only_admin) echo 'checked="checked"'; ?>
|
||||||
|
type="checkbox" name="only_admin" value="1"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<div id="workinghours_div">
|
<div id="workinghours_div">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-lg-2 col-form-label" for="workinghours">Sollzeiten
|
<label class="col-lg-2 col-form-label" for="workinghours">Sollzeiten
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ $type[3] = "Lehrling";
|
|||||||
?>
|
?>
|
||||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= $git_merge_ts ?>" rel="stylesheet"
|
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= $git_merge_ts ?>" rel="stylesheet"
|
||||||
type="text/css"/>
|
type="text/css"/>
|
||||||
<link href="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.css?<?= $git_merge_ts ?>" rel="stylesheet"
|
<link href="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.css?<?= $git_merge_ts ?>"
|
||||||
|
rel="stylesheet"
|
||||||
type="text/css"/>
|
type="text/css"/>
|
||||||
<style>
|
<style>
|
||||||
.border-dark {
|
.border-dark {
|
||||||
@@ -92,6 +93,9 @@ $type[3] = "Lehrling";
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($timerecordingusers as $timerecordinguser):
|
<?php foreach ($timerecordingusers as $timerecordinguser):
|
||||||
|
if ($timerecordingemployees[$timerecordinguser->id]['only_admin'] == 1 && !$me->superexpertEnabled()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ($timerecordingworkinghours) {
|
if ($timerecordingworkinghours) {
|
||||||
$seconds = $timerecordingworkinghours[$timerecordinguser->id]['secondcounter'];
|
$seconds = $timerecordingworkinghours[$timerecordinguser->id]['secondcounter'];
|
||||||
$minutes = floor(($seconds % 3600) / 60);
|
$minutes = floor(($seconds % 3600) / 60);
|
||||||
@@ -160,11 +164,11 @@ $type[3] = "Lehrling";
|
|||||||
src="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.js?<?= $git_merge_ts ?>"></script>
|
src="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.js?<?= $git_merge_ts ?>"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var hidesearch = [ 6, 7, 8, 9, 10,13];
|
var hidesearch = [6, 7, 8, 9, 10, 13];
|
||||||
var columnfilter = [0,11,12];
|
var columnfilter = [0, 11, 12];
|
||||||
<?php if ($me->superexpertEnabled()): ?>
|
<?php if ($me->superexpertEnabled()): ?>
|
||||||
var columnfilter = [0,12,13];
|
var columnfilter = [0, 12, 13];
|
||||||
hidesearch = [ 6, 7, 8, 9, 10, 11,14];
|
hidesearch = [6, 7, 8, 9, 10, 11, 14];
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
var columnoptions = '<option value=""></option><option value="Ja">Ja</option><option value="Nein">Nein</option>';
|
var columnoptions = '<option value=""></option><option value="Ja">Ja</option><option value="Nein">Nein</option>';
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ $monthger[12] = "Dezember";
|
|||||||
$time = time();
|
$time = time();
|
||||||
|
|
||||||
foreach ($timerecordingusers as $timerecordinguser) {
|
foreach ($timerecordingusers as $timerecordinguser) {
|
||||||
|
if ($timerecordingEmployees[$timerecordinguser->id] && $timerecordingEmployees[$timerecordinguser->id]['only_admin'] == 1 && !$me->superexpertEnabled()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$timerecordingUsers[$timerecordinguser->name] = $timerecordinguser->id;
|
$timerecordingUsers[$timerecordinguser->name] = $timerecordinguser->id;
|
||||||
}
|
}
|
||||||
ksort($timerecordingUsers);
|
ksort($timerecordingUsers);
|
||||||
@@ -30,6 +33,8 @@ for ($i = 1; $i <= 25; $i++) {
|
|||||||
}
|
}
|
||||||
$time = time();
|
$time = time();
|
||||||
$timenow = $time;
|
$timenow = $time;
|
||||||
|
|
||||||
|
$time = strtotime('first day of this month', $time);
|
||||||
$time = strtotime('+3 month', $time);
|
$time = strtotime('+3 month', $time);
|
||||||
for ($i = 1; $i <= 15; $i++) {
|
for ($i = 1; $i <= 15; $i++) {
|
||||||
$mon = date('n', $time);
|
$mon = date('n', $time);
|
||||||
@@ -143,7 +148,9 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
|
|||||||
|
|
||||||
<select id="timerecordingCategory_id" name="timerecordingCategory_id"
|
<select id="timerecordingCategory_id" name="timerecordingCategory_id"
|
||||||
class="select2 form-control" required="required">
|
class="select2 form-control" required="required">
|
||||||
<?php foreach ($timerecordingCategoriess as $timerecordingCategories): ?>
|
<?php foreach ($timerecordingCategoriess as $timerecordingCategories):
|
||||||
|
if (($me->superexpertEnabled() && $timerecordingCategories->hourday == 8) || $timerecordingCategories->hourday != 8):
|
||||||
|
?>
|
||||||
<option value="<?= $timerecordingCategories->id ?>"
|
<option value="<?= $timerecordingCategories->id ?>"
|
||||||
data-approval="<?= $timerecordingCategories->approval ?>"
|
data-approval="<?= $timerecordingCategories->approval ?>"
|
||||||
data-comment="<?= $timerecordingCategories->require_comment ?>"
|
data-comment="<?= $timerecordingCategories->require_comment ?>"
|
||||||
@@ -151,6 +158,8 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
|
|||||||
data-businesstrip="<?= $timerecordingCategories->businesstrip ?>"
|
data-businesstrip="<?= $timerecordingCategories->businesstrip ?>"
|
||||||
data-homeoffice="<?= ($timerecordingCategories->hourday == 1) ? 1 : 0 ?>"><?= $timerecordingCategories->name ?></option>
|
data-homeoffice="<?= ($timerecordingCategories->hourday == 1) ? 1 : 0 ?>"><?= $timerecordingCategories->name ?></option>
|
||||||
<?php
|
<?php
|
||||||
|
endif;
|
||||||
|
|
||||||
endforeach; ?>
|
endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -313,7 +322,7 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<select id="datamonth" class="form-control select2">
|
<select id="datamonth" class="form-control select2">
|
||||||
<?php foreach ($month as $key => $Month): ?>
|
<?php foreach ($month as $key => $Month): ?>
|
||||||
<option <?= ($timenow == $key) ? 'selected="selected"' : '' ?>
|
<option <?= (date("Y-m",$timenow) == date("Y-m",$key)) ? 'selected="selected"' : '' ?>
|
||||||
value="<?= $key ?>"><?= $Month ?></option>
|
value="<?= $key ?>"><?= $Month ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ class TimerecordingController extends mfBaseController
|
|||||||
{
|
{
|
||||||
$r = $this->request;
|
$r = $this->request;
|
||||||
$id = $r->id;
|
$id = $r->id;
|
||||||
|
$oldbpseconds=0;
|
||||||
$enddate = $r->enddate;
|
$enddate = $r->enddate;
|
||||||
$hourday = $r->hourday;
|
$hourday = $r->hourday;
|
||||||
|
|
||||||
@@ -286,9 +287,12 @@ class TimerecordingController extends mfBaseController
|
|||||||
} else if ($hourday == 5) {
|
} else if ($hourday == 5) {
|
||||||
$starttime = strtotime($r->date . " 00:00:00");
|
$starttime = strtotime($r->date . " 00:00:00");
|
||||||
$endtime = strtotime($r->date . " 23:59:00");
|
$endtime = strtotime($r->date . " 23:59:00");
|
||||||
|
} else if ($hourday == 8) {
|
||||||
|
$starttime = strtotime($r->date . " 00:00:00");
|
||||||
|
$endtime = strtotime($r->date . " 23:59:00");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($hourday != 5 && $hourday != 7) {
|
if ($hourday != 5 && $hourday != 7 && $hourday != 8) {
|
||||||
$result = $this->checkTimerecording($starttime, $endtime, $id);
|
$result = $this->checkTimerecording($starttime, $endtime, $id);
|
||||||
}
|
}
|
||||||
if ($result['state'] == "error") {
|
if ($result['state'] == "error") {
|
||||||
@@ -304,6 +308,7 @@ class TimerecordingController extends mfBaseController
|
|||||||
if (is_numeric($id) && $id > 0) {
|
if (is_numeric($id) && $id > 0) {
|
||||||
$mode = "edit";
|
$mode = "edit";
|
||||||
$timerecordings = new Timerecording($id);
|
$timerecordings = new Timerecording($id);
|
||||||
|
$oldbpseconds = $timerecordings->hours_bpa;
|
||||||
if (!$timerecordings->id) {
|
if (!$timerecordings->id) {
|
||||||
$this->layout()->setFlash("Buchungen nicht gefunden", "error");
|
$this->layout()->setFlash("Buchungen nicht gefunden", "error");
|
||||||
$this->redirect("Timerecording");
|
$this->redirect("Timerecording");
|
||||||
@@ -326,7 +331,12 @@ class TimerecordingController extends mfBaseController
|
|||||||
$data['businesstrip'] = $r->businesstrip;
|
$data['businesstrip'] = $r->businesstrip;
|
||||||
$data['businesstrip_info'] = $r->businesstrip_info;
|
$data['businesstrip_info'] = $r->businesstrip_info;
|
||||||
$data['homeoffice'] = $r->homeoffice;
|
$data['homeoffice'] = $r->homeoffice;
|
||||||
|
if ($hourday == 8) {
|
||||||
|
$data['days'] = 0;
|
||||||
|
$data['hours_bpa'] = $r->days * 60 * 60;
|
||||||
|
} else {
|
||||||
$data['days'] = $r->days;
|
$data['days'] = $r->days;
|
||||||
|
}
|
||||||
$data['timerecordingCar_id'] = $r->timerecordingCar_id;
|
$data['timerecordingCar_id'] = $r->timerecordingCar_id;
|
||||||
$data['mileage_start'] = $r->mileage_start;
|
$data['mileage_start'] = $r->mileage_start;
|
||||||
$data['mileage_end'] = $r->mileage_end;
|
$data['mileage_end'] = $r->mileage_end;
|
||||||
@@ -456,6 +466,9 @@ class TimerecordingController extends mfBaseController
|
|||||||
}
|
}
|
||||||
$this->updatePlushours($data['user_id']);
|
$this->updatePlushours($data['user_id']);
|
||||||
TimerecordingCarModel::calcMileage();
|
TimerecordingCarModel::calcMileage();
|
||||||
|
if ($data['hours_bpa']) {
|
||||||
|
$this->updateBpHours($data['user_id'], $data['hours_bpa'], $oldbpseconds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == "edit") {
|
if ($mode == "edit") {
|
||||||
@@ -537,6 +550,21 @@ class TimerecordingController extends mfBaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateBpHours($userid, $seconds, $oldseconds = 0)
|
||||||
|
{
|
||||||
|
$employee = TimerecordingEmployeeModel::search(['user_id' => $userid]);
|
||||||
|
if (!$employee) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$employee = $employee[0];
|
||||||
|
$bpHours = $employee->bpahours;
|
||||||
|
$employeeupdate = new TimerecordingEmployee($employee->id);
|
||||||
|
$data = [];
|
||||||
|
$data['bpahours'] = $bpHours + $seconds - $oldseconds;
|
||||||
|
$employeeupdate->update($data);
|
||||||
|
$employeeupdate->save();
|
||||||
|
}
|
||||||
|
|
||||||
public function updatePlushours($userid, $enddate = null)
|
public function updatePlushours($userid, $enddate = null)
|
||||||
{
|
{
|
||||||
$employee = TimerecordingEmployeeModel::search(['user_id' => $userid]);
|
$employee = TimerecordingEmployeeModel::search(['user_id' => $userid]);
|
||||||
@@ -957,7 +985,7 @@ class TimerecordingController extends mfBaseController
|
|||||||
$edit .= '<i data-id="' . $timerecording->id . '" class="fas fa-trash text-danger delete-item" ></i>';
|
$edit .= '<i data-id="' . $timerecording->id . '" class="fas fa-trash text-danger delete-item" ></i>';
|
||||||
endif;
|
endif;
|
||||||
if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5)) {
|
if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5)) {
|
||||||
} else {
|
} else if ($timerecording->timerecordingCategory->hourday != 8) {
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
'date' => array('date' => $state . $day . " " . $date, 'order' => $orderdate),
|
'date' => array('date' => $state . $day . " " . $date, 'order' => $orderdate),
|
||||||
'start' => array('start' => $start, 'order' => $start),
|
'start' => array('start' => $start, 'order' => $start),
|
||||||
@@ -1102,10 +1130,14 @@ class TimerecordingController extends mfBaseController
|
|||||||
$id = $this->request->id;
|
$id = $this->request->id;
|
||||||
$timerecordings = new Timerecording($id);
|
$timerecordings = new Timerecording($id);
|
||||||
$userid = $timerecordings->user_id;
|
$userid = $timerecordings->user_id;
|
||||||
|
$oldbpseconds = $timerecordings->hours_bpa;
|
||||||
if (!$timerecordings->id || $timerecordings->id != $id) {
|
if (!$timerecordings->id || $timerecordings->id != $id) {
|
||||||
$this->layout()->setFlash("Buchung nicht gefunden.", "error");
|
$this->layout()->setFlash("Buchung nicht gefunden.", "error");
|
||||||
$this->redirect("Timerecording");
|
$this->redirect("Timerecording");
|
||||||
}
|
}
|
||||||
|
if ($timerecordings->timerecordingCategory->hourday == 8) {
|
||||||
|
$this->updateBpHours($userid, 0, $oldbpseconds);
|
||||||
|
}
|
||||||
$timerecordings->delete();
|
$timerecordings->delete();
|
||||||
$this->updateHolidays($userid);
|
$this->updateHolidays($userid);
|
||||||
$this->updatePlushours($userid);
|
$this->updatePlushours($userid);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ class TimerecordingModel
|
|||||||
private $end;
|
private $end;
|
||||||
private $hours;
|
private $hours;
|
||||||
private $hours_overtime;
|
private $hours_overtime;
|
||||||
|
private $hours_bpa;
|
||||||
private $days;
|
private $days;
|
||||||
private $timerecordingCategory_id;
|
private $timerecordingCategory_id;
|
||||||
private $businesstrip;
|
private $businesstrip;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class TimerecordingCategoryModel
|
|||||||
private $only_admin;
|
private $only_admin;
|
||||||
private $businesstrip;
|
private $businesstrip;
|
||||||
private $unpaid;
|
private $unpaid;
|
||||||
public static $hourday_definition = array(1 => "Uhrzeit (von/bis)", 2 => "Tage (von/bis)", 3 => "Startdatum", 4 => "Enddatum", 5 => "Anzahl Tage", 6 => "ZA Uhrzeit (von/bis)", 7 => "Fahrtenbuch (von/bis)");
|
public static $hourday_definition = array(1 => "Uhrzeit (von/bis)", 2 => "Tage (von/bis)", 3 => "Startdatum", 4 => "Enddatum", 5 => "Anzahl Tage", 6 => "ZA Uhrzeit (von/bis)", 7 => "Fahrtenbuch (von/bis)",8 => "BP Stunden (Anzahl Stunden)");
|
||||||
public static $approval_definition = array(0 => "Nein", 1 => "Ja");
|
public static $approval_definition = array(0 => "Nein", 1 => "Ja");
|
||||||
public static $require_comment_definition = array(0 => "Nein", 1 => "Ja");
|
public static $require_comment_definition = array(0 => "Nein", 1 => "Ja");
|
||||||
public static $businesstrip_definition = array(0 => "Nein", 1 => "Ja");
|
public static $businesstrip_definition = array(0 => "Nein", 1 => "Ja");
|
||||||
|
|||||||
@@ -150,6 +150,13 @@ class TimerecordingEmployeeController extends mfBaseController
|
|||||||
$data['bpahours_value'] = $bpahours_value;
|
$data['bpahours_value'] = $bpahours_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($this->me->superexpertEnabled()) {
|
||||||
|
if ($r->only_admin) {
|
||||||
|
$data['only_admin'] = $r->only_admin;
|
||||||
|
} else {
|
||||||
|
$data['only_admin'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$data['overtime']) {
|
if (!$data['overtime']) {
|
||||||
$data['overtime'] = 0;
|
$data['overtime'] = 0;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class TimerecordingEmployeeModel
|
|||||||
private $enddate;
|
private $enddate;
|
||||||
private $bmd_active;
|
private $bmd_active;
|
||||||
private $jobbike;
|
private $jobbike;
|
||||||
|
private $only_admin;
|
||||||
private $birthday;
|
private $birthday;
|
||||||
public static $employeetypesbmd = array('1' => '1000', '2' => '1200', '3' => '1400');
|
public static $employeetypesbmd = array('1' => '1000', '2' => '1200', '3' => '1400');
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
$this->layout()->setTemplate("TimerecordingReport/Index");
|
$this->layout()->setTemplate("TimerecordingReport/Index");
|
||||||
$timerecordingCategoriess = TimerecordingCategoryModel::getAll();
|
$timerecordingCategoriess = TimerecordingCategoryModel::getAll();
|
||||||
$this->layout()->set("timerecordingCategoriess", $timerecordingCategoriess);
|
$this->layout()->set("timerecordingCategoriess", $timerecordingCategoriess);
|
||||||
|
$timerecordingEmployees = TimerecordingEmployeeModel::getAllArray();
|
||||||
|
$this->layout()->set("timerecordingEmployees", $timerecordingEmployees);
|
||||||
$timerecordingusers = UserModel::search(['employee' => 'true']);
|
$timerecordingusers = UserModel::search(['employee' => 'true']);
|
||||||
$this->layout()->set("timerecordingusers", $timerecordingusers);
|
$this->layout()->set("timerecordingusers", $timerecordingusers);
|
||||||
$timerecordings = TimerecordingModel::getAll();
|
$timerecordings = TimerecordingModel::getAll();
|
||||||
@@ -81,6 +83,7 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
$plusHours = $employee[0]->plushours;
|
$plusHours = $employee[0]->plushours;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
$employeeArray = TimerecordingEmployeeModel::getAllArray();
|
||||||
$workinghours = TimerecordingEmployeeWorkingHourModel::getAll();
|
$workinghours = TimerecordingEmployeeWorkingHourModel::getAll();
|
||||||
foreach ($workinghours as $workinghour) {
|
foreach ($workinghours as $workinghour) {
|
||||||
|
|
||||||
@@ -164,6 +167,9 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
$timerecordings = TimerecordingModel::search($searchArray);
|
$timerecordings = TimerecordingModel::search($searchArray);
|
||||||
$responsecount = count($timerecordings);
|
$responsecount = count($timerecordings);
|
||||||
foreach ($timerecordings as $timerecording):
|
foreach ($timerecordings as $timerecording):
|
||||||
|
if ($employeeArray[$timerecording->user_id]['only_admin'] == 1 && !$this->me->superexpertEnabled()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$hiderecording = 0;
|
$hiderecording = 0;
|
||||||
$state = "";
|
$state = "";
|
||||||
$enddate = "";
|
$enddate = "";
|
||||||
@@ -310,6 +316,21 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} else if ($timerecording->timerecordingCategory->hourday == 8) {
|
||||||
|
$date = date("d.m.Y", $timerecording->start);
|
||||||
|
$start = "-";
|
||||||
|
$end = "-";
|
||||||
|
$datadate = date("Y-m-d", $timerecording->start);
|
||||||
|
$day = $daysgerm[date("w", $timerecording->start)];
|
||||||
|
// $hoursbpa = number_format($timerecording->hours_bpa / 60 / 60, "2", ",", '');
|
||||||
|
$hoursbpa = round($timerecording->hours_bpa / 60 / 60, 2);
|
||||||
|
$hoursbpa = str_replace(".", ",", $hoursbpa);
|
||||||
|
|
||||||
|
if ($timerecording->hours_bpa > 0) {
|
||||||
|
$sum = "+" . $hoursbpa . " St";
|
||||||
|
} else {
|
||||||
|
$sum = $hoursbpa . " St";
|
||||||
|
}
|
||||||
} else if ($timerecording->timerecordingCategory->hourday == 6) {
|
} else if ($timerecording->timerecordingCategory->hourday == 6) {
|
||||||
$date = date("d.m.Y", $timerecording->start);
|
$date = date("d.m.Y", $timerecording->start);
|
||||||
$datadate = date("Y-m-d", $timerecording->start);
|
$datadate = date("Y-m-d", $timerecording->start);
|
||||||
@@ -363,6 +384,11 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
|
|
||||||
if ($timerecording->completed == 0):
|
if ($timerecording->completed == 0):
|
||||||
if ($timerecording->approved == 0) :
|
if ($timerecording->approved == 0) :
|
||||||
|
$ddays = $timerecording->days;
|
||||||
|
if ($timerecording->timerecordingCategory->hourday == 8) {
|
||||||
|
$ddays = round($timerecording->hours_bpa / 60 / 60, 2);
|
||||||
|
}
|
||||||
|
|
||||||
$edit = '<i class="far fa-edit edit-button" data-id="' . $timerecording->id . '"
|
$edit = '<i class="far fa-edit edit-button" data-id="' . $timerecording->id . '"
|
||||||
data-date="' . $datadate . '"
|
data-date="' . $datadate . '"
|
||||||
data-category="' . $timerecording->timerecordingCategory->id . '"
|
data-category="' . $timerecording->timerecordingCategory->id . '"
|
||||||
@@ -374,7 +400,7 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
data-businesstrip="' . $timerecording->businesstrip . '"
|
data-businesstrip="' . $timerecording->businesstrip . '"
|
||||||
data-businesstripinfo="' . $timerecording->businesstrip_info . '"
|
data-businesstripinfo="' . $timerecording->businesstrip_info . '"
|
||||||
data-homeoffice="' . $timerecording->homeoffice . '"
|
data-homeoffice="' . $timerecording->homeoffice . '"
|
||||||
data-days="' . $timerecording->days . '"
|
data-days="' . $ddays . '"
|
||||||
data-car="' . $timerecording->timerecordingCar_id . '"
|
data-car="' . $timerecording->timerecordingCar_id . '"
|
||||||
data-mileagestart="' . $timerecording->mileage_start . '"
|
data-mileagestart="' . $timerecording->mileage_start . '"
|
||||||
data-mileageend="' . $timerecording->mileage_end . '"
|
data-mileageend="' . $timerecording->mileage_end . '"
|
||||||
@@ -384,9 +410,9 @@ class TimerecordingReportController extends mfBaseController
|
|||||||
endif;
|
endif;
|
||||||
$edit .= '<i data-id="' . $timerecording->id . '" class="fas fa-trash text-danger delete-item" ></i>';
|
$edit .= '<i data-id="' . $timerecording->id . '" class="fas fa-trash text-danger delete-item" ></i>';
|
||||||
endif;
|
endif;
|
||||||
if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5)) {
|
if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5 || $timerecording->timerecordingCategory->hourday == 8)) {
|
||||||
} else if ($hiderecording == 1) {
|
} else if ($hiderecording == 1) {
|
||||||
} else {
|
} else if (($timerecording->timerecordingCategory->hourday == 8 && $this->me->superexpertEnabled()) || $timerecording->timerecordingCategory->hourday != 8) {
|
||||||
if (!$enddatecend) {
|
if (!$enddatecend) {
|
||||||
$enddatecend = $enddate;
|
$enddatecend = $enddate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -308,6 +308,10 @@ $(document).ready(function () {
|
|||||||
$(this).val('');
|
$(this).val('');
|
||||||
});
|
});
|
||||||
$('#days-div').show();
|
$('#days-div').show();
|
||||||
|
$('#days-div').find('label').text('Anzahl Tage');
|
||||||
|
$('#days-div').find('input').attr("step", "1");
|
||||||
|
$('#days-div').find('input').val("");
|
||||||
|
|
||||||
$('#days').prop("required", true);
|
$('#days').prop("required", true);
|
||||||
|
|
||||||
} else if (parseInt($(this).find(':selected').data('hourday')) === 7) {
|
} else if (parseInt($(this).find(':selected').data('hourday')) === 7) {
|
||||||
@@ -326,6 +330,24 @@ $(document).ready(function () {
|
|||||||
$('#businesstrip_info').show();
|
$('#businesstrip_info').show();
|
||||||
$('.car-div-car').show();
|
$('.car-div-car').show();
|
||||||
|
|
||||||
|
} else if (parseInt($(this).find(':selected').data('hourday')) === 8) {
|
||||||
|
$("#endtime-div").hide();
|
||||||
|
$("#endtime-div").find('input').each(function () {
|
||||||
|
$(this).prop("required", false);
|
||||||
|
$(this).prop("disabled", true);
|
||||||
|
|
||||||
|
});
|
||||||
|
$("#enddate-div").hide();
|
||||||
|
$("#enddate-div").find('input').each(function () {
|
||||||
|
$(this).prop("required", false);
|
||||||
|
$(this).prop("min", '');
|
||||||
|
$(this).val('');
|
||||||
|
});
|
||||||
|
$('#days-div').show();
|
||||||
|
$('#days-div').find('label').text('Anzahl Stunden');
|
||||||
|
$('#days-div').find('input').attr("step", "0.01");
|
||||||
|
$('#days').prop("required", true);
|
||||||
|
$('#days-div').find('input').val("");
|
||||||
}
|
}
|
||||||
if (parseInt($(this).find(':selected').data('comment')) === 1) {
|
if (parseInt($(this).find(':selected').data('comment')) === 1) {
|
||||||
$('#comment').prop("required", true);
|
$('#comment').prop("required", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user