@extends('layouts.app') @section('title', 'Shift Entries') @section('content') @include('locum.partials.payroll-tabs', ['active' => 'shifts'])
{{-- Filter Bar --}}
@if(request()->hasAny(['search','status','date_from','date_to'])) Clear @endif
+ Record Shift
{{-- Shifts Table --}} @php $activeRole = Auth::user()->activeRoleName(); @endphp
@if($activeRole !== 'Receptionist') @endif @forelse($shifts as $s) @php $sc = ['draft'=>'badge-gray','submitted'=>'badge-info','verified'=>'badge-info','approved'=>'badge-success','rejected'=>'badge-danger']; $hasSessions = $s->rate_type === 'percentage' && !empty($s->session_items); $colCount = $activeRole !== 'Receptionist' ? 10 : 6; @endphp @if($activeRole !== 'Receptionist') @endif {{-- Session breakdown row (percentage-based shifts only) --}} @if($hasSessions) @endif @empty @endforelse
Date Locum ShiftRate Type Rate Sessions Gross PayStatus Actions
@if(in_array($s->approval_status, ['draft','submitted','verified'])) @else @endif {{ $s->work_date->format('d M Y') }} {{ $s->locum->full_name ?? '' }} {{ $s->shift_type }}{{ $s->rate_type === 'percentage' ? 'Percentage' : 'Per Shift' }} @if($s->rate_type === 'percentage'){{ $s->rate_applied }}%@else KES {{ number_format($s->rate_applied) }}@endif @if($s->rate_type === 'percentage') @else @endif KES {{ number_format($s->gross_amount) }}{{ ucfirst($s->approval_status) }} @php $canDelete = $s->approval_status !== 'approved' && empty($s->payroll_batch_id); $canEdit = $s->approval_status !== 'approved' && empty($s->payroll_batch_id); @endphp
@if($canEdit) @endif @if(in_array($s->approval_status, ['submitted','verified'])) @if(in_array($activeRole, ['Super Admin', 'Hospital Admin']))
@csrf @method('PUT')
@csrf @method('PUT')
@else Awaiting Approval @endif @endif @if($s->approval_status === 'approved') ✓ Done @endif {{-- Bin: delete a shift entry that is NOT yet approved (draft, submitted, verified, rejected) --}} @if($canDelete)
@csrf @method('DELETE')
@endif
No shift entries found.
{{-- Bulk Actions --}} @if($shifts->count())
With selected:
@csrf
@if(in_array($activeRole, ['Super Admin', 'Hospital Admin']))
@csrf
@endif
@endif @if($shifts->hasPages())
{{ $shifts->links() }}
@endif
@endsection @section('scripts') @endsection