@php use App\Support\Hr\HrPerformanceLendingRoutes; use App\Support\Navigation\WorkspaceEmbed; $summary = $branchWorkspace['summary'] ?? []; $officerDistribution = $branchWorkspace['officer_distribution'] ?? []; $branchHighlights = $branchWorkspace['branch_highlights'] ?? []; $registerService = app(\App\Services\LoanBook\ClientIntelligenceRegisterService::class); $registerHomeRoute = $registerHomeRoute ?? HrPerformanceLendingRoutes::registerRoute(); $activeState = $branchWorkspace['state'] ?? null; $branchId = (int) ($branchWorkspace['loan_branch_id'] ?? 0); $baseParams = collect(request()->except('page', 'state')) ->merge($registerService->filterQueryParams([ 'type' => 'branch', 'loan_branch_id' => $branchId > 0 ? $branchId : null, ])) ->all(); $fmtBranch = function (?array $row): string { if (! $row) { return '—'; } return ($row['branch_name'] ?? '—').' · '.number_format((float) ($row['metric_value'] ?? 0), ($row['metric_label'] ?? '') === 'PAR30 %' || str_contains((string) ($row['metric_label'] ?? ''), 'PAR30') ? 1 : 0).' '.strtolower((string) ($row['metric_label'] ?? '')); }; $bestOfficer = $summary['best_performing_officer'] ?? null; $riskOfficer = $summary['highest_risk_officer'] ?? null; @endphp
Total Clients
{{ number_format((int) ($summary['total_clients'] ?? 0)) }}
Active Loans
{{ number_format((int) ($summary['active_loans'] ?? 0)) }}
Active Clients
{{ number_format((int) ($summary['active_clients'] ?? 0)) }}
Dormant
{{ number_format((int) ($summary['dormant_clients'] ?? 0)) }}
Arrears
{{ number_format((int) ($summary['arrears_clients'] ?? 0)) }}
Watch List
{{ number_format((int) ($summary['watchlist_clients'] ?? 0)) }}
VIP
{{ number_format((int) ($summary['vip_clients'] ?? 0)) }}
Portfolio Balance
{{ number_format((float) ($summary['active_portfolio_balance'] ?? 0), 0) }}
Total Arrears
{{ number_format((float) ($summary['total_arrears'] ?? 0), 0) }}
PAR30
{{ number_format((float) ($summary['par30'] ?? 0), 1) }}%
Avg RES
@if (isset($summary['average_res'])) {{ number_format((float) $summary['average_res'], 1) }}% @else — @endif
High-Value Dormant
{{ number_format((int) ($summary['high_value_dormant'] ?? 0)) }}
Needs Follow-up
{{ number_format((int) ($summary['needs_followup'] ?? 0)) }}
Officers Attached
{{ number_format((int) ($summary['officers_attached'] ?? 0)) }}
Best Officer
@if ($bestOfficer)
Highest Risk Officer
@if ($riskOfficer)
Clients from the client register · PAR30, loans and portfolio from LoanBookPortfolioMetricsService (active book).
Branch comparison (portfolio-wide)
| Officer | Total | Active | Dormant | Arrears | Watch List | VIP | Portfolio | PAR30 | Suggested Action |
|---|---|---|---|---|---|---|---|---|---|
|
|
{{ number_format((int) ($officerRow['total_clients'] ?? 0)) }} | {{ number_format((int) ($officerRow['active_clients'] ?? 0)) }} | {{ number_format((int) ($officerRow['dormant_clients'] ?? 0)) }} | {{ number_format((int) ($officerRow['arrears_clients'] ?? 0)) }} | {{ number_format((int) ($officerRow['watchlist_clients'] ?? 0)) }} | {{ number_format((int) ($officerRow['vip_clients'] ?? 0)) }} | {{ number_format((float) ($officerRow['portfolio_balance'] ?? 0), 0) }} | {{ number_format((float) ($officerRow['par30'] ?? 0), 1) }}% | {{ $officerRow['suggested_management_action'] ?? '—' }} |