@extends('layouts.app') @section('title', 'Payroll Profile — ' . $staff->full_name) @section('content') @include('hr.partials.ft-staff-tabs', ['active' => 'payroll-profile'])
← Back to Payroll Profile list
@if(!empty($validationErrors))

⚠ This staff cannot be paid yet — fix the following:

@endif
{{-- LEFT: form --}}

{{ $staff->full_name }}

{{ $staff->employee_number }} · {{ $staff->department->name ?? '' }} · {{ $staff->designation ?? '' }}

{{ ucfirst($staff->status) }}
@csrf @method('PUT') {{-- Identity --}}

Identity & Department

{{-- Statutory IDs --}}

Statutory IDs

{{-- Earnings --}}

Monthly Earnings (KES)

House, transport, responsibility — taxed

Reimbursements, per diem

Housing, vehicle — taxed but not paid in cash

{{-- Reliefs --}}

Pension & Insurance Relief

Capped at KES 30,000 for tax purposes

Capped at KES 5,000 monthly relief

{{-- Payment --}}

Payment Method

Cancel
{{-- RIGHT: live preview + history --}}
@php $earnings = [ 'basic_salary' => (float) $staff->salary, 'taxable_allowances' => (float) ($staff->taxable_allowances ?? 0), 'non_taxable_allowances' => (float) ($staff->non_taxable_allowances ?? 0), 'overtime' => 0, 'bonus' => 0, 'benefits_in_kind' => (float) ($staff->benefits_in_kind ?? 0), 'pension_contribution' => (float) ($staff->pension_contribution ?? 0), 'insurance_relief' => (float) ($staff->insurance_relief ?? 0), 'other_deductions' => 0, ]; try { $preview = \App\Services\PayrollCalculator::calculate($earnings); } catch (\Throwable $e) { $preview = null; } // Pre-compute remittance bucket totals so the table stays clean. if ($preview) { $kraTotal = $preview['paye'] + $preview['ahl_employee'] + $preview['ahl_employer']; $shaTotal = $preview['shif']; $nssfTotal = $preview['nssf_employee'] + $preview['nssf_employer']; $totalRemit = $kraTotal + $shaTotal + $nssfTotal; } @endphp @if($preview) {{-- ── 1. Take-home (Net Pay) — headline card ───────────────────── --}}

Net Pay (Take-home)

What hits the staff member's account

KES

{{ number_format($preview['net_pay'], 2) }}

Gross {{ number_format($preview['gross_pay']) }} − Deductions {{ number_format($preview['total_deductions']) }}

{{-- ── 2. Monthly Remittances — grouped by authority ─────────────── --}}

Monthly Remittances

Grouped by who you pay · {{ now()->format('M Y') }} rates

{{-- KRA (iTax) — PAYE + AHL --}} {{-- SHA --}} {{-- NSSF --}} {{-- Total --}}
KRA (iTax)
PAYE{{ number_format($preview['paye'], 2) }}
Housing Levy (employee){{ number_format($preview['ahl_employee'], 2) }}
Housing Levy (employer){{ number_format($preview['ahl_employer'], 2) }}
Subtotal to KRA{{ number_format($kraTotal, 2) }}
SHA (Social Health Authority)
SHIF (employee){{ number_format($preview['shif'], 2) }}
Subtotal to SHA{{ number_format($shaTotal, 2) }}
NSSF
NSSF (employee){{ number_format($preview['nssf_employee'], 2) }}
NSSF (employer){{ number_format($preview['nssf_employer'], 2) }}
Subtotal to NSSF{{ number_format($nssfTotal, 2) }}
Total Monthly Remittance{{ number_format($totalRemit, 2) }}
{{-- ── 3. Employer Cost — full hospital cost of this employee ───── --}}

Total Cost to Hospital

Gross + employer-side contributions

Gross Pay{{ number_format($preview['gross_pay'], 2) }}
+ NSSF (employer){{ number_format($preview['nssf_employer'], 2) }}
+ Housing Levy (employer){{ number_format($preview['ahl_employer'], 2) }}
Total Employer Cost{{ number_format($preview['employer_cost'], 2) }}
{{-- ── 4. PAYE Workings — collapsible details ──────────────────── --}}

PAYE Workings

click to expand ▾
@if(($preview['insurance_relief'] ?? 0) > 0) @endif
Gross Pay (cash + BIK){{ number_format($preview['gross_pay'], 2) }}
− Pension contribution (allowed)({{ number_format($preview['pension_contribution'], 2) }})
− NSSF (employee)({{ number_format($preview['nssf_employee'], 2) }})
− SHIF({{ number_format($preview['shif'], 2) }})
− Housing Levy (employee)({{ number_format($preview['ahl_employee'], 2) }})
= Taxable Pay{{ number_format($preview['taxable_pay'], 2) }}
PAYE before relief{{ number_format($preview['paye_before_relief'], 2) }}
− Personal relief({{ number_format($preview['personal_relief'], 2) }})
− Insurance relief({{ number_format($preview['insurance_relief'], 2) }})
= PAYE Payable{{ number_format($preview['paye'], 2) }}
@endif {{-- ── 5. Recent Payslips (unchanged) ──────────────────────────── --}}

Recent Payslips

@forelse($recentItems as $i)
{{ $i->run->month_label ?? '-' }} KES {{ number_format($i->net_pay) }}

{{ $i->run->run_number ?? '' }}

@empty

No payslips yet

@endforelse
@endsection