{{-- CSO dashboard: economic value of community service work, quantification (KSh vs hours), progress tracker (hours completed vs hours placed), skills / employment linkage / tools. --}} @extends('layouts.app') @section('title', 'CSO Dashboard - ICMIS') @push('styles') @include('probation._styles') @endpush @section('content') @php $maxAgency = max(1, $cso['byAgency']->max('value') ?? 1); $maxMonth = max(1, $cso['byMonth']->max() ?? 1); $overall = $cso['totalOrdered'] > 0 ? min(100, round(100 * $cso['totalWorked'] / $cso['totalOrdered'])) : 0; @endphp

Community Service Orders — Dashboard

@include('probation.dashboard._filters')
Economic value generated

KSh {{ number_format($cso['totalValue'], 2) }}

hours worked × area rate
Hours completed

{{ number_format($cso['totalWorked']) }}

of {{ number_format($cso['totalOrdered']) }} hours placed
Skills transferred

{{ $cso['skills'] }}

offenders · {{ $cso['linkages'] }} employment linkages
Tools / equipment / capital

{{ $cso['tools'] }}

empowerment items
Overall progress — hours completed vs total hours placed{{ $overall }}%
Value of work by agency
@forelse($cso['byAgency'] as $name => $v)
{{ $name }}KSh {{ number_format($v['value'], 2) }} · {{ rtrim(rtrim(number_format($v['hours'], 1), '0'), '.') }} hrs
@empty

No work recorded yet.

@endforelse
Value of work by month (daily work record)
@forelse($cso['byMonth'] as $m => $v)
{{ \Carbon\Carbon::createFromFormat('Y-m', $m)->format('M Y') }}KSh {{ number_format($v, 2) }}
@empty

No daily work records yet (CSO Quantification tab → Work record).

@endforelse
Progress tracker per offender
@forelse($cso['rows']->sortByDesc(fn ($r) => $r->case->id) as $r) @empty@endforelse
Ref. No.NameAgencyHours completed / placedValue (KSh)Skills transferredEmployment linkage
{{ $r->case->serial_number }} {{ optional($r->case->prisoner)->name }}{{ $r->agency ?? '—' }} @if($r->pct !== null)
{{ $r->pct }}%
{{ rtrim(rtrim(number_format($r->worked, 1), '0'), '.') }} / {{ rtrim(rtrim(number_format($r->ordered, 1), '0'), '.') }} @else — @endif
{{ number_format($r->value, 2) }} {{ $r->skills ?: '—' }}{{ $r->linkage ?: '—' }}
No CSO cases in this scope.
@endsection