{{-- resources/views/budget/index.blade.php --}} Budget & Commitments {{-- ── Page header ── --}}
Budget & Commitments
Fiscal Year: {{ $fiscalYear }}
@can('manage-budget') New Budget Line @endcan
{{-- ── Portfolio KPI stats ── --}}
Total Allocated
{{ number_format($portfolio['allocated']) }}
{{ $portfolio['lines_count'] }} active lines · UGX
Committed
{{ number_format($portfolio['internal'] + $portfolio['external']) }}
Internal + External · UGX
Actual Spend
{{ number_format($portfolio['actual']) }}
Invoiced & paid · UGX
Available
{{ number_format($portfolio['available']) }}
{{ $portfolio['utilisation'] }}% utilised · UGX
{{-- ── Commitment Flow ── --}}
Commitment Flow
@php $flowSteps = [ ['label'=>'Allocated', 'val'=>$portfolio['allocated'], 'color'=>'var(--blue)', 'bg'=>'var(--blue-light)', 'sub'=>'Approved budget'], ['label'=>'Internal Commit', 'val'=>$portfolio['internal'], 'color'=>'var(--amber)', 'bg'=>'var(--amber-light)', 'sub'=>'Approved requisitions'], ['label'=>'External Commit', 'val'=>$portfolio['external'], 'color'=>'var(--orange)', 'bg'=>'var(--orange-light)', 'sub'=>'LPOs issued'], ['label'=>'Actual Spend', 'val'=>$portfolio['actual'], 'color'=>'var(--red)', 'bg'=>'var(--red-light)', 'sub'=>'Invoiced & paid'], ['label'=>'Available', 'val'=>$portfolio['available'], 'color'=>'var(--green)', 'bg'=>'var(--green-light)', 'sub'=>'True balance'], ]; @endphp @foreach($flowSteps as $i => $step)
{{ number_format($step['val']) }}
{{ $step['label'] }}
{{ $step['sub'] }}
@if($i < count($flowSteps)-1)
@endif
@endforeach

Internal and external commitments are mutually exclusive per procurement — no double-counting. Internal commitments auto-expire after 30 days if no LPO is issued.

{{-- ── Budget Lines + Sidebar ── --}}
{{-- Budget Lines table --}}
Budget Lines {{ $lines->count() }} lines
@forelse($lines as $line) @php $internal = $line->totalInternalCommitment(); $external = $line->totalExternalCommitment(); $actual = $line->totalActualSpend(); $available = $line->availableAmount(); $status = $line->statusLabel(); $statusBadge = match($status) { 'exhausted' => 'badge-red', 'critical' => 'badge-red', 'warning' => 'badge-amber', default => 'badge-green', }; $pct = $line->utilisationPercent(); $fillColor = $pct >= 100 ? 'var(--red)' : ($pct >= 85 ? 'var(--red)' : ($pct >= 60 ? 'var(--amber)' : 'var(--green)')); @endphp @empty @endforelse
Line Allocated Committed Actual Available Status
{{ $line->name }}
{{ $line->code }} · {{ $line->department }}
{{ number_format($line->allocated_amount) }} {{ number_format($internal + $external) }} {{ number_format($actual) }} {{ number_format($available) }} {{ ucfirst($status) }}
No budget lines for {{ $fiscalYear }}. @can('manage-budget') Create one. @endcan
{{-- Right column --}}
{{-- Expiring soon --}}
Expiring Soon @if($expiring->isNotEmpty()) {{ $expiring->count() }} @endif
@if($expiring->isEmpty())
No commitments expiring in the next 14 days.
@else @foreach($expiring as $commit) @php $days = $commit->daysUntilExpiry(); @endphp
{{ $commit->reference }}
{{ $commit->procurement->title ?? '—' }}
{{ number_format($commit->amount) }} UGX
{{ $days }}d
@endforeach @endif
{{-- Recent activity --}}
Recent Activity
@foreach($recentActivity as $activity) @php $typeBadge = match($activity->type) { 'internal' => 'badge-amber', 'external' => 'badge-orange', 'actual' => 'badge-red', default => 'badge-gray', }; @endphp
{{ ucfirst($activity->type) }}
{{ $activity->reference }}
{{ number_format($activity->amount) }} UGX · {{ $activity->created_at->diffForHumans() }}
@endforeach