@extends('layouts.app', ['title' => 'Zeiterfassung']) @section('content') @php $toDay = Carbon\Carbon::parse($ddate); $currentDate = Carbon\Carbon::parse($ddate); $prevDate = $currentDate->copy()->subDay()->format('Y-m-d'); $nextDate = $currentDate->copy()->addDay()->format('Y-m-d'); @endphp
| Mitarbeiter | Beginn | Ende | Schichten | Pausen | Soll | Ist | Notiz / Arbeitsort | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $item->name }} | |||||||||||||||||||||||||||||||
|
@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->count())
@endif
{{ $iteme->first_name }} {{ $iteme->last_name }}
|
{{-- Beginn --}}
@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->count()) {{ Carbon\Carbon::parse($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->first()->start_time)->format('H:i') }} @endif | {{-- Ende --}}@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->where('status_open', '0')->count()) @if (is_null($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->last()->stop_time)) — @else {{ Carbon\Carbon::parse($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->where('status_open', '0')->last()->stop_time)->format('H:i') }} @endif @endif | {{-- Schichten --}}@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->sortByDesc('id')->first()) {{ $HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->sum('work') }} @endif | {{-- Pausen --}}@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('break', '1')->sortByDesc('id')->first()) {{ \Carbon\CarbonInterval::seconds($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('break', '1')->sum('total_second'))->cascade()->format('%H:%I') }} @endif | {{-- Soll --}}@if ($iteme->contract) @if ($iteme->contract->get_days[strtolower(now()->format('l'))]) {{ $iteme->contract->get_days[strtolower(now()->format('l'))] }} @endif @else — @endif | {{-- Ist --}}@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->sortByDesc('id')->first()) @if ($iteme->contract) @php $time = \Carbon\CarbonInterval::seconds( $HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->sum('total_second') - $HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('break', '1')->sum('total_second'), )->cascade()->format('%H:%I'); [$hours, $minutes] = explode(':', $time); $timeInHours = (float) $hours + $minutes / 60; $floatHours = $iteme->contract->get_days[strtolower(now()->format('l'))]; $totalWorkTimeInSeconds = $HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->where('status_open', '0')->sum('total_second'); $totalPauseTimeInSeconds = $HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('break', '1')->where('status_open', '0')->sum('total_second'); $netTimeInSeconds = $totalWorkTimeInSeconds - $totalPauseTimeInSeconds; $isNegative = $netTimeInSeconds < 0; $interval = \Carbon\CarbonInterval::seconds(abs($netTimeInSeconds)); $formattedTime = $interval->cascade()->format('%H:%I'); if ($isNegative) { $formattedTime = '-' . $formattedTime; } @endphp @if ($timeInHours < $floatHours) {{ $formattedTime }} @else {{ $formattedTime }} @endif @endif @endif | {{-- Notiz / Arbeitsort --}}
@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('is_updated', '1')->count())
Nachtrag
@endif
@php $start = Carbon\Carbon::today(); @endphp
@if ($start->isoFormat('dd') != 'Sa' && $start->isoFormat('dd') != 'So')
@php
$isVacation = $Vacation_all->where('fk_employee_id', $iteme->employee_id)->where('is_accepted', '1')->where('date_from', '<=', $start->toDateString())->where('date_to', '>=', $start->toDateString())->count();
$isSick = $sicks->where('fk_employee_id', $iteme->employee_id)->where('date_from', '<=', $start->toDateString())->where('date_to', '>=', $start->toDateString())->count();
$isHoliday = $holidays->where('date', $start->toDateString())->count();
$workTime = $HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('start_date', $start->toDateString())->where('work', '1')->first();
@endphp
@if ($isHoliday)
{{ $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 && $workTime->get_work_loction)
{{ $workTime->get_work_loction->name }}
@endif
@endif
@endif
@if ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1')->where('fk_costcenter_id', '!=', '')->count() > 0)
@foreach ($HrTimeRecordingToday->where('fk_employee_id', $iteme->employee_id)->where('work', '1') as $itemBv)
@endif
@if ($itemBv->stop_time)
{{ Carbon\Carbon::parse($itemBv->total_time)->format('H:i') }}
@else
—
@endif
@if ($itemBv->project_title) {{ $itemBv->project_title }}
@else * — {{ $itemBv->note }}
@endif
@endforeach
|
||||||||||||||||||||||||
|
Arbeitszeiten
Pausen
|
|||||||||||||||||||||||||||||||