@section('page-title', 'PAYE Report')
@php // Ensure totals are available when controller did not provide them if (!isset($totalPaye)) { $totalPaye = $items->sum(function($i){ $b = $i->breakdown ?? []; return isset($b['paye']) ? (float)$b['paye'] : ($i->paye ?? 0); }); } // Backwards-compatible variable expected by the view in some places if (!isset($totalPAYE)) { $totalPAYE = $totalPaye; } if (!isset($totalGross)) { $totalGross = $items->sum('gross'); } @endphp

{{ __('PAYE Report') }}

{{ __('PAYE deducted per payroll item and totals') }}

← {{ __('Back to Reports') }}

{{ __('Total PAYE') }}

{{ number_format($totalPAYE, 2) }}

{{ __('Total Gross') }}

{{ number_format($totalGross, 2) }}

{{ $items->count() }} {{ __('payroll items') }}

@foreach($items as $it) @php $b = $it->breakdown ?? []; @endphp @endforeach
{{ __('Employee') }} {{ __('Gross') }} {{ __('PAYE') }} {{ __('Month') }} {{ __('Year') }}
{{ $it->employee->first_name ?? '' }} {{ $it->employee->last_name ?? '' }} {{ number_format($it->gross, 2) }} {{ number_format($it->paye ?? ($b['paye'] ?? 0), 2) }} {{ $it->payrollSummary ? date('F', mktime(0,0,0,$it->payrollSummary->month,1)) : 'N/A' }} {{ $it->payrollSummary->year ?? 'N/A' }}