diff --git a/Layout/default/TimerecordingBilling/Detail.php b/Layout/default/TimerecordingBilling/Detail.php index 7b98e99e1..5fd23bdf6 100644 --- a/Layout/default/TimerecordingBilling/Detail.php +++ b/Layout/default/TimerecordingBilling/Detail.php @@ -74,7 +74,9 @@ } $offdays .= "
"; 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)); diff --git a/Layout/default/TimerecordingBilling/Overview.php b/Layout/default/TimerecordingBilling/Overview.php index c60c0dc9e..31cc71f21 100644 --- a/Layout/default/TimerecordingBilling/Overview.php +++ b/Layout/default/TimerecordingBilling/Overview.php @@ -4,7 +4,8 @@ -
@@ -67,7 +68,9 @@ - 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; + + ?> timerecordingBilling->month ?> @@ -98,13 +111,15 @@ plushours_all + $timerecordingbillingsemployee->transfer_plushours) / 3600, 2), "2", ",", ".") ?> timerecordingEmployee->overtime_now + $timerecordingbillingsemployee->transfer_overtime) / 3600, 2), "2", ",", ".") ?> + data-order="timerecordingEmployee->overtime_now + $overtimediff?>">timerecordingEmployee->overtime_now + $overtimediff) / 3600, 2), "2", ",", ".") ?> superexpertEnabled()): ?> timerecordingEmployee->bpahours / 3600, 2), "2", ",", ".") ?> + data-order="timerecordingEmployee->bpahours + $bpadiff ?>">timerecordingEmployee->bpahours + $bpadiff) / 3600, 2), "2", ",", ".") ?> - + timerecordingEmployee_id; + endforeach; ?> diff --git a/Layout/default/TimerecordingCalendar/Index.php b/Layout/default/TimerecordingCalendar/Index.php index ddeabde04..acdfa254b 100644 --- a/Layout/default/TimerecordingCalendar/Index.php +++ b/Layout/default/TimerecordingCalendar/Index.php @@ -1,7 +1,7 @@ - + src="assets/js/calendar/moment/moment.min.js?"> + src="assets/js/calendar/index.global.min.js? + src="assets/js/calendar/moment/index.global.min.js?"> + src="assets/js/calendar/locales-all.global.min.js?"> + src="assets/js/calendar/tooltip.min.js?"> + src="assets/js/datatables-std.js?"> \ No newline at end of file diff --git a/application/TimerecordingBilling/TimerecordingBillingController.php b/application/TimerecordingBilling/TimerecordingBillingController.php index e0c4b687a..79eda5d25 100644 --- a/application/TimerecordingBilling/TimerecordingBillingController.php +++ b/application/TimerecordingBilling/TimerecordingBillingController.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); diff --git a/application/TimerecordingBillingEmployee/TimerecordingBillingEmployeeModel.php b/application/TimerecordingBillingEmployee/TimerecordingBillingEmployeeModel.php index e5525e01c..b785ce307 100644 --- a/application/TimerecordingBillingEmployee/TimerecordingBillingEmployeeModel.php +++ b/application/TimerecordingBillingEmployee/TimerecordingBillingEmployeeModel.php @@ -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(); diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 5c89d7ac8..0f45e3353 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -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);