@extends('layouts.app', ['title' => 'MitarbeiterAnzeig']) @section('content') {{-- newitem --}}
{{-- --}} {{-- edit Item --}} {{-- --}} {{-- delete Item --}} @if (session('msg')){{ session('msg') }}
| Datum | Beginn | Ende | Arbeitsschichten | Pausen | Soll | Ist | Notiz | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@if (!is_null($hrtimerecording->where('start_date', $start->toDateString())->first()))
+
@endif
{{ $start->isoFormat('dd. DD.MM.YYYY') }}
|
{{-- beginn --}}
{{-- $currentTime =$hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->first()->start_time; --}} @if (!is_null($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->first())) {{-- {{ date('H:i',strtotime($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->first()->start_time)) }} --}} {{ Carbon\Carbon::parse($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->first()->start_time)->format('H:i') }} @endif | {{-- Ende --}}@if (is_null( $hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->where('status_open', '0')->last())) {{-- @if ($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->last()->id == $hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->first()->id) --- --}} @else @if (is_null($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->last()->stop_time)) --- @else {{ Carbon\Carbon::parse($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->where('status_open', '0')->last()->stop_time)->format('H:i') }} @endif {{-- {{ $hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->sortByDesc('id')->first()->stop_time }} --}} @endif | @if ( !is_null( $hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->sortByDesc('id')->first())) {{ $hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->sum('work') }} {{-- {{ Carbon\Carbon::parse($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->sum('work'))->format('H:i') }} --}} @endif | @if ( !is_null( $hrtimerecording->where('start_date', $start->toDateString())->where('break', '1')->sortByDesc('id')->first())) ({{ $hrtimerecording->where('start_date', $start->toDateString())->where('break', '1')->sum('break') }}) @endif @if ( !is_null( $hrtimerecording->where('start_date', $start->toDateString())->where('break', '1')->sortByDesc('id')->first())) {{ \Carbon\CarbonInterval::seconds($hrtimerecording->where('start_date', $start->toDateString())->where('break', '1')->sum('total_second'))->cascade()->format('%H:%I') }} @endif | {{--@if (!is_null($hrtimerecording->where('start_date', $start->toDateString())->where('break', '1')->sortByDesc('id')->first())) {{ \Carbon\CarbonInterval::seconds($hrtimerecording->where('start_date', $start->toDateString())->where('break', '1')->sum('total_second'))->cascade()->format('%H:%I') }} @endif | --}}@if ($employee->contract) @if ($employee->contract->get_days[strtolower($start->format('l'))]) {{ $employee->contract->get_days[strtolower($start->format('l'))] }} @endif @else -- @endif | @if ( !is_null( $hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->sortByDesc('id')->first())) @if ($employee->contract) @php // Zeitangabe im Format "Stunden:Minuten" (hh:mm) $time = \Carbon\CarbonInterval::seconds( $hrtimerecording ->where('start_date', $start->toDateString()) ->where('work', '1') ->sum('total_second') - $hrtimerecording ->where('start_date', $start->toDateString()) ->where('break', '1') ->sum('total_second'), ) ->cascade() ->format('%H:%I'); // Aufteilen von Stunden und Minuten [$hours, $minutes] = explode(':', $time); // Umrechnen in Stunden (Fließkommazahl) $timeInHours = (float) $hours + $minutes / 60; // Fließkommazahl von Stunden zum Vergleich $floatHours = $employee->contract->get_days[strtolower($start->format('l'))]; // Beispiel: 8 Stunden und 30 Minuten als Fließkommazahl @endphp @php // Calculate total work time in seconds $totalWorkTimeInSeconds = $hrtimerecording ->where('start_date', $start->toDateString()) ->where('work', '1') ->where('status_open', '0') ->sum('total_second'); // Calculate total pause time in seconds $totalPauseTimeInSeconds = $hrtimerecording ->where('start_date', $start->toDateString()) ->where('break', '1') ->where('status_open', '0') ->sum('total_second'); // Compute the difference $netTimeInSeconds = $totalWorkTimeInSeconds - $totalPauseTimeInSeconds; // Determine if the time is negative $isNegative = $netTimeInSeconds < 0; // Convert the absolute value of the net time to a CarbonInterval $interval = \Carbon\CarbonInterval::seconds(abs($netTimeInSeconds)); // Format the interval $formattedTime = $interval->cascade()->format('%H:%I'); // Add a negative sign if the time is negative if ($isNegative) { $formattedTime = '-' . $formattedTime; } @endphp @if ($timeInHours < $floatHours) {{-- {{ \Carbon\CarbonInterval::seconds($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->sum('total_second') - $hrtimerecording->where('start_date', $start->toDateString())->where('break', '1')->sum('total_second'))->cascade()->format('%H:%I') }} --}} {{ $formattedTime }} @else {{ $formattedTime }} @endif @endif @endif |
@if ($hrtimerecording->where('start_date', $start->toDateString())->where('is_updated', '1')->count())
Ja /
@endif
{{--
@if ($start->formatLocalized('%a.') != 'Sa.' and $start->formatLocalized('%a.') != 'So.')
@if ($Vacation_all->where('is_accepted', '1')->where('date_from', '<=', $start->toDateString())->where('date_to', '>=', $start->toDateString())->count())
Urlaub
@endif
@if (!is_null($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->first()))
@if ($Vacation_all->where('is_accepted', '1')->where('date_from', '<=', $start->toDateString())->where('date_to', '>=', $start->toDateString())->count())
&
@endif
{{ $hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->first()->get_work_loction->name }}
@endif
@endif --}}
@if (!in_array($start->isoFormat('dd'), ['Sa', 'So']))
@php
$isVacation = $Vacation_all
->where('is_accepted', '1')
->where('date_from', '<=', $start->toDateString())
->where('date_to', '>=', $start->toDateString())
->count();
$isSick = $sicks
->where('date_from', '<=', $start->toDateString())
->where('date_to', '>=', $start->toDateString())
->count();
$isHoliday = $holidays->where('date', $start->toDateString())->count();
$workTime = $hrtimerecording
->where('start_date', $start->toDateString())
->where('work', '1')
->first();
@endphp
@if ($isHoliday)
Feiertag -
{{ $holidays->where('date', $start->toDateString())->first()->fname }}
@if ($workTime)
& {{ $workTime->get_work_loction->name }}
@endif
@elseif ($isVacation)
Urlaub
@if ($workTime)
& {{ $workTime->get_work_loction->name }}
@endif
@elseif ($isSick)
Krank
@if ($workTime)
& {{ $workTime->get_work_loction->name }}
@endif
@else
@if ($workTime)
{{-- {{ Carbon\Carbon::parse($workTime->start_time)->format('H:i') }} -
{{ Carbon\Carbon::parse($workTime->end_time)->format('H:i') }} --}}
@if ($workTime->get_work_loction)
{{ $workTime->get_work_loction->name }}
@endif
@else
-
@endif
@endif
@else
-
@endif
@if ($hrtimerecording->where('start_date', $start->toDateString())->where('work', '1')->where('fk_costcenter_id', '!=', '')->count() > 0)
|
|||||||||||||||||||||
Arbeitzeiten:
Pausen:
|
|||||||||||||||||||||||||||||
| test | test | test | test | test | test | test | test | ||||||||||||||||||||||