@extends('layouts.user') @section('title', __('payrolls.payrolls')) @section('page_title', __('payrolls.payrolls')) @section('breadcrumb', __('payrolls.hr_payroll')) @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Header --}}

{{ __('payrolls.payroll_list') }}

{{ __('payrolls.generate_payroll') }}
{{-- Table --}}
@forelse($payrolls as $payroll) @php $status = $payroll->status; $statusClasses = match ($status) { 'draft' => 'border border-amber-200 bg-amber-50 text-amber-700', 'finalized' => 'border border-blue-200 bg-blue-50 text-blue-700', 'paid_partial' => 'border border-purple-200 bg-purple-50 text-purple-700', 'paid_full' => 'border border-emerald-200 bg-emerald-50 text-emerald-700', default => 'border border-slate-200 bg-slate-100 text-slate-700', }; $statusLabel = match ($status) { 'draft' => __('payrolls.draft'), 'finalized' => __('payrolls.finalized'), 'paid_partial' => __('payrolls.paid_partial'), 'paid_full' => __('payrolls.paid_full'), default => ucwords(str_replace('_', ' ', $payroll->status)), }; @endphp @empty @endforelse
{{ __('payrolls.month') }} {{ __('payrolls.payroll_date') }} {{ __('payrolls.employees') }} {{ __('payrolls.status') }} {{ __('payrolls.action') }}
{{ sprintf('%02d', $payroll->payroll_month) }}-{{ $payroll->payroll_year }} {{ optional($payroll->payroll_date)->format('d M Y') ?: '-' }} {{ $payroll->items_count }} {{ $statusLabel }}
{{ __('payrolls.view') }}
@csrf @method('DELETE')
{{ __('payrolls.no_payroll_found') }}
@if($payrolls->hasPages())
{{ $payrolls->links() }}
@endif
@endsection