@extends('admin.layouts.master') @section('title', 'ملف العميل') @section('css') @endsection @section('content')
{{-- Hero Profile Header --}}
{{ mb_substr($customer->name_ar, 0, 1) }}

{{ $customer->name_ar }}

{{ $customer->code }} {{ $customer->type_name }} {{ $customer->customer_type_name }} @if($customer->is_active) نشط @else غير نشط @endif
@can('customers.update') تعديل @endcan رجوع
{{-- Financial KPIs --}}
إجمالي الفواتير
{{ number_format($totalInvoices, 2) }} ج.م
{{ $invoiceStats['count'] }} فاتورة
إجمالي التحصيل
{{ number_format($totalCollected, 2) }} ج.م
{{ $customer->customerPayments->count() }} عملية
الرصيد المستحق
{{ number_format($currentBalance, 2) }} ج.م
{{ $currentBalance > 0 ? 'مديونية على العميل' : 'لا توجد مديونية' }}
استخدام الحد الائتماني
{{ $creditUsedPct }}%
من {{ number_format($creditLimit, 2) }} ج.م
{{-- Invoice Status Row --}}
فواتير مكتملة
{{ $invoiceStats['paid'] }}
مدفوعة جزئياً
{{ $invoiceStats['partially_paid'] }}
فواتير معلقة
{{ $invoiceStats['pending'] }}
إجمالي الفواتير
{{ $invoiceStats['count'] }}
{{-- Customer Info --}}
بيانات العميل
جهة الاتصال:
{{ $customer->contact_person_ar ?: '-' }}
الموبايل:
{{ $customer->phone ?: '-' }}
رقم إضافي:
{{ $customer->alternative_phone ?: '-' }}
البريد الإلكتروني:
{{ $customer->email ?: '-' }}
الرقم الضريبي:
{{ $customer->tax_number ?: '-' }}
السجل التجاري:
{{ $customer->commercial_register ?: '-' }}
المدينة:
{{ $customer->city_ar ?: '-' }}
الحد الائتماني:
{{ number_format((float)$customer->credit_limit, 2) }} ج.م
@if($customer->address_ar)
العنوان:
{{ $customer->address_ar }}
@endif @if($customer->notes_ar)
ملاحظات:
{{ $customer->notes_ar }}
@endif
{{-- Recent Invoices --}}
آخر الفواتير
@if($customer->salesInvoices->count() > 5) أحدث 5 @endif
@forelse($recentInvoices as $inv) @empty @endforelse
رقم الفاتورةالتاريخالإجماليالحالة
{{ $inv->invoice_number }} {{ $inv->invoice_date?->format('Y-m-d') }} {{ number_format((float)$inv->grand_total, 2) }} {!! $inv->status_badge !!}
لا توجد فواتير.
{{-- Account Statement --}}
كشف الحساب
مرتب تصاعدياً بالتاريخ
@forelse($statement as $row) @empty @endforelse @if($statement->isNotEmpty()) @endif
التاريخ البيان المرجع مدين دائن الرصيد
{{ $row['date'] }} {{ $row['description'] }} @if($row['type'] === 'invoice') {{ $row['reference'] }} @elseif($row['type'] === 'payment') {{ $row['reference'] }} @else {{ $row['reference'] }} @endif {{ $row['debit'] > 0 ? number_format($row['debit'], 2) : '-' }} {{ $row['credit'] > 0 ? number_format($row['credit'], 2) : '-' }} {{ number_format($row['balance'], 2) }}
لا توجد حركات مسجلة.
الإجمالي {{ number_format($statement->sum('debit'), 2) }} {{ number_format($statement->sum('credit'), 2) }} {{ number_format($currentBalance, 2) }}
@endsection