@extends('layouts.dashboard') @section('content') @include('customers._theme')
@if(session('success'))
✅ {{ session('success') }}
@endif @if($errors->has('review'))
{{ $errors->first('review') }}
@endif
Customer onboarding
{{ str_replace('_', ' ', strtoupper($customer->approval_status ?? 'APPROVED')) }} {{ ($customer->account_type ?? 'cash') === 'on_account' ? 'ON ACCOUNT' : 'CASH' }} {{ $customer->customer_code ?: $customer->application_number }}
@if($customer->changes_requested_reason)

Changes requested: {{ $customer->changes_requested_reason }}

@endif @if($customer->rejection_reason)

Rejected: {{ $customer->rejection_reason }}

@endif
@if(auth()->user()->canManageOperations() && in_array($customer->approval_status, ['submitted', 'under_review']))
@if($customer->approval_status === 'submitted')
@csrf
@endif
@csrf
@csrf
@csrf
@endif
@if(($customer->requested_account_type ?? $customer->account_type) === 'on_account') @php $securityCheque = $customer->documents ->where('document_type', 'security_cheque') ->firstWhere('is_current', true); @endphp
Credit security

Security Cheque

{{ $customer->security_cheque_undated ? 'UNDATED' : 'DATED' }}
Bank
{{ $customer->security_cheque_bank_name ?: '—' }}
Cheque Number
{{ $customer->security_cheque_number ?: '—' }}
Account Holder
{{ $customer->security_cheque_account_holder ?: '—' }}
Amount
{{ $customer->security_cheque_amount !== null ? 'AED '.number_format((float) $customer->security_cheque_amount, 2) : '—' }}
Cheque Date
{{ $customer->security_cheque_date?->format('d M Y') ?: 'Not required (undated)' }}
Notes
{{ $customer->security_cheque_notes ?: '—' }}
@if($securityCheque) View secure cheque document @else
Security cheque document is missing.
@endif
@endif
← Back to Customers

{{ $customer->shop_name }}

{{ ucfirst($customer->status) }}

{{ $customer->customer_code }}

@if($customer->phone) 📞 Call @endif @if($customer->whatsapp) @php $whatsapp = preg_replace('/\D+/', '', $customer->whatsapp); @endphp 💬 WhatsApp @endif ✏️ Edit
Orders
{{ number_format($orderStats['all']) }}
Draft Orders
{{ number_format($orderStats['draft']) }}
Confirmed Orders
{{ number_format($orderStats['confirmed']) }}
Confirmed Sales
AED {{ number_format($orderStats['sales_total'], 2) }}

🧾 Recent Orders

@forelse($customer->orders as $order) @empty @endforelse
Order Status Items Total Date
{{ $order->order_number }} {{ ucfirst($order->status) }} {{ $order->items_count }} AED {{ number_format((float) $order->grand_total, 2) }} {{ $order->created_at?->format('d M Y') }} Open
No linked orders yet.
@if($customer->notes)

📝 Notes

{{ $customer->notes }}
@endif

👤 Contact

Contact Person
{{ $customer->contact_person ?: '—' }}
Phone
{{ $customer->phone ?: '—' }}
Email
{{ $customer->email ?: '—' }}

📍 Assignment & Location

Salesman
{{ $customer->salesman?->name ?: 'Unassigned' }}
Area
{{ $customer->area?->name ?: '—' }}
City
{{ $customer->city ?: '—' }}
Address
{{ $customer->address ?: '—' }}
@if($customer->google_maps_url) 🗺 Open Google Maps @elseif($customer->latitude && $customer->longitude) 🗺 Open Coordinates @endif

💳 Credit

Opening Balance
AED {{ number_format((float) $customer->opening_balance, 2) }}
Credit Limit
{{ $customer->credit_limit !== null ? 'AED '.number_format((float) $customer->credit_limit, 2) : '—' }}
Credit Days
{{ $customer->credit_days !== null ? $customer->credit_days.' days' : '—' }}
@endsection