@extends('layouts.app') @section('title', 'Locum Payroll') @section('content') @include('locum.partials.payroll-tabs', ['active' => 'payroll']) {{-- Unpaid Approved Shifts --}}

Approved Shifts | Ready for Payroll

Select the shifts you want to include in a payroll run, then click "Create Payroll Run".

{{ $unpaidShifts->count() }} shift(s)
@if($unpaidShifts->count())
@csrf
@foreach($unpaidShifts as $s) @endforeach
Date Locum Shift Rate Gross Pay Dept
{{ $s->work_date->format('d M Y') }} {{ $s->locum->full_name ?? '' }} {{ $s->shift_type }} @if($s->rate_type==='percentage'){{ $s->rate_applied }}%@else KES {{ number_format($s->rate_applied) }}@endif KES {{ number_format($s->gross_amount) }} {{ $s->department->name ?? '-' }}
Selected Total: KES {{ number_format($unpaidShifts->sum('gross_amount')) }}

WHT @ 5% will be auto-calculated. You can adjust deductions after creation.

@else
No approved shifts pending payroll. Approve shifts from Locum Shift Entries first.
@endif
{{-- Past Payroll Runs --}}

Payroll Runs

@forelse($batches as $b) @php $sc = ['draft'=>'badge-gray','approved'=>'badge-success','paid'=>'badge-success','cancelled'=>'badge-danger']; @endphp @empty @endforelse
Run Period Locums Shifts Gross Pay WHT (5%) Net Pay Status Created Actions
{{ $b->batch_label }} {{ $b->period_from?->format('d M') }}{{ $b->period_to ? ' – '.$b->period_to->format('d M Y') : '' }} {{ $b->items->count() }} {{ $b->items->sum('total_shifts') }} KES {{ number_format($b->items->sum('gross_pay')) }} KES {{ number_format($b->items->sum('wht_amount')) }} KES {{ number_format($b->items->sum('net_pay')) }} {{ ucfirst($b->status) }} {{ $b->created_at->format('d M Y') }}
View @if($b->status === 'draft')
@csrf @method('DELETE')
@endif
No payroll runs yet.
@if($batches->hasPages())
{{ $batches->links() }}
@endif
@endsection @section('scripts') @endsection