Zeiterfassung Feature Jobrad

* Implementation
 * Migration
This commit is contained in:
Daniel Spitzer
2024-07-09 17:23:11 +02:00
parent c3af1b7374
commit 1fba2e392e
8 changed files with 90 additions and 10 deletions

View File

@@ -4,7 +4,8 @@
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= $git_merge_ts ?>" rel="stylesheet"
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"/>
<style>
.fa-arrow-right-from-bracket {
@@ -136,7 +137,7 @@
<th class="text-center">Sollst.</th>
<th class="text-center">Sollabweichung</th>
<th class="text-center min-w-100">Mehrst.</th>
<th class="text-center min-w-100">Ges. Überst.</th>
<th class="text-center min-w-100" title="Gesamte Gutstunden">Gutstunden</th>
<?php if ($me->superexpertEnabled()): ?>
<th class="text-center min-w-70">Black P. St.</th>
<?php endif; ?>
@@ -144,7 +145,7 @@
<th title="Überstunden 50%" class="text-center min-w-70">Ü50</th>
<th title="Überstunden 100%" class="text-center min-w-70">Ü100</th>
<th class="text-center">Diäten</th>
<th class="text-center">HO</th>
<th class="text-center" title="Homeoffice">HO</th>
</tr>
<tr id="filterrow">
<th></th>
@@ -192,8 +193,7 @@
}
?>
<tr>
<td class="text-nowrap">(<?= $employee_number ?>
) <?= $timerecording->timerecordingEmployee->user->name ?> </td>
<td class="text-nowrap">(<?= $employee_number ?>) <?= $timerecording->timerecordingEmployee->user->name ?> <?= ($timerecording->timerecordingEmployee->jobbike == 1) ? '<div class="float-right"><i title="Jobrad" class="fa-sharp fa-regular fa-person-biking"></i></div>' : '' ?></td>
<td class="text-center"><?= number_format(round($timerecording->ishours / 3600, 2), "2", ",", ".") ?></td>
<td class="text-center"><?= $nlz ?></td>
<td class="text-center"><?= number_format(round($timerecording->ishourssum / 3600, 2), "2", ",", ".") ?></td>
@@ -250,6 +250,9 @@
<div class="row">
<div class="col-12">
<table class="table ">
<tr>
<td colspan="2" id="modal-user-info"></td>
</tr>
<tr id="overtimes">
</tr>
<tr class="transfer-tr transfer-tr tr-plushours" style="display: none">
@@ -415,7 +418,11 @@
$('#submit-button').data('type', 'bpa');
$('#overtimeModal').data('id', button.data('id'));
}
console.log(button.closest('tr').find('.fa-person-biking').length);
$('#modal-user-info').html('<span class="font-weight-500 font-15">'+ button.closest('tr').find('td').eq(0).text()+'</span>');
if (button.closest('tr').find('.fa-person-biking').length) {
$('#modal-user-info').append('<div class="float-right font-15">'+button.closest('tr').find('.fa-person-biking').closest('div').html()+'</div>');
}
});

View File

@@ -258,7 +258,6 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
oldname = value.user.user;
}
if (value.ccategory.ccategory == "Sterbefall") {
console.log('cool');
category = "Sonderurlaub";
} else {
category = value.ccategory.ccategory;

View File

@@ -180,6 +180,17 @@ $daysSelect .= "</select>";
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label"
for="auto_workinghours">Jobrad</label>
<div class="col-lg-3">
<div class="form-check">
<input id="jobbike"
class="form-check-input" <?php if ($timerecordingemployees->jobbike) echo 'checked="checked"'; ?>
type="checkbox" name="jobbike" value="1"/>
</div>
</div>
</div>
<div id="workinghours_div">
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="workinghours">Sollzeiten

View File

@@ -67,6 +67,7 @@ $type[3] = "Lehrling";
<?php endif; ?>
<th class="text-center" title="Offene Urlaube">Urlaubstage</th>
<th class="text-center edit-width">Schnellb.</th>
<th class="text-center edit-width">Jobrad</th>
<th class="edit-width"></th>
</tr>
<tr id="filterrow">
@@ -86,6 +87,7 @@ $type[3] = "Lehrling";
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@@ -139,6 +141,7 @@ $type[3] = "Lehrling";
<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']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '0 Tage' ?> </td>
<td class="text-center pr-3"><?= ($timerecordingemployees[$timerecordinguser->id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?></td>
<td class="text-center pr-3"><?= ($timerecordingemployees[$timerecordinguser->id]['jobbike'] == '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
class="far fa-edit" title="Bearbeiten"></i></a>
@@ -157,11 +160,11 @@ $type[3] = "Lehrling";
src="<?= self::getResourcePath() ?>datatables/DataTables-2x/datatables.min.js?<?= $git_merge_ts ?>"></script>
<script type="text/javascript">
var hidesearch = [ 6, 7, 8, 9, 10,12];
var columnfilter = [0,11];
var hidesearch = [ 6, 7, 8, 9, 10,13];
var columnfilter = [0,11,12];
<?php if ($me->superexpertEnabled()): ?>
var columnfilter = [0,12];
hidesearch = [ 6, 7, 8, 9, 10, 11,13];
hidesearch = [ 6, 7, 8, 9, 10, 11,14];
<?php endif; ?>
var columnoptions = '<option value=""></option><option value="Ja">Ja</option><option value="Nein">Nein</option>';

View File

@@ -269,6 +269,12 @@ class TimerecordingBillingController extends mfBaseController
if ($timerecordingBillingEmployee->overtime50free > 64800) {
$bodyarray = [$monthbmd, "1", $employee_number, "3110", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3115", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3116", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
$diffsum = $timerecordingBillingEmployee->overtime50free - 64800;
$diffsum = $diffsum / 3600;
$diffsum = round($diffsum, 2);
@@ -279,6 +285,12 @@ class TimerecordingBillingController extends mfBaseController
$overtime50free = str_replace(".", ",", $overtime50free);
$bodyarray = [$monthbmd, "1", $employee_number, "3110", $overtime50free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3115", $overtime50free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3116", $overtime50free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
}
@@ -291,6 +303,12 @@ class TimerecordingBillingController extends mfBaseController
if ($timerecordingBillingEmployee->overtime100free > 64800) {
$bodyarray = [$monthbmd, "1", $employee_number, "3160", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3165", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3166", "18", "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
$diffsum = $timerecordingBillingEmployee->overtime100free - 64800;
$diffsum = $diffsum / 3600;
$diffsum = round($diffsum, 2);
@@ -300,6 +318,12 @@ class TimerecordingBillingController extends mfBaseController
} else {
$bodyarray = [$monthbmd, "1", $employee_number, "3160", $overtime100free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
if ($timerecordingBillingEmployee->timerecordingEmployee->jobbike == 1) {
$bodyarray = [$monthbmd, "1", $employee_number, "3165", $overtime100free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
$bodyarray = [$monthbmd, "1", $employee_number, "3166", $overtime100free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
}
}

View File

@@ -123,6 +123,7 @@ class TimerecordingEmployeeController extends mfBaseController
$data = [];
$data['user_id'] = trim($r->user_id);
$data['auto_workinghours'] = trim($r->auto_workinghours);
$data['jobbike'] = trim($r->jobbike);
$data['holidays'] = trim($r->holidays);
$data['plushours'] = $plushours;
$data['startdate'] = strtotime($r->startdate);
@@ -172,6 +173,9 @@ class TimerecordingEmployeeController extends mfBaseController
if (!$data['auto_workinghours']) {
$data['auto_workinghours'] = 0;
}
if (!$data['jobbike']) {
$data['jobbike'] = 0;
}
if ($mode == "edit") {
$timerecordingemployees->update($data);

View File

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

View File

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