@section('page-title', __('Payroll History'))

{{ __('Payroll History') }}

{{ __('Reset') }}
@forelse($payrolls as $payroll) @empty @endforelse
{{ __('Period') }} {{ __('Payroll Name') }} {{ __('Employees') }} {{ __('Gross Salary') }} {{ __('Total Deductions') }} {{ __('Net Payment') }} {{ __('Created') }} {{ __('Actions') }}
{{ date('F Y', mktime(0, 0, 0, $payroll->month, 1, $payroll->year)) }}
{{ $payroll->period_start ? $payroll->period_start->format('d M') : 'N/A' }} - {{ $payroll->period_end ? $payroll->period_end->format('d M') : 'N/A' }}
{{ $payroll->name }}
{{ $payroll->items->count() }} {{ Str::plural('employee', $payroll->items->count()) }}
{{ number_format($payroll->total_gross, 2) }}
{{ number_format($payroll->total_deductions, 2) }}
{{ number_format($payroll->total_net, 2) }}
{{ $payroll->created_at->format('d M Y') }}
{{ $payroll->created_at->format('H:i') }}

{{ __('No payroll history found') }}

{{ __('Start by processing a new payroll') }}

{{ __('Process Payroll') }}
@if($payrolls->hasPages())
{{ $payrolls->links() }}
@endif
@if($payrolls->count() > 0)

Total Payrolls

{{ $payrolls->total() }}

Total Employees

{{ $payrolls->sum(fn($p) => $p->items->count()) }}

Total Paid

{{ number_format($payrolls->sum('total_net'), 2) }}

@endif