@php $locale = app()->getLocale(); $riskColor = [ 'critical' => 'danger', 'high' => 'warning', 'medium' => 'info', 'low' => 'success', 'blacklisted' => 'dark' ]; $riskLabel = [ 'critical' => $locale == 'ar' ? 'حرج جداً 🔴' : 'Critical 🔴', 'high' => $locale == 'ar' ? 'مرتفع 🟠' : 'High 🟠', 'medium' => $locale == 'ar' ? 'متوسط 🟡' : 'Medium 🟡', 'low' => $locale == 'ar' ? 'منخفض 🟢' : 'Low 🟢', 'blacklisted' => $locale == 'ar' ? 'محظور 🚫' : 'Blacklisted 🚫' ]; @endphp

{{ $locale == 'ar' ? 'ملخص تقييم العميل' : 'Customer Risk Assessment' }}

{{ $locale == 'ar' ? 'مستوى المخاطر' : 'Risk Level' }}
@if($customer->isBlacklisted())
🚫
{{ $locale == 'ar' ? 'محظور' : 'Blacklisted' }}
@else @php $risk = $customer->rating; @endphp
@if($risk->risk_level == 'critical') 🔴 @elseif($risk->risk_level == 'high') 🟠 @elseif($risk->risk_level == 'medium') 🟡 @else 🟢 @endif
{{ $riskLabel[$risk->risk_level] }}
@endif
{{ $locale == 'ar' ? 'المخالفات' : 'Violations' }}
@php $violations = $customer->violations()->count(); @endphp
{{ $violations }}
{{ $locale == 'ar' ? 'مخالفة مسجلة' : 'recorded violations' }}
{{ $locale == 'ar' ? 'تأخيرات السداد' : 'Late Payments' }}
@php $delays = $customer->paymentDelays()->where('status', '!=', 'paid')->count(); @endphp
{{ $delays }}
{{ $locale == 'ar' ? 'تأخيرات قائمة' : 'pending delays' }}
{{ $locale == 'ar' ? 'المبلغ المتأخر' : 'Outstanding' }}
@php $outstanding = $customer->paymentDelays()->where('status', '!=', 'paid')->sum('delayed_amount'); @endphp
{{ number_format($outstanding, 0) }}
{{ $locale == 'ar' ? 'ر.س' : 'SAR' }}
@if($customer->isBlacklisted()) @php $blacklist = $customer->getActiveBlacklist(); @endphp
{{ $locale == 'ar' ? '⚠️ العميل محظور من قائمة الحظر' : '⚠️ Customer is Blacklisted' }}
{{ $locale == 'ar' ? 'السبب:' : 'Reason:' }} {{ $blacklist->reason }}
{{ $locale == 'ar' ? 'التاريخ:' : 'Date:' }} {{ $blacklist->blacklisted_from->format('Y-m-d') }}
@if($blacklist->blacklisted_until)
{{ $locale == 'ar' ? 'حتى:' : 'Until:' }} {{ $blacklist->blacklisted_until->format('Y-m-d') }}
@endif
@endif