@extends('layouts.admin') @section('page_title', ($isRtl ? 'طلب تمويل' : 'Financing Request') . ' — ' . $req->request_number) @push('styles') @endpush @section('content') @php $statusIconMap = [ 'pending' => 'fa-hourglass-half', 'approved' => 'fa-circle-check', 'rejected' => 'fa-circle-xmark', 'canceled' => 'fa-ban', 'completed' => 'fa-trophy', ]; $statusIcon = $statusIconMap[$req->status] ?? 'fa-circle-info'; $statusLabels = [ 'pending' => $isRtl ? 'قيد المراجعة' : 'Pending', 'approved' => $isRtl ? 'مقبول' : 'Approved', 'rejected' => $isRtl ? 'مرفوض' : 'Rejected', 'canceled' => $isRtl ? 'ملغي' : 'Canceled', 'completed' => $isRtl ? 'مكتمل' : 'Completed', ]; $stageLabels = [ 'pending_payment' => $isRtl ? 'بانتظار الدفع' : 'Pending Payment', 'paid' => $isRtl ? 'تم الدفع' : 'Paid', 'offers' => $isRtl ? 'عرض العروض' : 'Offers', 'offer_selected' => $isRtl ? 'تم اختيار العرض' : 'Offer Selected', 'completed' => $isRtl ? 'مكتمل' : 'Completed', ]; $paymentStatusLabels = [ 'success' => $isRtl ? 'ناجح' : 'Success', 'failed' => $isRtl ? 'فشل' : 'Failed', 'pending' => $isRtl ? 'معلّق' : 'Pending', ]; $productLabels = [ 'personal' => $isRtl ? 'تمويل شخصي' : 'Personal Financing', 'auto' => $isRtl ? 'تمويل سيارات' : 'Auto Financing', 'mortgage' => $isRtl ? 'تمويل عقاري' : 'Mortgage', 'credit_card' => $isRtl ? 'بطاقة ائتمان' : 'Credit Card', 'sme' => $isRtl ? 'تمويل منشآت' : 'SME Financing', ]; $fieldLabels = $isRtl ? [ 'product_id' => 'المنتج', 'sub_product_id' => 'المنتج الفرعي', 'owner_name' => 'اسم المالك', 'mobile_1' => 'رقم الجوال', 'mobile_without_zero'=> 'الجوال بدون صفر', 'category_1' => 'البريد الإلكتروني', 'guarantee_type' => 'نوع الضمان', 'payment_id' => 'معرّف الدفع', 'nationality' => 'الجنسية', 'national_id' => 'رقم الهوية', 'date_of_birth' => 'تاريخ الميلاد', 'gender' => 'الجنس', 'marital_status' => 'الحالة الاجتماعية', 'dependents' => 'عدد المعالين', 'city' => 'المدينة', 'address' => 'العنوان', 'employment_status' => 'الحالة الوظيفية', 'employer' => 'جهة العمل', 'employer_name' => 'اسم جهة العمل', 'sector' => 'القطاع', 'job_title' => 'المسمى الوظيفي', 'years_of_service' => 'سنوات الخدمة', 'monthly_salary' => 'الراتب الشهري', 'other_income' => 'دخل آخر', 'monthly_obligations'=> 'الالتزامات الشهرية', 'bank_name' => 'اسم البنك', 'salary_bank' => 'بنك الراتب', 'has_existing_loan' => 'يوجد قرض قائم', 'existing_loan_amount'=> 'قيمة القرض القائم', 'requested_amount' => 'المبلغ المطلوب', 'requested_term' => 'المدة المطلوبة', 'purpose' => 'الغرض من التمويل', 'notes' => 'ملاحظات', 'property_type' => 'نوع العقار', 'property_value' => 'قيمة العقار', 'down_payment' => 'الدفعة الأولى', 'car_brand' => 'ماركة السيارة', 'car_model' => 'موديل السيارة', 'car_year' => 'سنة الصنع', 'car_price' => 'سعر السيارة', 'business_name' => 'اسم المنشأة', 'business_type' => 'نوع النشاط', 'cr_number' => 'السجل التجاري', 'annual_revenue' => 'الإيرادات السنوية', ] : []; $fieldLabel = function($k) use ($fieldLabels, $isRtl) { if ($isRtl && isset($fieldLabels[$k])) return $fieldLabels[$k]; return ucwords(str_replace('_', ' ', $k)); }; @endphp {{ $isRtl ? 'رجوع للقائمة' : 'Back to list' }} {{-- Hero --}}

{{ $req->request_number }}

{{ $req->client_name ?? '—' }} @if($req->user) {{ $req->user->email }}@endif {{ $req->created_at?->format('Y-m-d H:i') }}
{{ $req->status_label }}
{{ $isRtl ? 'قيمة القرض' : 'Loan Amount' }}
{{ $req->loan_amount ? number_format((float)$req->loan_amount) . ' ' . ($isRtl ? 'ر.س' : 'SAR') : '—' }}
{{ $isRtl ? 'المدة' : 'Term' }}
{{ $req->loan_term_months ? $req->loan_term_months . ' ' . ($isRtl ? 'شهر' : 'mo') : '—' }}
APR
{{ $req->loan_apr ? $req->loan_apr . '%' : '—' }}
{{ $isRtl ? 'المرحلة' : 'Stage' }}
{{ $req->stage ? ($stageLabels[$req->stage] ?? $req->stage) : '—' }}
{{-- Left: tabs --}}
{{-- Overview --}}
{{ $isRtl ? 'بيانات العميل' : 'Client Information' }}
{{ $isRtl ? 'الاسم' : 'Name' }}{{ $req->client_name ?? '—' }}
{{ $isRtl ? 'الهاتف' : 'Phone' }}{{ $req->phone ?? '—' }}
{{ $isRtl ? 'البريد بالطلب' : 'Request Email' }}{{ $req->category_1 ?? '—' }}
@if($req->user)
{{ $isRtl ? 'حساب العميل' : 'User Account' }}{{ $req->user->name }} ({{ $req->user->email }})
@endif
{{ $isRtl ? 'تفاصيل التمويل' : 'Financing Details' }}
@php $spCfg = config('financing_documents.sub_products.' . $req->sub_product_id); $productName = $spCfg ? ($isRtl ? $spCfg['name_ar'] : $spCfg['name_en']) : $req->product_id; $subProductName = $spCfg ? ($isRtl ? $spCfg['name_ar'] : $spCfg['name_en']) : ($req->sub_product_id ?: '—'); @endphp
{{ $isRtl ? 'المنتج' : 'Product' }}{{ $productName }}
{{ $isRtl ? 'المنتج الفرعي' : 'Sub-product' }}{{ $subProductName }}
{{ $isRtl ? 'قيمة القرض' : 'Loan Amount' }}{{ $req->loan_amount ? number_format((float)$req->loan_amount, 2) . ' ' . ($isRtl ? 'ر.س' : 'SAR') : '—' }}
{{ $isRtl ? 'مدة القرض' : 'Loan Term' }}{{ $req->loan_term_months ? $req->loan_term_months . ' ' . ($isRtl ? 'شهر' : 'months') : '—' }}
{{ $isRtl ? 'نسبة الفائدة' : 'APR' }}{{ $req->loan_apr ? $req->loan_apr . ' %' : '—' }}
@if($req->proposed_offer_amount) @php $_calcCfg = config('financing_documents.calculation_inputs.' . ($req->sub_product_id ?? 0)); $_formulaLabel = $_calcCfg[$isRtl ? 'formula_label_ar' : 'formula_label_en'] ?? ($req->proposed_offer_formula ?? '—'); @endphp
{{ $isRtl ? 'العرض المقترح' : 'Proposed Offer' }} {{ number_format((float)$req->proposed_offer_amount, 2) }} {{ $isRtl ? 'ر.س' : 'SAR' }}
{{ $isRtl ? 'معادلة الحساب' : 'Formula' }} {{ $_formulaLabel }}
@if(is_array($req->calc_inputs)) @foreach($req->calc_inputs as $name => $value) @php $_locKey = $isRtl ? 'ar' : 'en'; $label = $_calcCfg['label_overrides'][$name][$_locKey] ?? $_calcCfg['fields'][$name]['label_' . $_locKey] ?? $name; @endphp
↳ {{ $label }} {{ number_format((float)$value, 2) }} {{ $isRtl ? 'ر.س' : 'SAR' }}
@endforeach @endif @if($req->proposed_offer_accepted_at)
{{ $isRtl ? 'تم قبول العرض' : 'Offer Accepted' }} {{ $req->proposed_offer_accepted_at->format('Y-m-d H:i') }}
@endif @endif @if($req->loan_amount && $req->loan_term_months) @php $apr = (float)($req->loan_apr ?? 0); $p = (float)$req->loan_amount; $n = (int)$req->loan_term_months; if ($apr > 0) { $r = ($apr/100)/12; $monthly = $p * $r / (1 - pow(1+$r, -$n)); } else { $monthly = $n > 0 ? $p / $n : 0; } @endphp
{{ $isRtl ? 'القسط الشهري التقريبي' : 'Est. Monthly Payment' }} {{ number_format($monthly, 2) }} {{ $isRtl ? 'ر.س' : 'SAR' }}
@endif
@if($req->selectedOffer) @php $offer = $req->selectedOffer; $bank = $offer->bank; $brand = $bank?->brand_color ?: '#e31e24'; @endphp
{{ $isRtl ? 'العرض الذي اختاره العميل' : 'Customer Selected Offer' }}
@if($bank && $bank->logo) {{ $bank->name }} @else
{{ mb_substr($bank?->name ?? 'B', 0, 1) }}
@endif
{{ $bank?->name ?? ($isRtl ? 'بنك' : 'Bank') }}
{{ $offer->title }}
@if($offer->is_best) {{ $isRtl ? 'الأفضل' : 'Best' }} @endif
APR
{{ $offer->apr ? rtrim(rtrim(number_format((float)$offer->apr, 3), '0'), '.') . '%' : '—' }}
{{ $isRtl ? 'أقصى مبلغ' : 'Max Amount' }}
{{ $offer->max_amount ? number_format((float)$offer->max_amount) . ' ' . ($isRtl ? 'ر.س' : 'SAR') : '—' }}
{{ $isRtl ? 'أقل مبلغ' : 'Min Amount' }}
{{ $offer->min_amount ? number_format((float)$offer->min_amount) . ' ' . ($isRtl ? 'ر.س' : 'SAR') : '—' }}
{{ $isRtl ? 'أقصى مدة' : 'Max Term' }}
{{ $offer->max_term_years ? $offer->max_term_years . ' ' . ($isRtl ? 'سنة' : 'yr') : '—' }}
{{ $isRtl ? 'عينة قسط شهري' : 'Monthly Sample' }}
{{ $offer->monthly_sample ? number_format((float)$offer->monthly_sample) . ' ' . ($isRtl ? 'ر.س' : 'SAR') : '—' }}
{{ $isRtl ? 'القطاع' : 'Sector' }}
{{ $offer->sector ?? '—' }}
@if($offer->approval_note)
{{ $offer->approval_note }}
@endif
{{ $isRtl ? 'رقم العرض' : 'Offer ID' }} #{{ $offer->id }} @if($bank) {{ $bank->slug }} @endif
@if($bank) {{ $isRtl ? 'عرض البنك' : 'View Bank' }} @endif
@endif @if($req->admin_notes)
{{ $isRtl ? 'ملاحظات إدارية' : 'Admin Notes' }}
{{ $req->admin_notes }}
@endif
{{-- Full details (editable) --}}
@php $skip = ['id','created_at','updated_at','user_id','status','stage','payment_status','selected_offer_id','request_number','payment_id','loan_amount','loan_term_months','loan_apr','admin_notes','external_reference','calc_inputs','proposed_offer_amount','proposed_offer_formula','proposed_offer_accepted_at']; $fileFields = array_keys(config('financing_documents.documents', [])); $legacyFiles = ['promissory_note_file','wc_bank_statement_file','wc_budget_last_3_years_file','wc_articles_of_association_file','wc_commercial_registration_file','re_income_audited_fs_3y_file','re_income_bank_statement_12m_file','re_income_commercial_registration_file','re_income_articles_of_association_file','re_income_latest_valuation_file','re_land_audited_fs_3y_file','re_land_bank_statement_12m_file','re_land_commercial_registration_file','re_land_articles_of_association_file','re_land_latest_valuation_file']; $allFileFields = array_merge($fileFields, $legacyFiles); $extra = collect($req->getAttributes())->except(array_merge($skip, $allFileFields))->filter(fn($v) => $v !== null && $v !== ''); @endphp @if($extra->count())
{{ $isRtl ? 'جميع بيانات الطلب' : 'All Request Fields' }}
{{ $extra->count() }} {{ $isRtl ? 'حقل' : 'fields' }} {{ $isRtl ? 'أي تعديل يرسل إيميل للعميل' : 'Any edit emails customer' }}
@foreach($extra as $k => $v) @php // Show product names instead of IDs $displayVal = $v; if (($k === 'product_id' || $k === 'sub_product_id') && is_numeric($v)) { $pCfg = config('financing_documents.sub_products.' . $v); $displayVal = $pCfg ? ($isRtl ? $pCfg['name_ar'] : $pCfg['name_en']) . " ($v)" : $v; } elseif (!is_scalar($v)) { $displayVal = json_encode($v, JSON_UNESCAPED_UNICODE); } @endphp
{{ $fieldLabel($k) }}@if($isRtl)
{{ $k }}@endif
{{ $displayVal }}
@endforeach
@else
{{ $isRtl ? 'لا توجد بيانات إضافية' : 'No additional fields' }}
@endif
{{-- Documents --}}
@php $docConfig = config('financing_documents'); $allDocs = $docConfig['documents'] ?? []; $spConfig = $docConfig['sub_products'][$req->sub_product_id] ?? null; $spDocRules = $spConfig ? ($spConfig['documents'] ?? []) : []; // Build list of all document fields with their values $docFields = []; foreach ($allDocs as $field => $labels) { $value = $req->getAttribute($field); $rule = $spDocRules[$field] ?? null; $parts = $rule ? explode('|', $rule, 2) : [null, null]; $isRequired = ($parts[0] === 'required'); $note = $parts[1] ?? null; $docFields[$field] = [ 'label_en' => $labels[0], 'label_ar' => $labels[1], 'value' => $value, 'required' => $isRequired, 'note' => $note, 'applicable' => ($rule !== null), ]; } // Also add legacy file fields $legacyFields = [ 'promissory_note_file' => [$isRtl ? 'سند لأمر' : 'Promissory Note', 'سند لأمر'], 'wc_bank_statement_file' => [$isRtl ? 'كشف حساب (رأس المال)' : 'Bank Statement (WC)', 'كشف حساب (رأس المال)'], 'wc_budget_last_3_years_file' => [$isRtl ? 'الميزانية آخر 3 سنين' : 'Budget Last 3 Years', 'الميزانية آخر 3 سنين'], 'wc_articles_of_association_file' => [$isRtl ? 'عقد التأسيس (رأس المال)' : 'Articles of Association (WC)', 'عقد التأسيس (رأس المال)'], 'wc_commercial_registration_file' => [$isRtl ? 'السجل التجاري (رأس المال)' : 'Commercial Registration (WC)', 'السجل التجاري (رأس المال)'], 're_income_audited_fs_3y_file' => [$isRtl ? 'ميزانية مدققة 3 سنوات (إيراد)' : 'Audited FS 3Y (Income)', 'ميزانية مدققة 3 سنوات (إيراد)'], 're_income_bank_statement_12m_file' => [$isRtl ? 'كشف حساب 12 شهر (إيراد)' : 'Bank Statement 12M (Income)', 'كشف حساب 12 شهر (إيراد)'], 're_income_commercial_registration_file' => [$isRtl ? 'السجل التجاري (إيراد)' : 'Commercial Reg. (Income)', 'السجل التجاري (إيراد)'], 're_income_articles_of_association_file' => [$isRtl ? 'عقد التأسيس (إيراد)' : 'Articles of Assoc. (Income)', 'عقد التأسيس (إيراد)'], 're_income_latest_valuation_file' => [$isRtl ? 'آخر تقييم عقاري (إيراد)' : 'Latest Valuation (Income)', 'آخر تقييم عقاري (إيراد)'], 're_land_audited_fs_3y_file' => [$isRtl ? 'ميزانية مدققة 3 سنوات (أرض)' : 'Audited FS 3Y (Land)', 'ميزانية مدققة 3 سنوات (أرض)'], 're_land_bank_statement_12m_file' => [$isRtl ? 'كشف حساب 12 شهر (أرض)' : 'Bank Statement 12M (Land)', 'كشف حساب 12 شهر (أرض)'], 're_land_commercial_registration_file' => [$isRtl ? 'السجل التجاري (أرض)' : 'Commercial Reg. (Land)', 'السجل التجاري (أرض)'], 're_land_articles_of_association_file' => [$isRtl ? 'عقد التأسيس (أرض)' : 'Articles of Assoc. (Land)', 'عقد التأسيس (أرض)'], 're_land_latest_valuation_file' => [$isRtl ? 'آخر تقييم عقاري (أرض)' : 'Latest Valuation (Land)', 'آخر تقييم عقاري (أرض)'], ]; foreach ($legacyFields as $field => $labels) { if (!isset($docFields[$field])) { $value = $req->getAttribute($field); if ($value) { $docFields[$field] = [ 'label_en' => $labels[0], 'label_ar' => $labels[1], 'value' => $value, 'required' => false, 'note' => null, 'applicable' => true, ]; } } } $uploadedDocs = collect($docFields)->filter(fn($d) => !empty($d['value'])); $missingRequired = collect($docFields)->filter(fn($d) => $d['required'] && empty($d['value'])); $missingOptional = collect($docFields)->filter(fn($d) => $d['applicable'] && !$d['required'] && empty($d['value'])); @endphp {{-- Sub-product info --}} @if($spConfig)
{{ $isRtl ? 'المنتج الفرعي' : 'Sub-Product' }}: {{ $isRtl ? $spConfig['name_ar'] : $spConfig['name_en'] }}
{{ $uploadedDocs->count() }} {{ $isRtl ? 'مرفوع' : 'uploaded' }} @if($missingRequired->count()) {{ $missingRequired->count() }} {{ $isRtl ? 'مطلوب ناقص' : 'missing required' }} @endif
@endif {{-- Uploaded documents --}}
{{ $isRtl ? 'المستندات المرفقة' : 'Uploaded Documents' }}
{{ $uploadedDocs->count() }}
@if($uploadedDocs->count())
@foreach($uploadedDocs as $field => $doc) @php $url = asset('storage/' . ltrim($doc['value'], '/')); $ext = strtolower(pathinfo($doc['value'], PATHINFO_EXTENSION)); $icon = in_array($ext, ['pdf']) ? 'fa-file-pdf' : (in_array($ext, ['jpg','jpeg','png','gif','webp']) ? 'fa-file-image' : 'fa-file'); $iconColor = in_array($ext, ['pdf']) ? '#dc2626' : (in_array($ext, ['jpg','jpeg','png','gif','webp']) ? '#2563eb' : '#6b7280'); @endphp @endforeach
{{ $isRtl ? 'المستند' : 'Document' }} {{ $isRtl ? 'الحالة' : 'Status' }} {{ $isRtl ? 'النوع' : 'Type' }} {{ $isRtl ? 'الإجراءات' : 'Actions' }}
{{ $isRtl ? $doc['label_ar'] : $doc['label_en'] }}
@if($doc['note']) ({{ $doc['note'] }}) @endif
@if($doc['required']) {{ $isRtl ? 'مطلوب' : 'Required' }} @else {{ $isRtl ? 'اختياري' : 'Optional' }} @endif {{ strtoupper($ext) }}
@else
{{ $isRtl ? 'لم يتم رفع مستندات' : 'No documents uploaded' }}
@endif
{{-- Missing required documents --}} @if($missingRequired->count())
{{ $isRtl ? 'مستندات مطلوبة ناقصة' : 'Missing Required Documents' }}
{{ $missingRequired->count() }}
@foreach($missingRequired as $field => $doc)
{{ $isRtl ? $doc['label_ar'] : $doc['label_en'] }} @if($doc['note']) ({{ $doc['note'] }}) @endif
@endforeach
@endif {{-- Missing optional documents --}} @if($missingOptional->count())
{{ $isRtl ? 'مستندات اختيارية لم ترفع' : 'Optional Documents Not Uploaded' }}
{{ $missingOptional->count() }}
@foreach($missingOptional as $field => $doc)
{{ $isRtl ? $doc['label_ar'] : $doc['label_en'] }} @if($doc['note']) ({{ $doc['note'] }}) @endif
@endforeach
@endif
{{-- Payments --}}
{{ $isRtl ? 'سجل المدفوعات' : 'Payment History' }}
@if($req->payments->count())
@foreach($req->payments as $p)
{{ number_format((float) $p->amount, 2) }} {{ $isRtl ? 'ر.س' : 'SAR' }}
{{ $p->created_at?->format('Y-m-d H:i') }}
{{ $paymentStatusLabels[$p->status] ?? $p->status }}
@endforeach
@else
{{ $isRtl ? 'لا توجد مدفوعات' : 'No payments' }}
@endif
{{-- Activity --}}
{{ $isRtl ? 'الخط الزمني' : 'Timeline' }}
@if($req->logs->count())
    @foreach($req->logs->sortByDesc('created_at') as $log)
  • {{ $log->created_at?->format('Y-m-d H:i') }} · {{ $log->created_at?->diffForHumans() }}
    {{ json_encode($log->meta ?? $log->request_data, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT) }}
  • @endforeach
@else
{{ $isRtl ? 'لا يوجد نشاط' : 'No activity yet' }}
@endif
{{-- Facilitation --}}
@if($req->facilitation_requested_at) {{-- Status Banner --}}
{{ $isRtl ? 'تم تقديم طلب التسهيلات التمويلية' : 'Facilitation Request Submitted' }}
{{ $req->facilitation_requested_at->format('Y-m-d') }}  ·  {{ $req->facilitation_requested_at->format('H:i') }}  ·  {{ $req->facilitation_requested_at->diffForHumans() }}
{{-- OTP Details --}}
{{ $isRtl ? 'رمز التحقق (OTP)' : 'Verification Code (OTP)' }}
{{ $isRtl ? 'الرمز' : 'Code' }} {{ $req->facilitation_otp ?? '—' }}
{{ $isRtl ? 'وقت الإرسال' : 'Sent At' }} {{ $req->facilitation_otp_sent_at ? $req->facilitation_otp_sent_at->format('Y-m-d H:i') : '—' }}
{{ $isRtl ? 'البريد الإلكتروني' : 'Email Sent To' }} {{ $req->category_1 ?: ($req->user->email ?? '—') }}
{{-- Agreements --}}
{{ $isRtl ? 'الموافقات والإقرارات' : 'Agreements & Consents' }}
@php $facilAgreements = [ ['field' => 'facilitation_agree_terms', 'icon' => 'fa-file-contract', 'ar' => 'الشروط والأحكام', 'en' => 'Terms & Conditions'], ['field' => 'facilitation_agree_pledge', 'icon' => 'fa-handshake', 'ar' => 'إقرار وتعهد', 'en' => 'Acknowledgment & Pledge'], ['field' => 'facilitation_agree_contact', 'icon' => 'fa-phone-volume', 'ar' => 'تفويض التواصل مع الجهات', 'en' => 'Contact Authorization'], ['field' => 'facilitation_agree_simah', 'icon' => 'fa-building-columns', 'ar' => 'تفويض سمه (SIMAH)', 'en' => 'SIMAH Authorization'], ]; @endphp @foreach($facilAgreements as $ag)
{{ $isRtl ? $ag['ar'] : $ag['en'] }} @if($req->{$ag['field']}) {{ $isRtl ? 'تمت الموافقة' : 'Agreed' }} @else {{ $isRtl ? 'لم يوافق' : 'Not Agreed' }} @endif
@endforeach
{{-- Client Info Summary --}}
{{ $isRtl ? 'بيانات العميل المقدّم' : 'Applicant Details' }}
{{ $isRtl ? 'الاسم' : 'Name' }} {{ $req->client_name ?? $req->owner_name ?? '—' }}
{{ $isRtl ? 'البريد الإلكتروني' : 'Email' }} {{ $req->category_1 ?: ($req->user->email ?? '—') }}
{{ $isRtl ? 'الجوال' : 'Phone' }} {{ $req->phone ?? $req->mobile_1 ?? '—' }}
{{ $isRtl ? 'رقم الطلب' : 'Request #' }} {{ $req->request_number }}
@else

{{ $isRtl ? 'لم يتم طلب خدمة التسهيلات' : 'Facilitation Not Requested' }}

{{ $isRtl ? 'العميل لم يقدم على خدمة التسهيلات التمويلية بعد.' : 'The client has not submitted a facilitation request yet.' }}

@endif
{{-- Right: actions sidebar --}}
{{-- Status visual --}}
{{ $req->status_label }}
{{ $isRtl ? 'حالة الطلب الحالية' : 'Current request status' }}
@csrf @method('PATCH')

{{ $isRtl ? 'سيتم إرسال إيميل تلقائي للعميل' : 'Customer gets auto-email' }}

{{-- Loan details --}}

{{ $isRtl ? 'بيانات القرض' : 'Loan Details' }}

@csrf @method('PATCH')
{{-- Stage --}}

{{ $isRtl ? 'مرحلة الطلب' : 'Request Stage' }}

@csrf @method('PATCH')
{{-- Facilitation Service --}}

{{ $isRtl ? 'خدمة تسهيلات تمويلية' : 'Facilitation Service' }}

@if($req->facilitation_requested_at)
{{ $isRtl ? 'تم تقديم الطلب' : 'Request Submitted' }}
{{ $req->facilitation_requested_at->format('Y-m-d H:i') }}
{{-- OTP Code --}} @if($req->facilitation_otp)
{{ $isRtl ? 'رمز التحقق (OTP)' : 'Verification Code (OTP)' }}
{{ $req->facilitation_otp }}
@if($req->facilitation_otp_sent_at)
{{ $isRtl ? 'أُرسل في' : 'Sent at' }}: {{ $req->facilitation_otp_sent_at->format('Y-m-d H:i') }}
@endif
@endif {{-- Agreements --}}
{{ $isRtl ? 'الموافقات' : 'Agreements' }}
@php $agreements = [ ['field' => 'facilitation_agree_terms', 'ar' => 'الشروط والأحكام', 'en' => 'Terms & Conditions'], ['field' => 'facilitation_agree_pledge', 'ar' => 'إقرار وتعهد', 'en' => 'Acknowledgment & Pledge'], ['field' => 'facilitation_agree_contact', 'ar' => 'تفويض التواصل', 'en' => 'Contact Authorization'], ['field' => 'facilitation_agree_simah', 'ar' => 'تفويض سمه (SIMAH)', 'en' => 'SIMAH Authorization'], ]; @endphp @foreach($agreements as $ag)
@if($req->{$ag['field']}) @else @endif {{ $isRtl ? $ag['ar'] : $ag['en'] }}
@endforeach
@else
{{ $isRtl ? 'لم يتم طلب الخدمة' : 'Not Requested' }}
@endif
{{-- Danger zone --}}

{{ $isRtl ? 'منطقة الخطر' : 'Danger Zone' }}

@csrf @method('DELETE')
@push('scripts') @endpush @endsection