Zeiterfassungs Update

* neue Migration für Personaladministration (Aktive Verrechnung)
 * Verrechnung Anpassungen Black P.
 * superexpertEnabled Implementation Verrechnung/Personaladministration
 * Personaladministration (Aktive Verrechnung/Zeiterfassung Enddatum)
This commit is contained in:
Spitzer Daniel
2024-04-01 17:35:38 +02:00
parent 83b01ce931
commit c3ebfdfd2a
9 changed files with 112 additions and 15 deletions

View File

@@ -38,6 +38,9 @@
<th class="text-center">Sollabweichung</th>
<th class="text-center">Akuelle Gutstunden</th>
<th class="text-center">Akuelle Überstunden</th>
<?php if ($me->superexpertEnabled()): ?>
<th class="text-center">Black P. Stunden</th>
<?php endif; ?>
<th class="text-center">Nichtleistungszeiten</th>
<th class="text-center">Diäten</th>
<th class="text-center">Homeoffice Tage</th>
@@ -50,6 +53,9 @@
<th></th>
<th></th>
<th></th>
<?php if ($me->superexpertEnabled()): ?>
<th></th>
<?php endif; ?>
<th></th>
<th></th>
<th></th>
@@ -75,7 +81,7 @@
}
$offdays .= "</div>";
} else {
$offdays = "keine";
$offdays = "-";
}
?>
<tr>
@@ -91,6 +97,10 @@
class="text-center"><?= $timerecording['data']['time']['plushours_now'] ?></td>
<td data-order="<?= $timerecording['data']['time']['overtime_noworder'] ?>"
class="text-center"><?= $timerecording['data']['time']['overtime_now'] ?></td>
<?php if ($me->superexpertEnabled()): ?>
<td data-order="<?= $timerecording['data']['time']['bpahours'] ?>"
class="text-center"><?= $timerecording['data']['time']['bpahours'] ?></td>
<?php endif; ?>
<td class=""><?= $offdays ?></td>
<td class="text-center"><?= number_format($timerecording['data']['time']['diet'], 2, ',', '.') . " €" ?></td>
<td class="text-center"><?= $timerecording['data']['time']['homeoffice'] ?> Tag(e)</td>
@@ -108,7 +118,9 @@
<script type="text/javascript">
var hidesearch = [2, 3, 4, 5, 6, 8, 9];
<?php if ($me->superexpertEnabled()): ?>
hidesearch = [2, 3, 4, 5, 6, 7, 9, 10];
<?php endif; ?>
$(document).ready(function () {
$('.buttons-excel').closest('div').append('<div ><button id="bmd-export" class="btn btn-info margina">BMD Import</button></div>');
$('.buttons-excel').closest('div').append('<div ><button id="bmd-export-nlz" class="btn btn-info margina">BMD NLZ Import</button></div>');

View File

@@ -61,6 +61,17 @@ $daysSelect .= "</select>";
<div class="card no-shadow">
<div class="card-body">
<input type="hidden" name="id" value="<?= $timerecordingemployees->id ?>"/>
<div class="form-group row">
<label class="col-lg-2 col-form-label"
for="bmd_active">Aktive Verrechnung</label>
<div class="col-lg-3">
<div class="form-check">
<input id="bmd_active"
class="form-check-input" <?php if ($timerecordingemployees->bmd_active) echo 'checked="checked"'; ?>
type="checkbox" name="bmd_active" value="1"/>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="user_id">Mitarbeiter *</label>
<div class="col-lg-3">
@@ -89,6 +100,15 @@ $daysSelect .= "</select>";
value="<?= ($timerecordingemployees->startdate) ? date('Y-m-d', $timerecordingemployees->startdate): "" ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="enddate">Enddatum
Zeiterfassung</label>
<div class="col-lg-2">
<input type="date" id="enddate" name="enddate"
class="form-control"
value="<?= ($timerecordingemployees->enddate) ? date('Y-m-d', $timerecordingemployees->enddate): "" ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="birthday">Geburtstag</label>
<div class="col-lg-2">

View File

@@ -9,9 +9,14 @@ $type[3] = "Lehrling";
.border-dark {
border-color: #cbcbcb !important;
}
.border-bottom {
border-bottom: 1px dotted #adadad !important;
}
.inactive_empoyee {
background-color: #ff75756e !important;
}
</style>
<!-- start page title -->
<div class="row">
@@ -52,6 +57,9 @@ $type[3] = "Lehrling";
<th class="text-center">Sollstunden</th>
<th class="text-center">Mehrstunden</th>
<th class="text-center">Überstunden</th>
<?php if ($me->superexpertEnabled()): ?>
<th class="text-center">Black P. Stunden</th>
<?php endif; ?>
<th class="text-center">Offene Urlaube</th>
<th class="text-center edit-width">Schnellbuchung</th>
<th class="edit-width"></th>
@@ -62,6 +70,9 @@ $type[3] = "Lehrling";
<th></th>
<th></th>
<th></th>
<?php if ($me->superexpertEnabled()): ?>
<th></th>
<?php endif; ?>
<th></th>
<th></th>
<th></th>
@@ -97,7 +108,7 @@ $type[3] = "Lehrling";
}
?>
<tr>
<tr class="<?= ($timerecordingemployees[$timerecordinguser->id]['bmd_active'] == "0") ? "inactive_empoyee" : "" ?>">
<td><?= $timerecordinguser->name ?></td>
<td><?= $type[$timerecordingemployees[$timerecordinguser->id]['type']] ?></td>
<td class="text-center"><?= ($timerecordingemployees[$timerecordinguser->id]['startdate']) ? date("d.m.Y", $timerecordingemployees[$timerecordinguser->id]['startdate']) : "-" ?></td>
@@ -105,8 +116,14 @@ $type[3] = "Lehrling";
<td class="text-center"><?= $sum ?></td>
<td class="text-center"
data-order="<?= ($timerecordingemployees[$timerecordinguser->id]['plushours_now']) ? $timerecordingemployees[$timerecordinguser->id]['plushours_now'] : 0 ?>"><?= $plusHours ?></td>
<td class="text-center" data-order="<?= $timerecordingemployees[$timerecordinguser->id]['overtime_now'] ?>"><?= $overTime ?></td>
<td class="text-center" data-order="<?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] : '' ?>"><?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> </td>
<td class="text-center"
data-order="<?= $timerecordingemployees[$timerecordinguser->id]['overtime_now'] ?>"><?= $overTime ?></td>
<?php if ($me->superexpertEnabled()): ?>
<td class="text-center"
data-order="<?= $timerecordingemployees[$timerecordinguser->id]['bpa_hours'] ?>"><?= sprintf('%02dh:%02dm', floor($timerecordingemployees[$timerecordinguser->id]['bpa_hours'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['bpa_hours'] / 60 % 60)) ?></td>
<?php endif; ?>
<td class="text-center"
data-order="<?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] : '' ?>"><?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> </td>
<td class="text-center"><?= ($timerecordingemployees[$timerecordinguser->id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("TimerecordingEmployee", "edit", ['id' => $timerecordingemployees[$timerecordinguser->id]['id'], "userid" => $timerecordinguser->id]) ?>"><i
@@ -126,7 +143,9 @@ $type[3] = "Lehrling";
<script type="text/javascript">
var hidesearch = [3, 4, 5, 6, 7, 9];
<?php if ($me->superexpertEnabled()): ?>
hidesearch = [3, 4, 5, 6, 7,8 ,10];
<?php endif; ?>
$(document).ready(function () {
});

View File

@@ -251,17 +251,16 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
</select>
</div>
<div class="col-lg-1 car-div " style="display:none">
<input style="" type="text" id="mileage_start" name="mileage_start"
<input style="" type="number" id="mileage_start" name="mileage_start"
placeholder="KM Start"
class="form-control"/>
</div>
<div class="col-lg-1 car-div" style="display:none">
<input style="" type="text" id="mileage_end" name="mileage_end"
<input style="" type="number" id="mileage_end" name="mileage_end"
placeholder="KM Ende"
class="form-control"/>
</div>
</div>
<div class=" row mt-2">
<div class="col-lg-2 ">
<button id="submit-button" type="submit" class="btn btn-primary">Speichern</button>
@@ -270,16 +269,17 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
</button>
</div>
</div>
<div class=" row mt-2">
<div class="col-lg-4" id="message-box">
</div>
<div class=" row mt-2">
<div class="col-lg-4" id="message-box">
</div>
</div>
</div>
</div>
</form>
</form>
</div>
<div class="card">
<div class="card-body mb-3">
<div class="form-group module-row row mb-3">
@@ -317,7 +317,7 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
<div class="input-group">
<select id="datayear" class="form-control select2">
<?php foreach ($years as $key => $Year): ?>
<option <?= (date('Y', time()) == $Year) ? "selected='selsected'" : NULL ?>
<option <?= (date('Y', time()) == $Year) ? "selected='selected'" : NULL ?>
value="<?= $key ?>"><?= $Year ?></option>
<?php endforeach; ?>
</select>

View File

@@ -40,6 +40,7 @@ class TimerecordingBillingController extends mfBaseController
$month = strtotime("01." . $month);
$timerecordingsEmolyees = TimerecordingEmployeeModel::getAll();
foreach ($timerecordingsEmolyees as $timerecordingsEmolyee) {
if ($timerecordingsEmolyee->bmd_active == 0) continue;
$user = new User($timerecordingsEmolyee->user_id);
$employee_number = (string)$user->getFlag('employee_number');
$timerecordingReport = new TimerecordingReportController();
@@ -125,6 +126,7 @@ class TimerecordingBillingController extends mfBaseController
$companybmd = "1";
$timerecordingsEmolyees = TimerecordingEmployeeModel::getAll();
foreach ($timerecordingsEmolyees as $timerecordingsEmolyee) {
if ($timerecordingsEmolyee->bmd_active == 0) continue;
$user = new User($timerecordingsEmolyee->user_id);
$employee_number = (string)$user->getFlag('employee_number');
$employeetypesbmd = TimerecordingEmployeeModel::$employeetypesbmd;

View File

@@ -114,13 +114,21 @@ class TimerecordingEmployeeController extends mfBaseController
$data['holidays'] = trim($r->holidays);
$data['plushours'] = $plushours;
$data['startdate'] = strtotime($r->startdate);
$data['enddate'] = strtotime($r->enddate);
$data['type'] = trim($r->type);
$data['bmd_active'] = trim($r->bmd_active);
$data['overtime'] = $overtime;
#
if (!$data['overtime']) {
$data['overtime'] = 0;
}
if (!$data['bmd_active']) {
$data['bmd_active'] = 0;
}
if (!$data['enddate']) {
$data['enddate'] = null;
}
if ($r->birthday) {
$data['birthday'] = strtotime($r->birthday);

View File

@@ -16,6 +16,8 @@ class TimerecordingEmployeeModel
private $overtime_timestamp;
private $bpahours;
private $startdate;
private $enddate;
private $bmd_active;
private $birthday;
public static $employeetypesbmd = array('1' => '1000', '2' => '1200', '3' => '1400');

View File

@@ -411,6 +411,7 @@ class TimerecordingReportController extends mfBaseController
$overtime_now = $employee[0]->overtime_now;
$auto_workinghours = $employee[0]->auto_workinghours;
$startdate = $employee[0]->startdate;
$bpahours = $employee[0]->bpahours;
}
$workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $user_id]);
$holidays = TimerecordingHolidayModel::getAll();
@@ -775,6 +776,8 @@ class TimerecordingReportController extends mfBaseController
$json['time']['plushours'] = sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHours / 60 % 60));
$json['time']['plushours_now'] = $plusHours_now;
$json['time']['plushours_noworder'] = $plusHours_noworder;
$json['time']['bpahours'] = sprintf('%02dh:%02dm', floor($bpahours / 3600), floor($bpahours / 60 % 60));
$json['time']['overtime_now'] = sprintf('%02dh:%02dm', floor($overtime_now / 3600), floor($overtime_now / 60 % 60));
$json['time']['overtime_noworder'] = $overtime_now;
$json['time']['homeoffice'] = $homeofficesum;

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingEmployeeAddFieldBmd extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingEmployee", ["signed" => true]);
$table->addColumn("bmd_active", "integer", ["null" => false, "default" => 1, "after" => "bpahours"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("TimerecordingEmployee")->removeColumn("bmd_active")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}