{{ __('app.hr.leave.title') }}

{{ __('app.hr.leave.desc') }}

@can('leave.create') {{ __('app.hr.leave.apply') }} @endcan
@if ($notice) {{ $notice }} @endif @if ($errors->any())
    @foreach ($errors->all() as $message)
  • {{ $message }}
  • @endforeach
@endif @if ($showForm)
@foreach ($staff as $profile) @endforeach @foreach ($leaveTypes as $type) @endforeach
@if ($quotaPreview)

{{ $quotaPreview['year'] }} @if ($quotaPreview['quota'] === null) · {{ __('app.hr.leave.unlimited') }} @else · {{ __('app.hr.leave.quota_used', ['used' => $quotaPreview['used'], 'quota' => $quotaPreview['quota']]) }} @endif

@endif
{{ __('app.actions.cancel') }} {{ __('app.hr.leave.apply') }}
@endif @if ($rejecting)
{{ __('app.actions.cancel') }} {{ __('app.hr.leave.reject') }}
@endif @if ($cancelling)
{{ __('app.actions.cancel') }} {{ __('app.hr.leave.cancel') }}
@endif
@foreach ($statuses as $status) @endforeach
@forelse ($applications as $application) @empty @endforelse
{{ __('app.hr.fields.employee') }} {{ __('app.hr.fields.leave_type') }} {{ __('app.hr.leave.period') }} {{ __('app.hr.leave.days') }} {{ __('app.hr.fields.status') }} {{ __('app.hr.leave.applied_by') }} {{ __('app.hr.leave.decided_by') }} {{ __('app.actions.view') }}
{{ $application->staffProfile?->user?->name ?? '—' }} {{ $application->staffProfile?->employee_no }} {{ $application->leaveType?->localizedName() }} @if ($application->leaveType) {{ $application->leaveType->is_paid ? __('app.hr.leave.paid') : __('app.hr.leave.unpaid') }} @endif {{ $application->starts_on?->translatedFormat('d M Y') }} — {{ $application->ends_on?->translatedFormat('d M Y') }} {{ $application->days }} @php($leaveColor = match ($application->status) { \App\Enums\LeaveStatus::Pending => 'gold', \App\Enums\LeaveStatus::Approved => 'green', \App\Enums\LeaveStatus::Rejected => 'red', \App\Enums\LeaveStatus::Cancelled => 'slate', }) {{ $application->status->label() }} @if ($application->decision_notes) {{ $application->decision_notes }} @endif {{ $application->applicant?->name ?? '—' }} {{ $application->decider?->name ?? '—' }}
@if ($application->isPending() && $application->staffProfile?->user_id !== auth()->id()) @can('leave.approve') {{ __('app.hr.leave.approve') }} {{ __('app.hr.leave.reject') }} @endcan @endif @if (in_array($application->status, [\App\Enums\LeaveStatus::Pending, \App\Enums\LeaveStatus::Approved], true)) @can('leave.cancel') {{ __('app.hr.leave.cancel') }} @endcan @endif
@if ($applications->hasPages())
{{ $applications->links() }}
@endif