@php $locale = $locale ?? app()->getLocale(); $isRTL = $locale === 'ar'; $payload = $report->report_payload; $details = $payload['pm_details'] ?? []; // Translation array $translations = [ 'ar' => [ 'title' => 'تقرير الصيانة الوقائية الأولى', 'generated' => 'تم الإنشاء', 'report_id' => 'رقم التقرير', 'visit_information' => 'معلومات الزيارة', 'visit_number' => 'رقم الزيارة', 'project' => 'المشروع', 'checklists' => 'نتائج الفحص (Checklists)', 'faults' => 'الأعطال المكتشفة', 'spare_parts' => 'قطع الغيار الموصى بها', 'asset' => 'الأصل', 'item' => 'البند', 'result' => 'النتيجة', 'compliant' => 'سليم', 'non_compliant' => 'غير سليم', 'fault_description' => 'وصف العطل', 'fault_severity' => 'الخطورة', 'part_name' => 'اسم القطعة', 'quantity' => 'الكمية', 'signatures' => 'الاعتمادات', 'client_signature' => 'توقيع العميل', 'date' => 'التاريخ', ], 'en' => [ 'title' => 'First Preventive Maintenance Report', 'generated' => 'Generated', 'report_id' => 'Report ID', 'visit_information' => 'Visit Information', 'visit_number' => 'Visit Number', 'project' => 'Project', 'checklists' => 'Checklist Results', 'faults' => 'Discovered Faults', 'spare_parts' => 'Recommended Spare Parts', 'asset' => 'Asset', 'item' => 'Item', 'result' => 'Result', 'compliant' => 'Compliant', 'non_compliant' => 'Non-Compliant', 'fault_description' => 'Fault Description', 'fault_severity' => 'Severity', 'part_name' => 'Part Name', 'quantity' => 'Quantity', 'signatures' => 'Signatures', 'client_signature' => 'Client Signature', 'date' => 'Date', ], ]; $t = $translations[$locale] ?? $translations['en']; @endphp
{{ $t['report_id'] }}: {{ $report->code }} | {{ $t['generated'] }}: {{ now()->format('Y-m-d H:i') }}
| {{ $t['visit_number'] }} | {{ $visit->visit_number }} | {{ $t['project'] }} | {{ $visit->project?->name }} |
|---|
| {{ $t['item'] }} | {{ $t['result'] }} |
|---|---|
| {{ $item['item_name'] }} | {{ ($item['is_compliant'] ?? true) ? $t['compliant'] : $t['non_compliant'] }} |
| {{ $t['asset'] }} | {{ $t['fault_description'] }} | {{ $t['fault_severity'] }} |
|---|---|---|
| {{ $fault['asset_name'] ?? '-' }} | {{ $fault['description'] }} | {{ $fault['severity'] ?? '-' }} |
| {{ $t['asset'] }} | {{ $t['part_name'] }} | {{ $t['quantity'] }} |
|---|---|---|
| {{ $part['asset_name'] ?? '-' }} | {{ $part['part_name'] }} | {{ $part['quantity'] }} |
{{ $t['client_signature'] }}
@if($report->customer_signature){{ $t['date'] }}: {{ now()->toDateString() }}