Zeiterfassung Update/Bugfixes
* Homeofficetage werden wenn sie in Kombination mit Arztbesuch/Anwesenheiten nun richtig berechnet * Verrechnungsübersicht zeigt nun historisch BP/Gutstunden und Mehrstunden * Aufbuchen und Mindern wird nun in Verrechnet bei den NLZs angezeigt
This commit is contained in:
@@ -74,7 +74,9 @@
|
||||
}
|
||||
$offdays .= "<div>";
|
||||
if ($value < 100) {
|
||||
$offdays .= $category . ": " . $value . " Tag(e) ";
|
||||
if ($value > 0) {
|
||||
$offdays .= $category . ": " . $value . " Tag(e) ";
|
||||
}
|
||||
} else {
|
||||
|
||||
$offdays .= $category . ": " . sprintf('%02dh:%02dm', floor($value / 3600), floor($value / 60 % 60));
|
||||
|
||||
@@ -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"/>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
@@ -67,7 +68,9 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($timerecordingbillingsemployees as $timerecordingbillingsemployee):
|
||||
<?php
|
||||
$oldEmployee_id = "";
|
||||
foreach ($timerecordingbillingsemployees as $timerecordingbillingsemployee):
|
||||
$user = new User($timerecordingbillingsemployee->timerecordingEmployee->user->id);
|
||||
$employee_number = (string)$user->getFlag('employee_number');
|
||||
unset ($nlz);
|
||||
@@ -86,6 +89,16 @@
|
||||
} else {
|
||||
$nlz = "";
|
||||
}
|
||||
if ($oldEmployee_id != $timerecordingbillingsemployee->timerecordingEmployee_id) {
|
||||
$bpadiff = 0;
|
||||
$overtimediff = 0;
|
||||
$plushoursdiff = 0;
|
||||
}
|
||||
$bpadiff = $bpadiff + $timerecordingbillingsemployee->transfer_bpahours;
|
||||
$overtimediff = $overtimediff + $timerecordingbillingsemployee->transfer_overtime;
|
||||
$plushoursdiff = $plushoursdiff + $timerecordingbillingsemployee->transfer_plushours;
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-center"><?= $timerecordingbillingsemployee->timerecordingBilling->month ?></td>
|
||||
@@ -98,13 +111,15 @@
|
||||
<td class="text-center"
|
||||
data-order="<?= $timerecordingbillingsemployee->plushours_all + $timerecordingbillingsemployee->transfer_plushours ?>"><?= number_format(round(($timerecordingbillingsemployee->plushours_all + $timerecordingbillingsemployee->transfer_plushours) / 3600, 2), "2", ",", ".") ?></td>
|
||||
<td class="text-center"
|
||||
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $timerecordingbillingsemployee->transfer_overtime ?>"><?= number_format(round(($timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $timerecordingbillingsemployee->transfer_overtime) / 3600, 2), "2", ",", ".") ?></td>
|
||||
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $overtimediff?>"><?= number_format(round(($timerecordingbillingsemployee->timerecordingEmployee->overtime_now + $overtimediff) / 3600, 2), "2", ",", ".") ?></td>
|
||||
<?php if ($me->superexpertEnabled()): ?>
|
||||
<td class="text-center"
|
||||
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->bpahours ?>"><?= number_format(round($timerecordingbillingsemployee->timerecordingEmployee->bpahours / 3600, 2), "2", ",", ".") ?></td>
|
||||
data-order="<?= $timerecordingbillingsemployee->timerecordingEmployee->bpahours + $bpadiff ?>"><?= number_format(round(($timerecordingbillingsemployee->timerecordingEmployee->bpahours + $bpadiff) / 3600, 2), "2", ",", ".") ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
$oldEmployee_id = $timerecordingbillingsemployee->timerecordingEmployee_id;
|
||||
endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
|
||||
$daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
||||
?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= date('U') ?>" rel="stylesheet"
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= $git_merge_ts ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<style>
|
||||
.fc-event {
|
||||
@@ -187,15 +187,15 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/moment.min.js?<?= date('U') ?>"></script>
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/moment.min.js?<?= $git_merge_ts ?>"></script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/index.global.min.js?<?= date('U') ?>"></script>
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/index.global.min.js?<?= $git_merge_ts ?></script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/index.global.min.js?<?= date('U') ?>"></script>
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/moment/index.global.min.js?<?= $git_merge_ts ?>"></script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/locales-all.global.min.js?<?= date('U') ?>"></script>
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/locales-all.global.min.js?<?= $git_merge_ts ?>"></script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/tooltip.min.js?<?= date('U') ?>"></script>
|
||||
src="<?= self::getResourcePath() ?>assets/js/calendar/tooltip.min.js?<?= $git_merge_ts ?>"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
@@ -444,7 +444,7 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa");
|
||||
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= $git_merge_ts ?>"></script>
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
@@ -41,7 +41,7 @@ class TimerecordingBillingController extends mfBaseController
|
||||
protected function overviewAction()
|
||||
{
|
||||
$timerecordingBillings = TimerecordingBillingModel::getAll();
|
||||
$timerecordingBillingsEmployees = TimerecordingBillingEmployeeModel::getAll();
|
||||
$timerecordingBillingsEmployees = TimerecordingBillingEmployeeModel::getAllOrderbyNameDate();
|
||||
$this->layout()->setTemplate("TimerecordingBilling/Overview");
|
||||
$this->layout()->set("timerecordingbillings", $timerecordingBillings);
|
||||
$this->layout()->set("timerecordingbillingsemployees", $timerecordingBillingsEmployees);
|
||||
@@ -224,9 +224,9 @@ class TimerecordingBillingController extends mfBaseController
|
||||
$file = fopen("php://output", 'w');
|
||||
header('Content-Type: text/csv; charset=utf-8');
|
||||
header('Content-Disposition: attachment; filename=' . $filename);
|
||||
$monthunix=(strtotime("01." .$month));
|
||||
$monthunix = (strtotime("01." . $month));
|
||||
$monthbmd = date("n", $monthunix);
|
||||
$monthend = date("d.m.Y", strtotime("last day of this month",$monthunix));
|
||||
$monthend = date("d.m.Y", strtotime("last day of this month", $monthunix));
|
||||
$companybmd = "1";
|
||||
if ($nlz == 0) {
|
||||
$headerarray = ["Monat", "Firma", "Mitarbeiter", "Lohnart", "Menge", "Satz", "Betrag", "Kostenstelle", "NLZ-Kennzeichen", "NLZ Von-Datum", "NLZ Bis-Datum"];
|
||||
@@ -333,16 +333,16 @@ class TimerecordingBillingController extends mfBaseController
|
||||
} else {
|
||||
if ($timerecordingBillingEmployee->nlz_detail) {
|
||||
foreach (json_decode($timerecordingBillingEmployee->nlz_detail, true) as $nlztime) {
|
||||
|
||||
$bodyarray = [$companybmd, $employee_number, 1, $nlztime['categoryshort'], $nlztime['catExtended'], "3", $nlztime['start'], $nlztime['end'], $nlztime['time'], $nlztime['pay']];
|
||||
fputcsv($file, $bodyarray, ";");
|
||||
if ($nlztime['categoryshort'] != "99") {
|
||||
$bodyarray = [$companybmd, $employee_number, 1, $nlztime['categoryshort'], $nlztime['catExtended'], "3", $nlztime['start'], $nlztime['end'], $nlztime['time'], $nlztime['pay']];
|
||||
fputcsv($file, $bodyarray, ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($timerecordingBillingEmployee->holidays>0) {
|
||||
if ($timerecordingBillingEmployee->holidays > 0) {
|
||||
//last day of month
|
||||
|
||||
|
||||
|
||||
$bodyarray = [$companybmd, $employee_number, 1, "1", "", "4", $monthend, $monthend, $timerecordingBillingEmployee->holidays, '0'];
|
||||
fputcsv($file, $bodyarray, ";");
|
||||
|
||||
@@ -584,11 +584,8 @@ class TimerecordingBillingController extends mfBaseController
|
||||
if ($timerecording['homeoffice']) {
|
||||
$data['homeoffice'] = $timerecording['homeoffice'];
|
||||
}
|
||||
|
||||
|
||||
if (!$data['diet']) {
|
||||
$data['diet'] = 0;
|
||||
|
||||
}
|
||||
|
||||
$timerecordingbillingemployee = TimerecordingBillingEmployeeModel::create($data);
|
||||
|
||||
@@ -93,6 +93,22 @@ class TimerecordingBillingEmployeeModel
|
||||
|
||||
}
|
||||
|
||||
public static function getAllOrderbyNameDate()
|
||||
{
|
||||
$items = [];
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select("TimerecordingBillingEmployee", "*", "1=1 ORDER by `timerecordingEmployee_id`,`timerecordingBilling_id` DESC ");
|
||||
if ($db->num_rows($res)) {
|
||||
while ($data = $db->fetch_object($res)) {
|
||||
$items[] = new TimerecordingBillingEmployee($data);
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
|
||||
}
|
||||
|
||||
public static function getFirst()
|
||||
{
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
@@ -157,7 +157,7 @@ private $holidays ;
|
||||
$enddate = "";
|
||||
$sum = "-";
|
||||
$day = "";
|
||||
$enddatecend="";
|
||||
$enddatecend = "";
|
||||
$orderdate = $timerecording->start;
|
||||
if ($timerecording->timerecordingCategory->hourday == 1) {
|
||||
$date = date("d.m.Y", $timerecording->start);
|
||||
@@ -225,7 +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);
|
||||
$enddatecend = date("Y-m-d", $enddatetemp + 1216800);
|
||||
$start = "-";
|
||||
$end = "-";
|
||||
$day = $daysgerm[date("w", $timerecording->start)];
|
||||
@@ -266,6 +266,7 @@ private $holidays ;
|
||||
$date = date("d.m.Y", $timerecording->start);
|
||||
$start = "-";
|
||||
$end = "-";
|
||||
$datadate = date("Y-m-d", $timerecording->start);
|
||||
$day = $daysgerm[date("w", $timerecording->start)];
|
||||
if ($timerecording->days > 0) {
|
||||
if ($timerecording->days == 1) {
|
||||
@@ -357,9 +358,8 @@ private $holidays ;
|
||||
endif;
|
||||
if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5)) {
|
||||
} else {
|
||||
if (!$enddatecend)
|
||||
{
|
||||
$enddatecend=$enddate;
|
||||
if (!$enddatecend) {
|
||||
$enddatecend = $enddate;
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
@@ -588,7 +588,7 @@ private $holidays ;
|
||||
$O100pfl = 0;
|
||||
$O50free = 0;
|
||||
$O50pfl = 0;
|
||||
$Osum=0;
|
||||
$Osum = 0;
|
||||
foreach ($timerecordings as $timerecording):
|
||||
|
||||
$state = "";
|
||||
@@ -599,9 +599,10 @@ private $holidays ;
|
||||
if ($oldday != date('Y-m-d', $timerecording->start)) {
|
||||
|
||||
if ($homeoffice == 1) {
|
||||
$homeofficesum++;
|
||||
$homeofficesum ++;
|
||||
$homeoffice = false;
|
||||
}
|
||||
$homeoffice = false;
|
||||
if ($diet > 10800) {
|
||||
if ($diet >= 43200) {
|
||||
$diet = 43200;
|
||||
@@ -613,14 +614,13 @@ private $holidays ;
|
||||
$diet = 0;
|
||||
|
||||
}
|
||||
|
||||
if ($timerecording->homeoffice == 1 && (!$homeoffice || $homeoffice == 1)) {
|
||||
|
||||
$homeoffice = 1;
|
||||
} else {
|
||||
$homeoffice = 0;
|
||||
} else if ($timerecording->timerecordingCategory_id != '9') { //Speziallösung für Arztbesuch (zusätzlich Homeoffice erlaubt)
|
||||
$homeoffice = 'NOK';
|
||||
}
|
||||
|
||||
|
||||
if ($timerecording->businesstrip == 1 && $timerecording->timerecordingCategory->hourday == 1) {
|
||||
$diet = $diet + $timerecording->end - $timerecording->start;
|
||||
}
|
||||
@@ -664,7 +664,7 @@ private $holidays ;
|
||||
$O100free = $O100free + $overtimes['O100free'];
|
||||
$O50free = $O50free + $overtimes['O50free'];
|
||||
$O50pfl = $O50pfl + $overtimes['O50pfl'];
|
||||
$Osum=$Osum+$overtimes['sum'];
|
||||
$Osum = $Osum + $overtimes['sum'];
|
||||
}
|
||||
} else if ($timerecording->timerecordingCategory->hourday == 2 || ($timerecording->timerecordingCategory->hourday == 3 && $timerecording->end)) {
|
||||
$date = date("d.m.", $timerecording->start) . " - " . $daysgerm[date("w", $timerecording->end)] . " " . date("d.m.Y", $timerecording->end);
|
||||
@@ -760,7 +760,8 @@ private $holidays ;
|
||||
$sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes);
|
||||
|
||||
} else if ($timerecording->timerecordingCategory->hourday == 5) {
|
||||
|
||||
$date = date("d.m.Y", $timerecording->start);
|
||||
$datadate = date("Y-m-d", $timerecording->start);
|
||||
$start = "-";
|
||||
$end = "-";
|
||||
$day = $daysgerm[date("w", $timerecording->start)];
|
||||
@@ -770,7 +771,12 @@ private $holidays ;
|
||||
} else {
|
||||
$daysum[$timerecording->timerecordingCategory->name] = $daysum[$timerecording->timerecordingCategory->name] + $timerecording->days;
|
||||
}
|
||||
|
||||
$nlzTimes[$timerecording->id]['start'] = date("d.m.Y", $timerecording->start);
|
||||
$nlzTimes[$timerecording->id]['end'] = date("d.m.Y", $timerecording->end);
|
||||
$nlzTimes[$timerecording->id]['days'] = $sumdays;
|
||||
$nlzTimes[$timerecording->id]['unpaid'] = $timerecording->timerecordingCategory->unpaid;
|
||||
$nlzTimes[$timerecording->id]['category'] = $timerecording->timerecordingCategory->name;
|
||||
$nlzTimes[$timerecording->id]['categoryshort'] = '99';
|
||||
} else if ($timerecording->timerecordingCategory->hourday == 6) {
|
||||
$date = date("d.m.Y", $timerecording->start);
|
||||
$datadate = date("Y-m-d", $timerecording->start);
|
||||
@@ -826,7 +832,6 @@ private $holidays ;
|
||||
endforeach;
|
||||
if ($homeoffice == 1) {
|
||||
$homeofficesum++;
|
||||
$homeoffice = 0;
|
||||
}
|
||||
if ($diet > 10800) {
|
||||
if ($diet >= 43200) {
|
||||
@@ -883,7 +888,7 @@ private $holidays ;
|
||||
$json['time']['daysum'] = $daysum;
|
||||
$json['recordsFiltered'] = $responsecount;
|
||||
$json['recordsTotal'] = $responsecount;
|
||||
$json['time']['overtimes'] = ['O100free' => $O100free, 'O100pfl' => $O100pfl, 'O50free' => $O50free, 'O50pfl' => $O50pfl,'Osum'=>$Osum];
|
||||
$json['time']['overtimes'] = ['O100free' => $O100free, 'O100pfl' => $O100pfl, 'O50free' => $O50free, 'O50pfl' => $O50pfl, 'Osum' => $Osum];
|
||||
|
||||
if ($ajax == 1) {
|
||||
$json = json_encode($json);
|
||||
|
||||
Reference in New Issue
Block a user