@php $statusMeta = [ 'all' => ['label' => __('Everyone'), 'icon' => 'queue-list'], 'active' => ['label' => __('Active'), 'icon' => 'check-circle'], 'probation' => ['label' => __('On probation'), 'icon' => 'academic-cap'], 'contract_ending' => ['label' => __('Contract ending'), 'icon' => 'clock'], 'inactive' => ['label' => __('Suspended'), 'icon' => 'pause-circle'], 'exited' => ['label' => __('Left'), 'icon' => 'arrow-right-start-on-rectangle'], ]; // How the derived employment status reads on a row. $badgeMeta = [ 'active' => ['color' => 'emerald', 'label' => __('Active')], 'probation' => ['color' => 'amber', 'label' => __('Probation')], 'contract_ending' => ['color' => 'amber', 'label' => __('Contract ending')], 'contract_expired' => ['color' => 'rose', 'label' => __('Contract lapsed')], 'inactive' => ['color' => 'slate', 'label' => __('Suspended')], 'exited' => ['color' => 'slate', 'label' => __('Left')], ]; $clockMeta = [ 'in' => ['color' => 'emerald', 'label' => __('On the clock')], 'out' => ['color' => 'slate', 'label' => __('Clocked out')], 'leave' => ['color' => 'indigo', 'label' => __('On leave')], 'absent' => ['color' => 'rose', 'label' => __('Not in')], 'off' => ['color' => 'slate', 'label' => __('Off day')], ]; @endphp
{{ __('Export') }} {{-- Who was actually here is Attendance's job now; the desk is where leave and overtime get decided. --}} @if ($canReadHr) {{ __('Attendance') }} @endif
{{-- ------------------------------------------------------- KPI cards --}}
@foreach ($kpis as $m)

{{ $m['label'] }}

{{ $m['value'] }}

{{ $m['sub'] }}
@endforeach
{{-- ------------------------------------------------- Needs attention --}} @if ($attention['alerts'] || $attention['celebrations'])

{{ __('Needs attention') }}

{{ __('Contracts, probations and paperwork about to lapse') }}

@if ($attention['alerts']) @else

{{ __('Nothing needs chasing, every contract, probation and document is current.') }}

@endif

{{ __('Coming up') }}

{{ __('Birthdays & work anniversaries') }}

@if ($attention['celebrations'])
    @foreach ($attention['celebrations'] as $item)
  • {{ $item['title'] }} {{ $item['sub'] }}
  • @endforeach
@else

{{ __('Nothing in the next two weeks.') }}

@endif
@endif {{-- ----------------------------------------------------- Status tabs --}}
@foreach ($statusMeta as $key => $meta) @endforeach
{{-- --------------------------------------------------------- Table --}}

{{ __('Team directory') }}

{{ trans_choice('{0}No employees|{1}:count employee|[2,*]:count employees', $employees->total(), ['count' => number_format($employees->total())]) }} @unless ($canManagePay) · {{ __('Pay details are hidden') }} @endunless

@if ($departments) @endif
@if ($canManagePay) @endif @forelse ($employees as $employee) @php $status = $employee->employmentStatus(); $badge = $badgeMeta[$status] ?? $badgeMeta['active']; $clock = $roster->get($employee->user_id); $clockInfo = $clock ? ($clockMeta[$clock['status']] ?? null) : null; $pay = $canManagePay ? ($lastPay[$employee->user_id] ?? null) : null; $tenure = $employee->yearsOfService(); @endphp @if ($canManagePay) @endif @empty @endforelse
{{ __('Employee') }} {{ __('Role') }} {{ __('Engagement') }} {{ __('Today') }} {{ __('Leave left') }}{{ __('Salary') }} {{ __('Last paid') }}{{ __('Actions') }}
{{ \Illuminate\Support\Str::of($employee->user?->name ?? '?')->explode(' ')->take(2)->map(fn ($w) => mb_substr($w, 0, 1))->implode('') }} {{ $employee->user?->name ?? __('Unknown') }} {{ $employee->employee_number ?: $employee->user?->email }} {{ $employee->job_title ?: '—' }} {{ $employee->department ?: __('No department') }} @if ($employee->manager) · {{ __('reports to :name', ['name' => $employee->manager->name]) }} @endif {{ $badge['label'] }} {{ $employee->employmentTypeLabel() }} @if ($tenure !== null) · {{ trans_choice('{0}new|{1}:count yr|[2,*]:count yrs', (int) floor($tenure), ['count' => rtrim(rtrim(number_format($tenure, 1), '0'), '.')]) }} @endif @if ($clockInfo) {{ $clockInfo['label'] }} @if ($clock['clock_in']) {{ $clock['clock_in'] }}@if ($clock['clock_out']) – {{ $clock['clock_out'] }}@endif @if ($clock['late_minutes'] > 0) · {{ __(':m min late', ['m' => $clock['late_minutes']]) }} @endif @endif @else — @endif {{ rtrim(rtrim(number_format((float) ($leaveBalances[$employee->user_id] ?? 0), 1), '0'), '.') }} {{ __('days') }} {{ $employee->salary_currency_code ?: $baseCode }} {{ number_format((float) $employee->monthly_salary, 2) }} @if ($pay) {{ $baseCode }} {{ number_format($pay['net'], 2) }} {{ $pay['period']?->format('M Y') }} @else {{ __('Never') }} @endif {{ __('Open') }}
{{ $employees->links() }}