{{-- Session Flash Messages --}}
@if(session('success'))
{{ session('success') }}
@endif
@if(session('error'))
{{ session('error') }}
@endif
@if(session('warning'))
{{ session('warning') }}
@endif
{{-- Validation Errors --}}
@if ($errors->any())
@foreach ($errors->all() as $error)
- {{ $error }}
@endforeach
@endif
| # |
{{ __('table.Code') }} |
{{ __('table.Employee-Name') }} |
{{ __('table.Date') }} |
{{ __('table.Time') }} |
{{ __('table.Duration') }} |
Status |
{{ __('table.Action') }} |
@foreach ($overtimes as $overtime)
@php
$approval = $overtime->approval;
$currentStep = $approval?->steps->firstWhere('status', 'active');
$currentUser = auth()->user();
$canApprove = false;
if ($currentStep) {
$canApprove =
($currentStep->user_id === $currentUser->id) ||
($currentStep->approver_role && $currentUser->hasRole($currentStep->approver_role));
}
@endphp
| {{ $loop->iteration }} |
{{ $overtime->code }}
|
|
{{ $overtime->date }} |
{{ $overtime->formatted_start_time }} - {{ $overtime->formatted_end_time }} |
{{ $overtime->duration }} |
|
@if ($overtime->status === 'P')
@if ($canApprove)
@endif
@else
{{__('form.No-Action')}} @endif
|
@endforeach