@php use App\Support\Hr\HrPerformanceLendingRoutes; use App\Support\Navigation\WorkspaceEmbed; $picker = $lendingPicker ?? []; $scope = (string) ($picker['scope'] ?? 'corporate'); $hasRegisterSelection = (bool) ($hasRegisterSelection ?? false); $payload = $piPayload ?? []; $executiveStrip = $payload['executive_strip'] ?? []; $metricAuthority = (string) ($payload['metric_authority'] ?? ''); $kpiScopeLabel = (string) ($kpiScopeLabel ?? 'Corporate'); $lazyTableSection = $lazyTableSection ?? null; $selectedBranchId = (int) ($picker['loan_branch_id'] ?? 0); $selectedOfficerId = (int) ($picker['employee_id'] ?? 0); $corporateHref = WorkspaceEmbed::routeUrl(HrPerformanceLendingRoutes::OVERVIEW, WorkspaceEmbed::queryParams(['scope' => 'corporate']), true) ?? route(HrPerformanceLendingRoutes::OVERVIEW, WorkspaceEmbed::queryParams(['scope' => 'corporate'])); $branchHref = WorkspaceEmbed::routeUrl(HrPerformanceLendingRoutes::OVERVIEW, WorkspaceEmbed::queryParams(array_filter([ 'scope' => 'branch', 'loan_branch_id' => $selectedBranchId > 0 ? $selectedBranchId : null, ])), true) ?? route(HrPerformanceLendingRoutes::OVERVIEW, WorkspaceEmbed::queryParams(array_filter([ 'scope' => 'branch', 'loan_branch_id' => $selectedBranchId > 0 ? $selectedBranchId : null, ]))); $staffHref = WorkspaceEmbed::routeUrl(HrPerformanceLendingRoutes::OVERVIEW, WorkspaceEmbed::queryParams(array_filter([ 'scope' => 'officer', 'loan_branch_id' => $selectedBranchId > 0 ? $selectedBranchId : null, 'employee_id' => $selectedOfficerId > 0 ? $selectedOfficerId : null, ])), true) ?? route(HrPerformanceLendingRoutes::OVERVIEW, WorkspaceEmbed::queryParams(array_filter([ 'scope' => 'officer', 'loan_branch_id' => $selectedBranchId > 0 ? $selectedBranchId : null, 'employee_id' => $selectedOfficerId > 0 ? $selectedOfficerId : null, ]))); @endphp
Corporate Branch Staff
@if ($scope === 'branch')
@include('loan.clients.partials.intelligence-scope-switcher', [ 'mode' => 'branch', 'employees' => $picker['employees'] ?? [], 'directoryBranches' => $picker['directoryBranches'] ?? collect(), 'intelligenceFilter' => $picker['intelligenceFilter'] ?? null, 'selectedBranchId' => $selectedBranchId, 'scopeBaseRoute' => HrPerformanceLendingRoutes::OVERVIEW, ])
@elseif ($scope === 'officer')
@include('loan.clients.partials.intelligence-scope-switcher', [ 'mode' => 'officer', 'employees' => $picker['employees'] ?? [], 'directoryBranches' => $picker['directoryBranches'] ?? collect(), 'intelligenceFilter' => $picker['intelligenceFilter'] ?? null, 'selectedOfficerId' => $selectedOfficerId, 'scopeBaseRoute' => HrPerformanceLendingRoutes::OVERVIEW, ])
@endif @if ($scope === 'corporate')

{{ $kpiScopeLabel }}

@include('loan.performance.partials.executive-strip', [ 'tiles' => $executiveStrip, 'metricAuthority' => $metricAuthority, ]) @include('loan.hr.performance.partials.yearly-tracker-frame-slot') @endif @if (is_string($lazyTableSection) && $lazyTableSection !== '') @php $tableSrc = WorkspaceEmbed::routeUrl( 'loan.hr.performance.lending_tables', WorkspaceEmbed::queryParams(array_merge($tableFilters ?? $piFilters ?? [], [ 'section' => $lazyTableSection, ])), true, ) ?? route('loan.hr.performance.lending_tables', WorkspaceEmbed::queryParams(array_merge($tableFilters ?? $piFilters ?? [], [ 'section' => $lazyTableSection, ]))); @endphp
Loading {{ $lazyTableSection === 'branches' ? 'branches' : 'officers' }}…
@endif @if ($hasRegisterSelection && ! empty($lendingRegisterSrc))
Loading client register…
@endif @if (($scope === 'branch' && $selectedBranchId > 0) || ($scope === 'officer' && $selectedOfficerId > 0)) @include('loan.hr.performance.partials.yearly-tracker-frame-slot') @endif