{{-- Loan request: application-owned fields only --}} @php $askLocked = (bool) ($askLocked ?? false); $askAmountLocked = (bool) ($askAmountLocked ?? $askLocked); $askProductLocked = (bool) ($askProductLocked ?? $askAmountLocked); $askFullyLocked = $askLocked && $askAmountLocked && $askProductLocked; $mapped = $mapped ?? ($loanFormMappedFields ?? []); $mappedBookingSegments = $mappedBookingFieldDisplaySegments ?? []; $fieldDisabled = $askLocked ? 'disabled' : null; $purposeRequiredForSubmit = (bool) ($purposeRequiredForSubmit ?? false); @endphp
$askFullyLocked])>

Loan request

{{-- Product-owned interest stays hidden; filled from product defaults on select --}} @php $application = $application ?? $draftApplication ?? null; @endphp
@foreach ($mappedBookingSegments as $segment) @php $segmentKeys = ($segment['type'] ?? '') === 'grid' ? ($segment['keys'] ?? []) : [(string) ($segment['key'] ?? '')]; $isProductSegment = in_array('product_name', $segmentKeys, true); $isLoanRequestSegment = count(array_intersect($segmentKeys, ['amount_requested', 'term_unit', 'term_value', 'notes'])) > 0; $isInterestSegment = count(array_intersect($segmentKeys, ['interest_rate', 'interest_rate_period'])) > 0; @endphp @if ($isInterestSegment) @continue @endif @if ($isProductSegment) @if (($segment['type'] ?? '') === 'grid')
$askProductLocked])> @foreach ($segment['keys'] ?? [] as $fieldKey) @if (in_array($fieldKey, ['interest_rate', 'interest_rate_period', 'purpose'], true)) @continue @endif
$fieldKey === 'product_name'])> @include('loan.book.applications.partials.mapped-booking-field', ['fieldKey' => $fieldKey, 'mapped' => $mapped])
@endforeach
@elseif (($segment['type'] ?? '') === 'single') @if (($segment['key'] ?? '') !== 'purpose') @include('loan.book.applications.partials.mapped-booking-field', ['fieldKey' => $segment['key'], 'mapped' => $mapped]) @endif @endif @endif @endforeach @include('loan.book.applications.partials.loan-request-discovery-row', ['mapped' => $mapped]) @foreach ($mappedBookingSegments as $segment) @php $segmentKeys = ($segment['type'] ?? '') === 'grid' ? ($segment['keys'] ?? []) : [(string) ($segment['key'] ?? '')]; $isLoanRequestSegment = count(array_intersect($segmentKeys, ['amount_requested', 'term_unit', 'term_value', 'notes'])) > 0; $isLoanRequestDiscoveryRow = count(array_intersect($segmentKeys, ['amount_requested', 'term_unit', 'term_value'])) > 0; $isInterestSegment = count(array_intersect($segmentKeys, ['interest_rate', 'interest_rate_period'])) > 0; $isPurposeOnly = ($segment['type'] ?? '') === 'single' && ($segment['key'] ?? '') === 'purpose'; @endphp @if ($isInterestSegment || $isPurposeOnly || ! $isLoanRequestSegment || $isLoanRequestDiscoveryRow) @continue @endif @if (($segment['type'] ?? '') === 'grid')
@foreach ($segment['keys'] ?? [] as $fieldKey) @if (in_array($fieldKey, ['interest_rate', 'interest_rate_period', 'purpose'], true)) @continue @endif
@include('loan.book.applications.partials.mapped-booking-field', ['fieldKey' => $fieldKey, 'mapped' => $mapped])
@endforeach
@elseif (($segment['type'] ?? '') === 'single') @include('loan.book.applications.partials.mapped-booking-field', ['fieldKey' => $segment['key'], 'mapped' => $mapped]) @endif @endforeach @include('loan.book.applications.partials.create-dynamic-text-fields', [ 'dynamicLoanApplicationFields' => $dynamicLoanApplicationFields ?? collect(), 'draftApplication' => $draftApplication ?? $application ?? null, ])
@include('loan.book.applications.partials.mapped-booking-field', ['fieldKey' => 'purpose', 'mapped' => $mapped])