{{-- Sind Portfolio — BPMS overview cards (year-linked) --}} @php $portfolioYear = $sindPortfolioCards['year'] ?? ($defaultBudgetYear ?? ''); $portfolioCards = $sindPortfolioCards['cards'] ?? []; $shareBar = static function (float $share, int $value): float { if ($value <= 0) { return 0.0; } return max(4.0, min(100.0, $share > 0 ? $share : 4.0)); }; $shareLabel = static function (float $share, int $value): string { if ($value <= 0) { return '0%'; } if ($share < 0.1) { return '<0.1%'; } return number_format($share, 1).'%'; }; @endphp

Portfolio Overview

Scheme counts and budget signals for the selected year

@forelse ($portfolioCards as $card) @php $tone = (int) ($card['tone'] ?? 1); $format = (string) ($card['format'] ?? 'count'); $value = (int) ($card['value'] ?? 0); $display = $format === 'money' ? number_format($value).' M' : number_format($value); $cardId = (string) ($card['id'] ?? ''); $breakdown = is_array($card['breakdown'] ?? null) ? $card['breakdown'] : []; $breakdown = array_values(array_filter( $breakdown, static fn ($item): bool => (int) ($item['value'] ?? 0) > 0 )); $mixCount = count($breakdown); $isSplit = $cardId === 'all_schemes' && $mixCount > 0; $share = (float) ($card['share'] ?? 0); $showShare = $format === 'count' && $cardId !== 'all_schemes'; @endphp
@if ($isSplit)
{{ $card['label'] ?? 'All Active Schemes' }} Active
{{ $display }}
@foreach ($breakdown as $item) @php $itemValue = (int) ($item['value'] ?? 0); $itemShare = (float) ($item['share'] ?? 0); $bar = $shareBar($itemShare, $itemValue); $pct = $shareLabel($itemShare, $itemValue); @endphp
{{ $item['label'] ?? '' }} {{ number_format($itemValue) }}
@endforeach
@else

{{ $card['label'] ?? '' }}

@if (! empty($card['subtitle']))

{{ $card['subtitle'] }}

@endif @if ($showShare)

{{ $display }}

@else

{{ $display }}

@endif
@endif
@empty
Loading portfolio cards…
@endforelse