@extends('staff.layout') @php $loan = $loan ?? null; $loanDetails = []; if ($loan && !empty($loan->loan_details)) { $loanDetails = is_array($loan->loan_details) ? $loan->loan_details : (json_decode($loan->loan_details, true) ?? []); } if (!is_array($loanDetails)) { $loanDetails = []; } /* |-------------------------------------------------------------------------- | DECODE DOCUMENT COLLECTION |-------------------------------------------------------------------------- */ $documentCollection = []; if ($loan && !empty($loan->document_collection)) { $documentCollection = is_array($loan->document_collection) ? $loan->document_collection : (json_decode($loan->document_collection, true) ?? []); } if (!is_array($documentCollection)) { $documentCollection = []; } /* |-------------------------------------------------------------------------- | GET LOAN DETAIL |-------------------------------------------------------------------------- */ $getLoanDetail = function ($key, $default = '') use ($loanDetails) { return old($key, $loanDetails[$key] ?? $default); }; /* |-------------------------------------------------------------------------- | GET DOCUMENT STATUS / REMARKS |-------------------------------------------------------------------------- */ $getDocumentValue = function ($key, $field, $default = '') use ($documentCollection) { return old( "documents.$key.$field", data_get($documentCollection, $key . '.' . $field, $default) ); }; /* |-------------------------------------------------------------------------- | EXISTING DOCUMENT FILES |-------------------------------------------------------------------------- */ $existingDocumentFiles = []; foreach ($documentCollection as $docKey => $docData) { if (!is_array($docData)) { continue; } $existingFiles = $docData['files'] ?? []; if (!is_array($existingFiles)) { continue; } $existingDocumentFiles[$docKey] = []; foreach ($existingFiles as $file) { if (!is_array($file) || empty($file['path'])) { continue; } $path = $file['path']; $extension = strtolower( pathinfo($path, PATHINFO_EXTENSION) ); $isPdf = $extension === 'pdf'; $existingDocumentFiles[$docKey][] = [ 'existing' => true, 'name' => $file['original_name'] ?? basename($path), 'path' => $path, 'url' => asset('storage/' . ltrim($path, '/')), 'size' => $file['size'] ?? 0, 'mime_type' => $file['mime_type'] ?? '', 'isPdf' => $isPdf, ]; } } /* |-------------------------------------------------------------------------- | VALUES |-------------------------------------------------------------------------- */ $selectedLoanType = old('loan_type', $loan->loan_type ?? ''); $loanDate = old( 'loan_date', $loan && $loan->loan_date ? \Illuminate\Support\Carbon::parse($loan->loan_date)->format('Y-m-d') : date('Y-m-d') ); $collectionRemarks = old( 'collection_remarks', $documentCollection['collection_remarks'] ?? '' ); $collectionStatus = old( 'collection_status', $documentCollection['collection_status'] ?? 'Pending' ); $applicationStatus = old( 'application_status', $loan->application_status ?? 'New' ); $nextFollowupDate = old( 'next_followup_date', $loan->next_followup_date ?? '' ); @endphp @section('content')

New Loan - Customer Document Collection

{{-- NAVIGATION --}}
New Entry Document Verification Bank Verification Site Verification Cheque Verification
@csrf {{-- DATABASE PRIMARY KEY --}} {{-- ===================================================== 1. BASIC LOAN INFORMATION ====================================================== --}}
Basic Loan Information
{{-- ===================================================== 2. COMMON KYC DOCUMENTS ====================================================== --}}
Common Documents - All Cases
Required for all loan cases
Collect applicable KYC documents using local file upload or live camera capture. Click thumbnails to inspect.
@php $commonDocsList = [ 'applicant_aadhar' => ['No. 01', 'Applicant Aadhar Card'], 'applicant_pan' => ['No. 02', 'Applicant PAN Card'], 'coapplicant_aadhar' => ['No. 03', 'Co-Applicant Aadhar Card'], 'coapplicant_pan' => ['No. 04', 'Co-Applicant PAN Card'], 'holder_aadhar' => ['No. 05', 'Document Holder Aadhar Card'], 'holder_pan' => ['No. 06', 'Document Holder PAN Card'], 'passport_photos' => ['No. 07', 'Passport Size Photos - All Members'], 'applicant_bank_statement' => ['No. 08', 'Applicant Bank Statement - 1 Year'] ]; @endphp
@foreach($commonDocsList as $key => $doc) @if($key == 'coapplicant_aadhar')
Co-Applicant Documents
@elseif($key == 'holder_aadhar')
Document Holder Documents
@elseif($key == 'passport_photos')
Other Common Documents
@endif
{{ $doc[0] }}
{{ $doc[1] }}
No files added
@endforeach
{{-- ===================================================== 3. PROPERTY DOCUMENTS ====================================================== --}} @php $propertyDocuments = [ 'sale_deed' => 'Sale Deed', 'mother_deed' => 'Mother Deed', 'encumbrance_certificate' => 'Encumbrance Certificate (EC) - 1987 to Till Date', 'latest_land_tax' => 'Latest Land Tax Receipt', 'latest_property_tax' => 'Latest Property Tax Receipt', 'patta' => 'Patta', 'eb_bill' => 'EB Bill', ]; @endphp
Property Documents
@foreach($propertyDocuments as $key => $document)
No. 0{{ $loop->iteration }}
{{ $document }}
No files added
@endforeach
{{-- ===================================================== 4. TAKEOVER DOCUMENTS ====================================================== --}} @php $takeoverDocuments = [ 'old_bank_loan_track' => 'Old Bank Loan Track / Loan Statement', 'foreclosure_letter' => 'Foreclosure Letter', 'original_documents_list' => 'List of Original Documents from Old Bank', ]; @endphp
Take Over Case Documents
Applicable for BT / Takeover cases
@foreach($takeoverDocuments as $key => $document)
No. 0{{ $loop->iteration }}
{{ $document }}
No files added
@endforeach
{{-- ===================================================== 5. PURCHASE DOCUMENTS ====================================================== --}} @php $purchaseDocuments = [ 'buyer_seller_kyc' => 'KYC of Both Parties (Buyer and Seller) - Family Members', 'sale_agreement' => 'Sale Agreement / Document Details of the Property', ]; @endphp
Purchase Case Documents
Applicable for purchase cases
@foreach($purchaseDocuments as $key => $document)
No. 0{{ $loop->iteration }}
{{ $document }}
No files added
@endforeach
{{-- ===================================================== 6. DOCUMENT COLLECTION SUMMARY ====================================================== --}}
Document Collection Summary
Total Documents
0
Collected Documents
0
Pending Documents
0
{{-- ===================================================== 7. STAFF REMARKS & FOLLOW-UP ====================================================== --}}
Staff Remarks & Follow-up
{{-- ===================================================== ACTION BUTTONS ====================================================== --}}
Verify all captured and uploaded documents before continuing.
{{-- ===================================================== WEBCAM CAPTURE MODAL ====================================================== --}} {{-- ===================================================== IMAGE GALLERY MODAL ====================================================== --}} @endsection