Merge branch 'spidev' into 'master'
Zeiterfassung Update See merge request fronk/thetool!368
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
|
||||
|
||||
?>
|
||||
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<style>
|
||||
@@ -11,16 +12,52 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fa-arrow-to-left {
|
||||
color: #d12222;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 7px;
|
||||
}
|
||||
|
||||
.fa-arrow-from-left {
|
||||
color: #2238d1;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.filler {
|
||||
width: 30px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.filler-left {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.filler-0 {
|
||||
width: 7px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.filler-1 {
|
||||
width: 10px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.min-w-70 {
|
||||
min-width: 70px;
|
||||
}
|
||||
|
||||
.min-w-100 {
|
||||
min-width: 100px;
|
||||
}
|
||||
|
||||
#overtimeModal .table td, #overtimeModal .table th {
|
||||
border: none;
|
||||
}
|
||||
@@ -31,6 +68,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
.sm-text-left {
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
|
||||
color: #008b0b;
|
||||
}
|
||||
|
||||
.sm-text-right-ot {
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
right: 30px;
|
||||
|
||||
color: #008b0b;
|
||||
}
|
||||
|
||||
.sm-text-right {
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
right: 30px;
|
||||
color: #f1556c;
|
||||
}
|
||||
|
||||
</style>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
@@ -64,19 +129,19 @@
|
||||
<th class="text-center">Mitarbeiter/PersNr.</th>
|
||||
<th class="text-center">Leistungszeiten</th>
|
||||
<th class="text-center">Nichtleistungszeiten</th>
|
||||
<th class="text-center">Istst.(NLZ+LZ)</th>
|
||||
<th class="text-center">Sollstunden</th>
|
||||
<th class="text-center">NLZ+LZ</th>
|
||||
<th class="text-center">Sollst.</th>
|
||||
<th class="text-center">Sollabweichung</th>
|
||||
<th class="text-center">Mehrstunden</th>
|
||||
<th class="text-center">Ges. Überst.</th>
|
||||
<th class="text-center min-w-100">Mehrst.</th>
|
||||
<th class="text-center min-w-100">Ges. Überst.</th>
|
||||
<?php if ($me->superexpertEnabled()): ?>
|
||||
<th class="text-center">Black P. Stunden</th>
|
||||
<th class="text-center min-w-70">Black P. St.</th>
|
||||
<?php endif; ?>
|
||||
<th title="Mehrstunden 25%" class="text-center">M25</th>
|
||||
<th title="Überstunden 50%" class="text-center">Ü50</th>
|
||||
<th title="Überstunden 100%" class="text-center">Ü100</th>
|
||||
<th title="Mehrstunden 25%" class="text-center min-w-70">M25</th>
|
||||
<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">Homeoffice</th>
|
||||
<th class="text-center">HO</th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
@@ -115,33 +180,50 @@
|
||||
} else {
|
||||
$nlz = "";
|
||||
}
|
||||
if ($timerecording->transfer_overtime > 0) {
|
||||
$overtimeclass = "sm-text-right";
|
||||
} else {
|
||||
$overtimeclass = "sm-text-right-ot";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-nowrap">(<?= $employee_number ?>) <?= $timerecording->timerecordingEmployee->user->name ?> </td>
|
||||
<td class="text-nowrap">(<?= $employee_number ?>
|
||||
) <?= $timerecording->timerecordingEmployee->user->name ?> </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>
|
||||
<td class="text-center"><?= number_format(round($timerecording->musthours / 3600, 2), "2", ",", ".") ?></td>
|
||||
<td class="text-center overtimeplushours-td" data-overtimeplushours="<?= number_format(round(($timerecording->overtime_plushours) / 3600, 2), "2", ",", ".") ?>"><?= number_format(round(($timerecording->ishourssum-$timerecording->musthours) / 3600, 2), "2", ",", ".") ?> <span class="text-danger font-weight-500"><?= ($timerecording->overtime_plushours) ? "(".number_format(round(($timerecording->overtime_plushours) / 3600, 2), "2", ",", ".").")" : '' ?></span></td>
|
||||
|
||||
<td class="text-center"><?= ($timerecording->plushours_all == 0) ? '<div class="filler-0 float-left"></div>' : '' ?><?= number_format(round(($timerecording->plushours_all) / 3600, 2), "2", ",", ".") ?>
|
||||
<?= ($timerecording->plushours_all > 0) ? '<i class="float-right fa-regular fa-arrow-right-from-bracket change-difference" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round(($timerecording->plushours_all) / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '<div class="filler float-right"></div>' ?></td>
|
||||
<td class="text-center"><?= ($timerecording->timerecordingEmployee->overtime_now == 0) ? '<div class="filler-0 float-left"></div>' : '' ?><?= number_format(round($timerecording->timerecordingEmployee->overtime_now / 3600, 2), "2", ",", ".") ?>
|
||||
<?= ($timerecording->timerecordingEmployee->overtime_now > 0) ? '<i class="float-right fa-regular fa-arrow-right-from-bracket change-overtime" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round($timerecording->timerecordingEmployee->overtime_now / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '<div class="filler float-right"></div>' ?></td>
|
||||
<td data-order="<?= $timerecording->overtime_plushours ?>"
|
||||
class="text-center overtimeplushours-td"
|
||||
data-overtimeplushours="<?= number_format(round(($timerecording->overtime_plushours) / 3600, 2), "2", ",", ".") ?>"><?= number_format(round(($timerecording->ishourssum - $timerecording->musthours) / 3600, 2), "2", ",", ".") ?>
|
||||
<span class="text-danger font-weight-500"><?= ($timerecording->overtime_plushours) ? "(" . number_format(round(($timerecording->overtime_plushours) / 3600, 2), "2", ",", ".") . ")" : '' ?></span>
|
||||
</td>
|
||||
<td data-order="<?= $timerecording->plushours_all ?>"
|
||||
data-transfer="<?= round($timerecording->transfer_plushours / 3600, 2) ?>"
|
||||
class="text-center transfer_plushours_info position-relative"><?= '<span class="filler-left">' . number_format(round($timerecording->plushours_all / 3600, 2), "2", ",", ".") ?></span><?= ($timerecording->plushours_all > 0) ? '<i class="fas fa-arrow-from-left change-difference" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round($timerecording->plushours_all / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '' ?><?= ($timerecording->transfer_plushours) ? '<span class="sm-text-right ">' . round($timerecording->transfer_plushours * -1 / 3600, 2) . '</span>' : '' ?></td>
|
||||
<td data-transfer="<?= round($timerecording->transfer_overtime / 3600, 2) ?>"
|
||||
data-order="<?= $timerecording->timerecordingEmployee->overtime_now ?>"
|
||||
class="text-center position-relative transfer_overtime_info"><?= '<span class="filler-left">' . number_format(round($timerecording->timerecordingEmployee->overtime_now / 3600, 2), "2", ",", ".") ?></span><?= ($timerecording->timerecordingEmployee->overtime_now > 0) ? '<i class="fas fa-arrow-from-left change-overtime" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round($timerecording->timerecordingEmployee->overtime_now / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '' ?><?= ($timerecording->transfer_overtime) ? '<span class=" ' . $overtimeclass . '">' . round($timerecording->transfer_overtime * -1 / 3600, 2) . '</span>' : '' ?></span></td>
|
||||
<?php if ($me->superexpertEnabled()): ?>
|
||||
<td class="text-center"><?= number_format(round($timerecording->timerecordingEmployee->bpahours / 3600, 2), "2", ",", ".") ?></td>
|
||||
<td data-order="<?= $timerecording->timerecordingEmployee->bpahours ?>"
|
||||
class="text-center position-relative"><?= ($timerecording->transfer_bpahours * -1 > 0) ? '<i class="fas fa-arrow-to-left change-bpa" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round($timerecording->transfer_bpahours * -1 / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '' ?> <?= '<span class="filler-left">' . number_format(round($timerecording->timerecordingEmployee->bpahours / 3600, 2), "2", ",", ".") ?><?= ($timerecording->transfer_bpahours) ? '<span class="sm-text-left">' . (round($timerecording->transfer_bpahours * -1 / 3600, 2)) . '</span>' : '' ?> </span></td>
|
||||
<?php endif; ?>
|
||||
<td class="text-center"><?= number_format(round($timerecording->plushours25 / 3600, 2), "2", ",", ".") ?></td>
|
||||
<td class="text-center"><?= number_format(round($timerecording->overtime50free / 3600, 2), "2", ",", ".") ?></td>
|
||||
<td class="text-center"><?= number_format(round($timerecording->overtime100free / 3600, 2), "2", ",", ".") ?></td>
|
||||
<td class="text-center"><?= number_format($timerecording->diet, 2, ',', '.') . " €" ?></td>
|
||||
<td class="text-center"><?= $timerecording->homeoffice ?> Tag(e)</td>
|
||||
<td data-order="<?= $timerecording->plushours25 ?>"
|
||||
class="text-center position-relative"><?= ($timerecording->plushours25 > 0) ? '<i class="fas fa-arrow-to-left change-overtime-25" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round($timerecording->plushours25 / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '' ?> <?= '<span class="filler-left">' . number_format(round($timerecording->plushours25 / 3600, 2), "2", ",", ".") ?></span></td>
|
||||
<td data-order="<?= $timerecording->overtime50free ?>"
|
||||
class="text-center position-relative"><?= ($timerecording->overtime50free > 0) ? '<i class="fas fa-arrow-to-left change-overtime-50" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round($timerecording->overtime50free / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '' ?> <?= '<span class="filler-left">' . number_format(round($timerecording->overtime50free / 3600, 2), "2", ",", ".") ?></span></td>
|
||||
<td data-order="<?= $timerecording->overtime100free ?>"
|
||||
class="text-center position-relative"><?= ($timerecording->overtime100free > 0) ? '<i class="fas fa-arrow-to-left change-overtime-100" data-toggle="modal" data-target="#overtimeModal" data-hours="' . number_format(round($timerecording->overtime100free / 3600, 2), "2", ",", ".") . '" data-id="' . $timerecording->id . '"></i>' : '' ?> <?= '<span class="filler-left">' . number_format(round($timerecording->overtime100free / 3600, 2), "2", ",", ".") ?></span></td>
|
||||
<td data-order="<?= $timerecording->diet ?>"
|
||||
class="text-center"><?= number_format($timerecording->diet, 2, ',', '.') . " €" ?></td>
|
||||
<td class="text-center"><?= $timerecording->homeoffice ?> T</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="spinner-big text-info mt-3 ml-5" style="display: none" >
|
||||
<i class="fas fa-spinner fa-spin spinner-ico font-24 align-middle "></i> <span class="text-dark ml-2 font-weight-500 font-18 d-inline-block">Monatsabschluss wird rückgängig gemacht...</span>
|
||||
<div class="spinner-big text-info mt-3 ml-5" style="display: none">
|
||||
<i class="fas fa-spinner fa-spin spinner-ico font-24 align-middle "></i> <span
|
||||
class="text-dark ml-2 font-weight-500 font-18 d-inline-block">Monatsabschluss wird rückgängig gemacht...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -165,33 +247,39 @@
|
||||
<table class="table ">
|
||||
<tr id="overtimes">
|
||||
</tr>
|
||||
<tr class="overtime-modal-div" style="display:none">
|
||||
<th class="align-middle">Gutstundenkonto</th>
|
||||
<tr class="transfer-tr transfer-tr tr-plushours" style="display: none">
|
||||
<th class="text-nowrap align-middle">Mehrstunden <span class="info"></span></th>
|
||||
<td><input type="number" step="any" class="form-control change-overtime-value"
|
||||
name="plushours"
|
||||
id="plushours"></td>
|
||||
</tr>
|
||||
<tr class="overtime-modal-div transfer-tr tr-overtimehours" style="display:none">
|
||||
<th class="align-middle">Gutstunden <span class="info"></span></th>
|
||||
<td><input type="number" step="any" class="form-control change-overtime-value"
|
||||
name="overtimehours"
|
||||
id="overtimehours"></td>
|
||||
</tr>
|
||||
<tr class="overtime-modal-div" style="display:none">
|
||||
<tr class="overtime-modal-div transfer-tr tr-plushours25" style="display:none">
|
||||
<th class="align-middle">Mehrstunden 25</th>
|
||||
<td><input type="number" step="any" class="form-control change-overtime-value"
|
||||
name="plushours25"
|
||||
id="plushours25"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="transfer-tr tr-overtime50">
|
||||
<th class="align-middle">Überstunden 50</th>
|
||||
<td><input type="number" step="any" class="form-control change-overtime-value"
|
||||
name="overtime50"
|
||||
id="overtime50"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="transfer-tr tr-overtime100">
|
||||
<th class="text-nowrap align-middle">Überstunden 100</th>
|
||||
<td><input type="number" step="any" class="form-control change-overtime-value"
|
||||
name="overtime100"
|
||||
id="overtime100"></td>
|
||||
</tr>
|
||||
<?php if ($me->superexpertEnabled()): ?>
|
||||
<tr>
|
||||
<th class="text-nowrap align-middle">Blackpig</th>
|
||||
<tr class="transfer-tr tr-overtimebpa">
|
||||
<th class="text-nowrap align-middle ">Blackpig</th>
|
||||
<td><input type="number" step="any" class="form-control change-overtime-value"
|
||||
name="overtimebpa"
|
||||
id="overtimebpa"></td>
|
||||
@@ -215,9 +303,9 @@
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12];
|
||||
var hidesearch = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
||||
<?php if ($me->superexpertEnabled()): ?>
|
||||
hidesearch = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,12,13];
|
||||
hidesearch = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
||||
<?php endif; ?>
|
||||
var pageLength = 100;
|
||||
$(document).ready(function () {
|
||||
@@ -246,31 +334,83 @@
|
||||
});
|
||||
$('#overtimeModal').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget);
|
||||
console.log(button.closest('tr').html());
|
||||
|
||||
$('.change-overtime-value').val('');
|
||||
$('.change-overtime-value').attr('max', '');
|
||||
$('.info').text('');
|
||||
$('.transfer-tr').hide();
|
||||
if (button.hasClass('change-difference')) {
|
||||
$('#overtimeModal-title').text('Mehrstunden Transfer');
|
||||
$('#overtimeModal').data('id', button.data('id'));
|
||||
var overtimeplushours=button.closest('tr').find('.overtimeplushours-td').data('overtimeplushours');
|
||||
var overtimeplushours = button.closest('tr').find('.overtimeplushours-td').data('overtimeplushours');
|
||||
|
||||
if (overtimeplushours != "0,00") {
|
||||
var overtimeplushourstext='<span class="text-danger font-weight-500 ml-1">('+ button.closest('tr').find('.overtimeplushours-td').data('overtimeplushours')+ ')</span>';
|
||||
var overtimeplushourstext = '<span class="text-danger font-weight-500 ml-1">(' + button.closest('tr').find('.overtimeplushours-td').data('overtimeplushours') + ')</span>';
|
||||
} else {
|
||||
var overtimeplushourstext="";
|
||||
var overtimeplushourstext = "";
|
||||
}
|
||||
|
||||
|
||||
$('#overtimes').html('<th>Mehrstunden:</th> <td id="overtime-hours" data-hours="' + button.data('hours') + '">' + button.data('hours') + overtimeplushourstext + '</td>');
|
||||
$('#submit-button').data('type', 'difference');
|
||||
$('.overtime-modal-div').show();
|
||||
}
|
||||
if (button.hasClass('change-overtime')) {
|
||||
$('.tr-plushours25').show();
|
||||
$('.tr-overtimehours').show();
|
||||
$('.tr-overtimebpa').show();
|
||||
$('.tr-overtime50').show();
|
||||
$('.tr-overtime100').show();
|
||||
} else if (button.hasClass('change-overtime')) {
|
||||
$('#overtimeModal-title').text('Überstunden Transfer');
|
||||
$('#overtimes').html('<th>Überstunden:</th> <td id="overtime-hours" data-hours="' + button.data('hours') + '">' + button.data('hours') + '</td>');
|
||||
$('#submit-button').data('type', 'overtime');
|
||||
$('#overtimeModal').data('id', button.data('id'));
|
||||
$('.overtime-modal-div').hide();
|
||||
$('.tr-overtime50').show();
|
||||
$('.tr-overtimebpa').show();
|
||||
$('.tr-overtime100').show();
|
||||
} else if (button.hasClass('change-overtime-25')) {
|
||||
$('.tr-plushours').show();
|
||||
$('.tr-plushours').find('.info').text('(' + button.closest('tr').find('.transfer_plushours_info').data('transfer') + ')');
|
||||
$('.tr-overtimehours').show();
|
||||
$('.tr-overtimehours').find('.info').text('(' + button.closest('tr').find('.transfer_overtime_info').data('transfer') + ')');
|
||||
$('#plushours').attr('max', button.closest('tr').find('.transfer_plushours_info').data('transfer'));
|
||||
$('#overtimehours').attr('max', button.closest('tr').find('.transfer_overtime_info').data('transfer'));
|
||||
$('#overtimeModal-title').text('Mehrstunden 25% Transfer');
|
||||
$('#overtimes').html('<th>Mehrst. 25%:</th> <td id="overtime-hours" data-hours="' + button.data('hours') + '">' + button.data('hours') + '</td>');
|
||||
$('#submit-button').data('type', 'plushours25');
|
||||
$('#overtimeModal').data('id', button.data('id'));
|
||||
} else if (button.hasClass('change-overtime-50')) {
|
||||
$('.tr-plushours').show();
|
||||
$('.tr-plushours').find('.info').text('(' + button.closest('tr').find('.transfer_plushours_info').data('transfer') + ')');
|
||||
$('.tr-overtimehours').show();
|
||||
$('.tr-overtimehours').find('.info').text('(' + button.closest('tr').find('.transfer_overtime_info').data('transfer') + ')');
|
||||
$('#plushours').attr('max', button.closest('tr').find('.transfer_plushours_info').data('transfer'));
|
||||
$('#overtimehours').attr('max', button.closest('tr').find('.transfer_overtime_info').data('transfer'));
|
||||
$('#overtimeModal-title').text('Überstunden 50% Transfer');
|
||||
$('#overtimes').html('<th>Überst. 50%:</th> <td id="overtime-hours" data-hours="' + button.data('hours') + '">' + button.data('hours') + '</td>');
|
||||
$('#submit-button').data('type', 'overtime50free');
|
||||
$('#overtimeModal').data('id', button.data('id'));
|
||||
} else if (button.hasClass('change-overtime-100')) {
|
||||
$('.tr-plushours').show();
|
||||
$('.tr-plushours').find('.info').text('(' + button.closest('tr').find('.transfer_plushours_info').data('transfer') + ')');
|
||||
$('.tr-overtimehours').show();
|
||||
$('.tr-overtimehours').find('.info').text('(' + button.closest('tr').find('.transfer_overtime_info').data('transfer') + ')');
|
||||
$('#plushours').attr('max', button.closest('tr').find('.transfer_plushours_info').data('transfer'));
|
||||
$('#overtimehours').attr('max', button.closest('tr').find('.transfer_overtime_info').data('transfer'));
|
||||
$('#overtimeModal-title').text('Überstunden 100% Transfer');
|
||||
$('#overtimes').html('<th>Überst.100%:</th> <td id="overtime-hours" data-hours="' + button.data('hours') + '">' + button.data('hours') + '</td>');
|
||||
$('#submit-button').data('type', 'overtime100free');
|
||||
$('#overtimeModal').data('id', button.data('id'));
|
||||
} else if (button.hasClass('change-bpa')) {
|
||||
$('.tr-plushours').show();
|
||||
$('.tr-plushours').find('.info').text('(' + button.closest('tr').find('.transfer_plushours_info').data('transfer') + ')');
|
||||
$('.tr-overtimehours').show();
|
||||
$('.tr-overtimehours').find('.info').text('(' + button.closest('tr').find('.transfer_overtime_info').data('transfer') + ')');
|
||||
$('#plushours').attr('max', button.closest('tr').find('.transfer_plushours_info').data('transfer'));
|
||||
$('#overtimehours').attr('max', button.closest('tr').find('.transfer_overtime_info').data('transfer'));
|
||||
$('#overtimeModal-title').text('Black P. Transfer');
|
||||
$('#overtimes').html('<th>Black P:</th> <td id="overtime-hours" data-hours="' + button.data('hours') + '">' + button.data('hours') + '</td>');
|
||||
$('#submit-button').data('type', 'bpa');
|
||||
$('#overtimeModal').data('id', button.data('id'));
|
||||
}
|
||||
$('.change-overtime-value').val('');
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('body').on('click', '#month-abort', function () {
|
||||
@@ -287,15 +427,20 @@
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('body').on('change', '.change-overtime-value', function () {
|
||||
$('body').on('change keyup ', '.change-overtime-value', function () {
|
||||
//$('#overtime-hours').data('hours') to float
|
||||
|
||||
|
||||
var difference = 0;
|
||||
|
||||
$(".change-overtime-value").each(function (index) {
|
||||
//check if float
|
||||
var value = $(this).val().replace(",", ".");
|
||||
// console.log(value);
|
||||
if ($(this).attr('max') != '') {
|
||||
if (parseFloat(value) > parseFloat($(this).attr('max'))) {
|
||||
$(this).val($(this).attr('max'));
|
||||
}
|
||||
}
|
||||
if (isNaN(parseFloat(value))) {
|
||||
|
||||
} else {
|
||||
@@ -304,13 +449,11 @@
|
||||
});
|
||||
var valdiff = difference - parseFloat($(this).val());
|
||||
valdiff = Math.round(valdiff * 100) / 100;
|
||||
console.log("valdif" + valdiff);
|
||||
var hours = $('#overtime-hours').data('hours').replace(",", ".");
|
||||
|
||||
if (parseFloat(hours) < difference) {
|
||||
difference = difference - parseFloat(hours)
|
||||
difference = Math.round(difference * 100) / 100;
|
||||
console.log(difference);
|
||||
if (valdiff == 0) {
|
||||
$(this).val(hours);
|
||||
} else if (valdiff == parseFloat(hours)) {
|
||||
@@ -328,6 +471,7 @@
|
||||
$('body').on('click', '#submit-button', function () {
|
||||
var id = $('#overtimeModal').data('id');
|
||||
var plushours25 = $('#plushours25').val();
|
||||
var plushours = $('#plushours').val();
|
||||
var overtime50 = $('#overtime50').val();
|
||||
var overtime100 = $('#overtime100').val();
|
||||
var overtimebpa = $('#overtimebpa').val();
|
||||
@@ -335,40 +479,17 @@
|
||||
$.post("<?= self::getUrl("TimerecordingBilling", "api", ['do' => 'saveovertime']) ?>", {
|
||||
id: id,
|
||||
type: $(this).data('type'),
|
||||
plushours: plushours,
|
||||
plushours25: plushours25,
|
||||
overtimehours:overtimehours,
|
||||
overtimehours: overtimehours,
|
||||
overtime50: overtime50,
|
||||
overtime100: overtime100,
|
||||
overtimebpa: overtimebpa,
|
||||
ajax: 1
|
||||
}).done(function (data) {
|
||||
window.location.reload();
|
||||
ö
|
||||
});
|
||||
});
|
||||
//$.post(insertUrl, {
|
||||
// id: $.trim($('#id').val()),
|
||||
// timerecordingCategory_id: $.trim($('#timerecordingCategory_id').val()),
|
||||
// date: $.trim($('#date').val()),
|
||||
// enddate: $.trim($('#enddate').val()),
|
||||
// start: $.trim($('#start').val()),
|
||||
// end: $.trim($('#end').val()),
|
||||
// comment: $.trim($('#comment').val()),
|
||||
// businesstrip: businesstrip,
|
||||
// businesstrip_info: $.trim($('#businesstrip_info').val()),
|
||||
// timerecordingCar_id: $.trim($('#timerecordingCar_id').val()),
|
||||
// mileage_start: $.trim($('#mileage_start').val()),
|
||||
// mileage_end: $.trim($('#mileage_end').val()),
|
||||
// homeoffice: homeoffice,
|
||||
// hourday: $.trim($('#timerecordingCategory_id').find(':selected').data('hourday')),
|
||||
// ajax: 1
|
||||
//}).done(function (data) {
|
||||
// if (data.success) {
|
||||
// window.location.href = '<?php //= self::getUrl("Timerecording") ?>//';
|
||||
// } else {
|
||||
// $('#error').html(data.error);
|
||||
// }
|
||||
//});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
|
||||
@@ -152,6 +152,13 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.fc .fc-daygrid-day.fc-day-today {
|
||||
background-color: rgb(239 240 255);
|
||||
}
|
||||
.fc-event-title {
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/moment.min.js?<?= date('U') ?>"></script>
|
||||
@@ -209,7 +216,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
||||
$.getJSON(requestUrl, function (data) {
|
||||
|
||||
}).done(function (json) {
|
||||
var bgcolors = ['rgba(251, 71, 71,0.2)', 'rgba(253, 126, 20, 0.25)', 'rgba(91, 71, 251, 0.2)', 'rgba(71, 251, 151, 0.2)', 'rgba(251, 71, 194, 0.2)', 'rgba(20, 251, 253, 0.25)'];
|
||||
var bgcolors = ['rgb(71 93 251 / 34%)', 'rgb(228 187 249 / 65%)', 'rgb(243 251 117 / 68%)', 'rgb(71 251 176 / 68%)', 'rgb(119 206 247 / 65%)', 'rgb(251 196 71 / 68%)','rgb(251 171 216 / 69%)','rgb(152 155 243 / 65%)','rgb(243 152 109 / 68%)','rgb(255 187 187 / 65%)','rgb(131 245 60 / 68%)','rgb(144 241 245 / 65%)'];
|
||||
//read data from json
|
||||
var json = json.data;
|
||||
var holidays = [];
|
||||
@@ -218,12 +225,12 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
||||
$.each(json, function (index, value) {
|
||||
if (oldname != value.user.user) {
|
||||
colorcount++;
|
||||
if (colorcount > 5) {
|
||||
if (colorcount > 11) {
|
||||
colorcount = 0;
|
||||
}
|
||||
oldname = value.user.user;
|
||||
}
|
||||
if (value.hourday.hourday!='5') {
|
||||
if (value.hourday.hourday != '5') {
|
||||
holidays.push({
|
||||
id: cindex,
|
||||
backgroundColor: bgcolors[colorcount],
|
||||
@@ -275,6 +282,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
locale: 'de',
|
||||
themeSystem: 'bootstrap4',
|
||||
headerToolbar: {
|
||||
left: "prev,today,next",
|
||||
center: 'title',
|
||||
|
||||
@@ -152,7 +152,7 @@ $daysSelect .= "</select>";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row" style="display:none">
|
||||
<div class="form-group row" style="">
|
||||
<label class="col-lg-2 col-form-label" for="plushours">Initiale Gutstunden</label>
|
||||
<div class="col-lg-1">
|
||||
<input type="text" id="plushours" name="plushours"
|
||||
@@ -161,7 +161,7 @@ $daysSelect .= "</select>";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row" style="display:none">
|
||||
<div class="form-group row" style="">
|
||||
<label class="col-lg-2 col-form-label" for="overtime">Initiale Überstunden</label>
|
||||
<div class="col-lg-1">
|
||||
<input type="text" id="overtime" name="overtime"
|
||||
|
||||
@@ -690,6 +690,75 @@ class TimerecordingBillingController extends mfBaseController
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
} else if ($type == "bpa") {
|
||||
$sum = 0;
|
||||
$data = [];
|
||||
if ($this->request->plushours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['plushours_now'] = $timerecordingEmployee->plushours_now + $this->request->plushours * 3600;
|
||||
$dataemployee['plushours'] = $timerecordingEmployee->plushours + $this->request->plushours * 3600;
|
||||
$data['transfer_plushours'] = $timerecordingbillingsemployee->transfer_plushours - $this->request->plushours * 3600;
|
||||
$data['plushours_all'] = $timerecordingbillingsemployee->plushours_all + $this->request->plushours * 3600;
|
||||
$sum += $this->request->plushours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
if ($this->request->overtimehours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['overtime_now'] = $timerecordingEmployee->overtime_now + $this->request->overtimehours * 3600;
|
||||
$dataemployee['overtime'] = $timerecordingEmployee->overtime + $this->request->overtimehours * 3600;
|
||||
$data['transfer_overtime'] = $timerecordingbillingsemployee->transfer_overtime - $this->request->overtimehours * 3600;
|
||||
$sum += $this->request->overtimehours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
$data['transfer_bpahours'] = $timerecordingbillingsemployee->transfer_bpahours + $sum;
|
||||
$timerecordingbillingsemployee->update($data);
|
||||
$timerecordingbillingsemployee->save();
|
||||
$dataemployee = [];
|
||||
$dataemployee['bpahours'] = $timerecordingEmployee->bpahours - $sum;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
|
||||
} else if ($type == "plushours25" || $type == "overtime50free" || $type == "overtime100free") {
|
||||
$sum = 0;
|
||||
$data = [];
|
||||
if ($this->request->plushours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['plushours_now'] = $timerecordingEmployee->plushours_now + $this->request->plushours * 3600;
|
||||
$dataemployee['plushours'] = $timerecordingEmployee->plushours + $this->request->plushours * 3600;
|
||||
$data['transfer_plushours'] = $timerecordingbillingsemployee->transfer_plushours - $this->request->plushours * 3600;
|
||||
$data['plushours_all'] = $timerecordingbillingsemployee->plushours_all + $this->request->plushours * 3600;
|
||||
$sum += $this->request->plushours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
if ($this->request->overtimehours) {
|
||||
$timerecordingbillingsemployee->timerecordingEmployee->id;
|
||||
$timerecordingEmployee = new TimerecordingEmployee($timerecordingbillingsemployee->timerecordingEmployee->id);
|
||||
$dataemployee = [];
|
||||
$dataemployee['overtime_now'] = $timerecordingEmployee->overtime_now + $this->request->overtimehours * 3600;
|
||||
$dataemployee['overtime'] = $timerecordingEmployee->overtime + $this->request->overtimehours * 3600;
|
||||
$data['transfer_overtime'] = $timerecordingbillingsemployee->transfer_overtime - $this->request->overtimehours * 3600;
|
||||
$sum += $this->request->overtimehours * 3600;
|
||||
$timerecordingEmployee->update($dataemployee);
|
||||
$timerecordingEmployee->save();
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
$data[$type] = $timerecordingbillingsemployee->{$type} - $sum;
|
||||
$timerecordingbillingsemployee->update($data);
|
||||
$timerecordingbillingsemployee->save();
|
||||
}
|
||||
}
|
||||
$response['state'] = "success";
|
||||
echo json_encode($response);
|
||||
|
||||
@@ -157,6 +157,7 @@ private $holidays ;
|
||||
$enddate = "";
|
||||
$sum = "-";
|
||||
$day = "";
|
||||
$enddatecend="";
|
||||
$orderdate = $timerecording->start;
|
||||
if ($timerecording->timerecordingCategory->hourday == 1) {
|
||||
$date = date("d.m.Y", $timerecording->start);
|
||||
@@ -224,6 +225,7 @@ private $holidays ;
|
||||
$enddatetemp = date("Y-m-d", time());
|
||||
$enddatetemp = strtotime($enddatetemp . " 23:59:59");
|
||||
$enddate = date("Y-m-d", $enddatetemp + 7200);
|
||||
$enddatecend= date("Y-m-d", $enddatetemp + 1216800);
|
||||
$start = "-";
|
||||
$end = "-";
|
||||
$day = $daysgerm[date("w", $timerecording->start)];
|
||||
@@ -355,6 +357,11 @@ private $holidays ;
|
||||
endif;
|
||||
if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5)) {
|
||||
} else {
|
||||
if (!$enddatecend)
|
||||
{
|
||||
$enddatecend=$enddate;
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
'user' => array('user' => $timerecording->user->name, 'order' => $timerecording->user->name),
|
||||
'date' => array('date' => $state . $day . " " . $date, 'order' => $orderdate),
|
||||
@@ -362,7 +369,7 @@ private $holidays ;
|
||||
'end' => array('end' => $end, 'order' => $end),
|
||||
'sum' => array('sum' => $sum, 'order' => $sum),
|
||||
'cstart' => array('cstart' => $datadate, 'order' => $datadate),
|
||||
'cend' => array('cend' => $enddate, 'order' => $enddate),
|
||||
'cend' => array('cend' => $enddatecend, 'order' => $enddatecend),
|
||||
'ccategory' => array('ccategory' => $timerecording->timerecordingCategory->name, 'order' => $timerecording->timerecordingCategory->name),
|
||||
'category' => array('category' => $category, 'order' => $timerecording->timerecordingCategory->name),
|
||||
'comment' => array('comment' => $timerecording->comment, 'order' => $timerecording->comment),
|
||||
|
||||
Reference in New Issue
Block a user