@extends('layouts.app') @section('title') Application Form @endsection @section('css') @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Application @endslot @slot('title') Application Form @endslot @endcomponent @php use App\Models\Info\Facility; use App\Models\LeadApplicant; $factoring = $facilities->where('code', Facility::CODE_FACTORING)->first(); $preFactoring = $facilities->where('code', Facility::CODE_PRE_FACTORING)->first(); $leadIndividual = optional(optional($lead)->applicant)->applicant_type == LeadApplicant::APPLICANT_INDIVIDUAL; $sectionRejections = function ($records) { $records = is_iterable($records) ? collect($records) : collect([$records]); return $records->filter()->flatMap(function ($r) { $out = []; if (($r->verify_status_1 ?? null) === 'rejected' && !empty($r->verify_remarks_1)) { $out[] = $r->verify_remarks_1; } if (($r->verify_status_2 ?? null) === 'rejected' && !empty($r->verify_remarks_2)) { $out[] = $r->verify_remarks_2; } return $out; }); }; $toastSuccess = collect(['success', 'error'])->map(fn ($key) => $key === 'success' ? session('success') : null)->filter()->first(); @endphp @if (session('error')) @endif @if ($errors->any()) @endif
{{-- 1. FACILITY APPLIED & AMOUNT --}}
1. FACILITY APPLIED & AMOUNT
@php $initRemarks = $sectionRejections($lead); @endphp @if ($initRemarks->isNotEmpty()) @endif
@csrf
Pre-Factoring Factoring *
Type Amount Type Amount
@error('pre_purpose_code'){{ $message }}@enderror pre_purpose_code ? 'required' : 'disabled' }}> @error('pre_fund_amount'){{ $message }}@enderror @error('purpose_code'){{ $message }}@enderror @error('fund_amount'){{ $message }}@enderror
Duration * :
@error('tenure_period'){{ $message }}@enderror
@error('tenure_unit'){{ $message }}@enderror
Originator * :
@error('originator'){{ $message }}@enderror
Loan Summary * :
@error('title_summary'){{ $message }}@enderror
This section is required.
@if (!$lead)
Please save Section 1 first to unlock the rest of the application form.
@else {{-- 2. PARTICULARS OF APPLICANT --}}
2. PARTICULARS OF APPLICANT
@php $applicantRemarks = $sectionRejections($lead->applicant); @endphp @if ($applicantRemarks->isNotEmpty()) @endif
@csrf
Business Constitution *
:
@error('applicant_type'){{ $message }}@enderror
{{-- Individual applicant fields (pre-filled from registered profile) --}}
Pre-filled from your registered profile. To make changes, please update your profile.
Name of Applicant *
:
NRIC *
:
Address *
:
Telephone No. *
:
+60
Email *
:
{{-- Company / business applicant fields --}}
Name of Entity *
:
@error('applicant_name'){{ $message }}@enderror
Company Registration No *
:
@error('applicant_brn'){{ $message }}@enderror
Reg. Date *
:
@error('applicant_brd'){{ $message }}@enderror
Principal Activities
:
@error('principal_activities'){{ $message }}@enderror
Business Address *
:
@error('applicant_address_1'){{ $message }}@enderror
@error('applicant_postcode'){{ $message }}@enderror
@error('applicant_city'){{ $message }}@enderror
@error('applicant_state'){{ $message }}@enderror
Location of Branches (if any)
:
@error('applicant_branch_location'){{ $message }}@enderror
Telephone No. *
:
+60
@error('applicant_phone'){{ $message }}@enderror
Email *
:
@error('applicant_email'){{ $message }}@enderror
Facsimile No.
:
@error('applicant_fax_no'){{ $message }}@enderror
Person/s to Contact *
:
@error('contact_name'){{ $message }}@enderror
@error('contact_position'){{ $message }}@enderror
@error('contact_phone'){{ $message }}@enderror
@error('contact_email'){{ $message }}@enderror
Number of Employees
:
@error('applicant_employee_no'){{ $message }}@enderror
This section is required.
{{-- 3. SHAREHOLDERS / DIRECTORS / PARTNERS / PROPRIETOR --}}
3. SHAREHOLDERS / DIRECTORS / PARTNERS / PROPRIETOR
@php $shareholderRemarks = $sectionRejections($lead->shareholders); @endphp @if ($shareholderRemarks->isNotEmpty()) @endif
@csrf
@forelse ($lead->shareholders as $shareholder) @empty @endforelse
Name * Designation * Shareholding (%) *
@error('shareholders.*.name'){{ $message }}@enderror
@error('shareholders.*.name'){{ $message }}@enderror
This section is not required
{{-- 4. BANK ACCOUNT INFORMATION --}}
4. BANK ACCOUNT INFORMATION
@php $bankRemarks = $sectionRejections($lead->banks); @endphp @if ($bankRemarks->isNotEmpty()) @endif
@csrf
@php $banksLoop = $lead->banks->count() ? $lead->banks : [null]; @endphp @foreach ($banksLoop as $bank) @endforeach
Bank * Account Number * Facility Limit (RM)
@error('banks.*.bank_code'){{ $message }}@enderror @error('banks.*.acc_no'){{ $message }}@enderror
This section is required to have at least 1 record.
{{-- 5. FINANCIAL INSTITUTIONS / BANKS --}}
5. FINANCIAL INSTITUTIONS / BANKS
@php $financialInstitutionRemarks = $sectionRejections($lead->financialInstitution); @endphp @if ($financialInstitutionRemarks->isNotEmpty()) @endif
@csrf
Relation with other Banks / Finance Companies / Factoring Companies / Others
Name
:
Location
:
Type of Facility
:
Limit (RM)
:
This section is not required
{{-- 6. CUSTOMERS (CONTRACT AWARDER) --}}
6. CUSTOMERS (CONTRACT AWARDER)
@php $contractRemarks = $sectionRejections($lead->contracts); @endphp @if ($contractRemarks->isNotEmpty()) @endif
@csrf
Customers for references :
@php $contractsLoop = $lead->contracts->count() ? $lead->contracts : [null]; @endphp
@foreach ($contractsLoop as $contract)

Customer {{ $loop->iteration }}
Company *
:
@error('contracts.*.awarder_name'){{ $message }}@enderror
Awarder Type *
:
Contract Summary *
:
@error('contracts.*.contract_title'){{ $message }}@enderror
Telephone No. *
:
@error('contracts.*.contact_phone'){{ $message }}@enderror
Contact Person *
:
@error('contracts.*.contact_person'){{ $message }}@enderror
Email *
:
@error('contracts.*.contact_email'){{ $message }}@enderror
Contract Amount (RM) *
:
@error('contracts.*.contract_value'){{ $message }}@enderror
Tenure (month(s)) *
:
@error('contracts.*.tenure_period'){{ $message }}@enderror
Source of Payment *
:
@error('contracts.*.payment_method'){{ $message }}@enderror
Assignment Of Payment *
:
@error('contracts.*.assignment_of_payment'){{ $message }}@enderror
@endforeach
This section is required to have at least 1 record.
{{-- 6. SUPPLIERS --}}
7. SUPPLIERS
@php $payeeRemarks = $sectionRejections($lead->payees); @endphp @if ($payeeRemarks->isNotEmpty()) @endif
@csrf
@forelse ($lead->payees as $payee)

Supplier {{ $loop->iteration }}
Company *
:
@error('payees.*.company'){{ $message }}@enderror
Telephone No. *
:
@error('payees.*.contact_phone'){{ $message }}@enderror
Contact Person *
:
@error('payees.*.contact_person'){{ $message }}@enderror
Email *
:
@error('payees.*.contact_email'){{ $message }}@enderror
@empty
Supplier 1
Company *
:
@error('payees.*.company'){{ $message }}@enderror
Telephone No. *
:
@error('payees.*.contact_phone'){{ $message }}@enderror
Contact Person *
:
@error('payees.*.contact_person'){{ $message }}@enderror
Email *
:
@error('payees.*.contact_email'){{ $message }}@enderror
@endforelse
This section is not required
{{-- 7. DECLARATION --}}
8. DECLARATION
@php $declarationRemarks = $sectionRejections($lead->declaration); @endphp @if ($declarationRemarks->isNotEmpty()) @endif
@csrf
Has the firm/company, or any of its proprietor/partners/directors or shareholders ever filed for bankruptcy or been served with a winding up/bankruptcy petition? *
declaration)->bankruptcy_status == 'yes' ? 'checked' : '' }} required> YES declaration)->bankruptcy_status == 'no' ? 'checked' : '' }} required> NO @error('bankruptcy_status'){{ $message }}@enderror
Is there any pending litigation, legal and/or administrative proceeding against the firm/company or its proprietor/partners/directors and shareholders? *
declaration)->litigation_status == 'yes' ? 'checked' : '' }} required> YES declaration)->litigation_status == 'no' ? 'checked' : '' }} required> NO @error('litigation_status'){{ $message }}@enderror
Are there any judgements pending by or against the firm/company, proprietor/partners/directors and shareholders? *
declaration)->judgement_status == 'yes' ? 'checked' : '' }} required> YES declaration)->judgement_status == 'no' ? 'checked' : '' }} required> NO @error('judgement_status'){{ $message }}@enderror
Remarks :
This section is required.
{{-- 8. CERTIFICATION --}}
9. CERTIFICATION
@php $certificationRemarks = $sectionRejections($lead->certification); @endphp @if ($certificationRemarks->isNotEmpty()) @endif
@csrf
certification)->cert_accuracy ? 'checked' : '' }} required> @error('cert_accuracy'){{ $message }}@enderror
certification)->cert_disclosure ? 'checked' : '' }} required> @error('cert_disclosure'){{ $message }}@enderror
certification)->cert_decline ? 'checked' : '' }} required> @error('cert_decline'){{ $message }}@enderror
This section is required.
{{-- DOCUMENT CHECKLIST --}}
DOCUMENT CHECKLIST
@php $documentRemarks = collect(); foreach ($lead->docs as $docR) { if ($docR->verify_status_1 === 'rejected' && !empty($docR->verify_remarks_1)) { $documentRemarks->push(optional($docR->docType)->description . ' - ' . $docR->verify_remarks_1); } if ($docR->verify_status_2 === 'rejected' && !empty($docR->verify_remarks_2)) { $documentRemarks->push(optional($docR->docType)->description . ' - ' . $docR->verify_remarks_2); } } @endphp @if ($documentRemarks->isNotEmpty()) @endif
Document
Required
Uploaded File
Action
@foreach ($docTypes as $categoryId => $docsGroup) @continue((string) $categoryId === (string) $consentsCategoryId) @foreach ($docsGroup as $doc) @php $hasDoc = isset($uploadedDocs[$doc->code]) && $uploadedDocs[$doc->code]->files->count(); @endphp
@csrf
{{ $doc->description }}
{{ $doc->required ? 'Yes' : 'No' }}
@if ($hasDoc) @foreach ($uploadedDocs[$doc->code]->files as $file) @endforeach @else - @endif
required && !$hasDoc) ? 'required' : '' }}>
@error("docs.{$doc->code}.*"){{ $message }}@enderror
@endforeach @endforeach
{{-- CONSENTS --}} @foreach (($docTypes[$consentsCategoryId] ?? collect())->sortBy('code') as $doc) @continue(!$doc->is_active) @php $consentDoc = $uploadedDocs[$doc->code] ?? null; $hasConsentDoc = $consentDoc && $consentDoc->files->count(); @endphp
{{ $doc->description }}
@if($doc->notes)

{{ $doc->notes }}

@endif @if($doc->template_path) Download Template @endif
@csrf @if ($hasConsentDoc)
@foreach ($consentDoc->files as $file)
Uploaded file: {{ $file->file_name }}
@endforeach
@endif
required && !$hasConsentDoc) ? 'required' : '' }}>
@error("docs.{$doc->code}.*"){{ $message }}@enderror
@if($doc->required) This section is required. @else This section is optional. @endif
@endforeach
Each document is uploaded independently — click "Upload" on the row you want to save.
{{-- APPLICATION FEE --}}
APPLICATION FEE
@php $paymentRemarks = collect(); foreach ($lead->payments->where('type', 'P1002') as $paymentR) { if ($paymentR->verify_status_1 === 'rejected' && !empty($paymentR->verify_remarks_1)) { $paymentRemarks->push($paymentR->verify_remarks_1); } if ($paymentR->verify_status_2 === 'rejected' && !empty($paymentR->verify_remarks_2)) { $paymentRemarks->push($paymentR->verify_remarks_2); } } $feePayment = $lead->payments->first(fn ($p) => $p->type === 'P1002'); $isManualWithFile = $feePayment && $feePayment->method === 'manual' && $feePayment->file_path; $isFpxPaid = $feePayment && $feePayment->method === 'FPX' && $feePayment->status === 'paid'; $successTrx = $isFpxPaid ? \App\Models\Transaction::where('serial_no', $lead->serial_no) ->where('transaction_type', 'AF') ->latest('created_at') ->first() : null; @endphp @if ($paymentRemarks->isNotEmpty()) @endif
@if ($isFpxPaid)
Payment has been made through FPX. @if ($successTrx) View Receipt @endif
@elseif ($isManualWithFile)
Payment receipt has been uploaded. {{ $feePayment->file_name }}
@endif
@csrf
Fee Amount (RM)
:
Payment Method *
:
@error('payment_method'){{ $message }}@enderror
Payment Receipt @unless ($isManualWithFile) * @endunless
:
method === 'manual' ? 'required' : '') }}> @error('payment_docs'){{ $message }}@enderror
Notes
:
This section is required.
@if ($hasRejection)
@else
@csrf
@endif
@endif
@endsection @section('script') @endsection