Files
thetool/Layout/default/TimerecordingBilling/Detail.php
Spi 2f81e1d77e Zeiterfassung Update
* Berechnungen BP
 * Möglichkeit Mehrstunden in Gutstunden umzuwandeln
2024-05-07 10:24:30 +02:00

162 lines
8.1 KiB
PHP

<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
</li>
<li class="breadcrumb-item active">Zeiterfassung Verrechnung</li>
</ol>
</div>
<h4 id="month" data-month="<?= $month ?>" class="page-title">Verrechnung/Abrechnung <?= $month ?></h4>
</div>
</div>
</div>
<!-- end page title -->
<div class="card">
<div class="card-body mb-3">
<div class="row">
<div class="col-12" id="page-header">
<div class="float-left">
<h4 class="header-title">Liste aller Mitarbeiter</h4>
</div>
</div>
</div>
<table id="datatable" class="table table-hover table-sm">
<thead>
<tr>
<th class="text-center">Mitarbeiter</th>
<th class="text-center">Personal Nr.</th>
<th class="text-center">Sollstunden</th>
<th class="text-center">Iststunden</th>
<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>
</tr>
<tr id="filterrow">
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<?php if ($me->superexpertEnabled()): ?>
<th></th>
<?php endif; ?>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($timerecordings as $timerecording):
if (!empty($timerecording['data']['time']['daysum'])) {
$offdays = "";
$counter = 1;
foreach ($timerecording['data']['time']['daysum'] as $category => $value) {
if ($counter > 1) {
$offdays .= "</div>";
}
$offdays .= "<div>";
if ($value < 100) {
$offdays .= $category . ": " . $value . " Tag(e) ";
} else {
$offdays .= $category . ": " . sprintf('%02dh:%02dm', floor($value / 3600), floor($value / 60 % 60));
}
$counter++;
}
$offdays .= "</div>";
} else {
$offdays = "-";
}
?>
<tr>
<td><?= $timerecording['user_name'] ?></td>
<td class="text-center edit-width-large"><?= $timerecording['employee_number'] ?></td>
<td data-order="<?= $timerecording['data']['time']['mustorder'] ?>"
class="text-center"><?= $timerecording['data']['time']['must'] ?></td>
<td data-order="<?= $timerecording['data']['time']['isorder'] ?>"
class="text-center"><?= $timerecording['data']['time']['is'] ?></td>
<td data-order="<?= $timerecording['data']['time']['summsecondsorder'] ?>"
class="text-center"><?= $timerecording['data']['time']['summseconds'] ?></td>
<td data-order="<?= $timerecording['data']['time']['plushours_noworder'] ?>"
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>
</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 generiert...</span>
</div>
</div>
</div>
</div>
</div>
<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; ?>
var pageLength = 100;
$(document).ready(function () {
$('.buttons-excel').closest('div').append('<div ><button id="month-complete" class="btn btn-danger margina">Monats Abschluss</button></div>');
$('.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>');
$('body').on('click', '#bmd-export', function () {
window.open('<?= self::getUrl("TimerecordingBilling", "api", ['do' => 'generatebmdexport']) ?>&month=' + $('#month').data('month'), '_blank');
});
$('body').on('click', '#bmd-export-nlz', function () {
window.open('<?= self::getUrl("TimerecordingBilling", "api", ['do' => 'generatebmdexportnlz']) ?>&month=' + $('#month').data('month'), '_blank');
});
$('body').on('click', '#month-complete', function () {
if (confirm('Monat ' + $('#month').data('month') + ' wirklich abschließen?')) {
$('#datatable_wrapper').hide();
$('#page-header').hide();
$('.spinner-big').show();
$.post("<?= self::getUrl("TimerecordingBilling", "api", ['do' => 'completemonth']) ?>", {
month: $.trim($('#month').data('month')),
ajax: 1
}).done(function (data) {
window.location.href = "<?= self::getUrl("TimerecordingBilling", "detail", ['month' => $month]) ?>";
});
}
});
});
</script>
<script type="text/javascript"
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>