@extends('layouts.app') @section('title', 'Payroll & HR') @php $qparams = request()->only(['q','status','employment_type','project_id','sort','direction','per_page']); $att = (float) ($stats['attendance_rate'] ?? 0); $attClass = $att >= 85 ? 'text-emerald-600' : ($att >= 60 ? 'text-amber-600' : 'text-red-600'); $hasFilters = ($filters['q'] ?? '') !== '' || ($filters['status'] ?? 'all') !== 'all' || ($filters['employment_type'] ?? 'all') !== 'all' || ($filters['project_id'] ?? '') !== ''; @endphp @section('content')
@if ($errors->any())

Please fix the following:

@endif @if (session('payroll_employees_import_summary')) @php $sum = session('payroll_employees_import_summary'); @endphp

Import summary

Created: {{ $sum['created'] ?? 0 }} · Updated: {{ $sum['updated'] ?? 0 }} · Skipped: {{ $sum['skipped'] ?? 0 }}

@if (!empty($sum['errors'])) @endif
@endif

Payroll & HR

Employees, salaries and attendance

Excel PDF

Total Employees

{{ $stats['total_employees'] }}

Monthly Payroll

{{ \App\Support\Format::mwk($stats['monthly_payroll']) }}

Attendance Rate

{{ number_format($att, 1) }}%

On Leave

{{ $stats['on_leave'] }}

Clear

Employee Directory

@forelse($employees as $e) @php $typeBadge = match($e->employment_type) { 'Permanent' => 'g', 'Casual' => 'v', default => 'a', }; $stBadge = match($e->status) { 'Active' => 'g', 'On Leave' => 'a', 'Inactive' => 's', 'Terminated' => 'r', default => 's', }; @endphp @empty @endforelse
Name Role Project Salary Type Status Action
{{ $e->initials }}

{{ $e->name }}

@if($e->email || $e->phone)

{{ $e->email }}{{ $e->email && $e->phone ? ' · ' : '' }}{{ $e->phone }}

@endif
{{ $e->job_title }} @if($e->department)

{{ $e->department }}

@endif
@if($e->project_id) {{ $e->project?->name }} @else Unassigned @endif {{ \App\Support\Format::mwk($e->basic_salary) }} @if($e->employment_type === 'Daily')/day@endif {{ $e->employment_type }} {{ $e->status }}
@if($hasFilters)

No employees match your filters

Clear Filters @else

No employees found

Add your first employee or import employees from Excel.

@endif
@if($employees->hasPages())
{{ $employees->withQueryString()->links() }}
@endif

Recent Payroll Runs

@forelse($recentPayrollRuns as $r) @php $rs = match($r->status) { 'Draft' => 's', 'Approved' => 'b', 'Paid' => 'g', default => 'r', }; @endphp @empty @endforelse
Period Employees Gross Deductions Net Status Action
{{ $r->period_start->format('M j') }} – {{ $r->period_end->format('M j, Y') }} {{ $r->items_count }} {{ \App\Support\Format::mwkDecimal($r->total_gross) }} {{ \App\Support\Format::mwkDecimal($r->total_deductions) }} {{ \App\Support\Format::mwkDecimal($r->total_net) }} {{ $r->status }} View PDF @if($r->status === 'Approved') Mark Paid @endif
No payroll runs yet. Generate a payroll to get started.
{{-- Add employee --}} {{-- Edit employee --}} @include('payroll.partials.import-employees-modal') @include('payroll.partials.payroll-run-form') @endsection @push('scripts') @endpush