@extends('layouts.app', ['title' => 'Urlaub']) @section('content') @if (Auth::user()->get_employee->is_hrm) {{-- new-urlaubstage --}} {{-- abl-item --}} @endif @if (session('msg'))

{{ session('msg') }}

@endif
HRM - Urlaubsplaner {{ Carbon\Carbon::now()->format('Y') }}
Heute, den {{ Carbon\Carbon::now()->format('d.m.Y') }}  |  Im Urlaub: {{ $Vacation_Request_heute }} Mitarbeiter
@if (Auth::user()->get_employee->is_hrm)
@endif
@if (Auth::user()->get_employee->is_hrm)
{{-- --}} {{-- --}} {{-- @endif --}} {{-- --}} {{-- @if (Auth::user()->get_employee->is_mgt) @endif --}} @if ($Vacation_Request->count() > 0) @foreach ($Vacation_Request as $item) {{-- --}} {{-- --}} @endforeach @else @endif
@csrf
Vorjahr | Ansp. | Gesamt -- genommen | genehmigt auch Verfügbar Geplant noch davon-genehmigt Mitarbeiter Startdatum Enddatum Abeitstage Grund Bemerkung Status Aktion Action
{{ $item->get_employee->contract->get_days->last_year_vacation_rest }} Tage | {{ $item->get_employee->contract->get_days->vacation_entitlement }} Tage | {{ $item->get_employee->contract->get_days->last_year_vacation_rest + $item->get_employee->contract->get_days->vacation_entitlement }} Tage @php $got_vacations = 0; for ( $start = Carbon\Carbon::now()->startOfYear(); $start <= now()->toDateString(); $start->addDay() ) { $isVacationDay = $Vacation_all ->where('fk_employee_id', $item->get_employee->employee_id) ->where('is_accepted', '1') ->where('date_from', '<=', $start->toDateString()) ->where('date_to', '>=', $start->toDateString()) ->count(); $isWorkDay = $item->get_employee->contract->get_days[ strtolower($start->format('l')) ] > 0; $isHoliday = in_array( $start->toDateString(), $holidays->pluck('date')->toArray(), ); if ($isVacationDay && $isWorkDay && !$isHoliday) { $got_vacations += 1; } } @endphp -- {{ $got_vacations }} Tage | {{ $Vacation_all->where('fk_employee_id', $item->get_employee->employee_id)->where('is_accepted', '1')->where('date_from', '>', now()->toDateString())->sum('days_number') }} Tage @if ($item->get_employee->contract != null) {{-- {{ $item->get_employee->contract->get_days->vacation_rest }} --}} {{ $item->get_employee->contract->get_days->last_year_vacation_rest }} Tage @else --- @endif {{ $Vacation_all->where('fk_employee_id', $item->get_employee->employee_id)->where('date_from', '>', now()->toDateString())->sum('days_number') }} {{ $Vacation_all->where('fk_employee_id', $item->get_employee->employee_id)->where('is_accepted', '1')->where('date_from', '>', now()->toDateString())->sum('days_number') }} {{ $item->get_employee->first_name }} {{ $item->get_employee->last_name }} {{ Carbon\Carbon::parse($item->date_from)->format('d.m.Y') }} {{-- {{ $item->date_from }} --}} {{ Carbon\Carbon::parse($item->date_to)->format('d.m.Y') }} {{ $item->days_number }} {{ $item->reason }} {{ $item->note }} @if ($item->is_accepted == 1) Genemigt @elseif ($item->is_accepted === 0) abgelehnt @elseif ($item->is_accepted == null) wartet @endif @if ($item->is_accepted == 1) {{-- @elseif ($item->is_accepted === 0) @elseif ($item->is_accepted == null) {{-- @endif
Keine neue Anträge
{{--
+ alte Anträge
--}} @if (Auth::user()->get_employee->is_hrm)

{{-- --}} {{-- @endif --}} {{-- --}} {{-- @if (Auth::user()->get_employee->is_mgt) @endif --}} @if ($Vacation_all->where('is_closed', '==', '1')->count() > 0) @foreach ($Vacation_all->where('is_closed', '==', '1')->sortByDesc('date_from') as $item) {{-- --}} @endforeach @else @endif
Verfügbar Mitarbeiter Startdatum Enddatum Abeitstage Grund Bemerkung Status Action
{{ $item->get_employee->first_name }} {{ $item->get_employee->last_name }} {{ Carbon\Carbon::parse($item->date_from)->format('d.m.Y') }} {{-- {{ $item->date_from }} --}} {{ Carbon\Carbon::parse($item->date_to)->format('d.m.Y') }} {{ $item->days_number }} {{ $item->reason }} {{ $item->note }} {{-- {{ $item->is_accepted }} --}} @if ($item->is_accepted == '1') genehmigt @if ($item->is_accepted & ($item->date_from <= now()->toDateString())) und genommen @endif @elseif ($item->is_accepted == '0') abgelehnt @elseif ($item->is_accepted == null) in bearbeitung @endif
Keine neue Anträge
@endif
@endif {{-- vis-timeline lokal (v7.7.3) --}}
{{-- Legende --}}
   Urlaub genehmigt    Urlaubsantrag    Krank    Abgelehnt
@if (Auth::user()->get_employee->is_hrm) @endif @endsection