@php $locale = $locale ?? app()->getLocale(); $isRTL = $locale === 'ar'; $payload = $report->report_payload; $details = $payload['handover_details'] ?? []; $summary = $payload['summary'] ?? []; // Translation array $translations = [ 'ar' => [ 'title' => 'محضر استلام (معاينة وحصر الأصول)', 'generated' => 'تم الإنشاء', 'report_id' => 'رقم التقرير', 'visit_information' => 'معلومات الزيارة', 'visit_number' => 'رقم الزيارة', 'project' => 'المشروع', 'client' => 'العميل', 'location' => 'الموقع', 'comparison_table' => 'جدول مقارنة الأصول (التعاقدية vs الفعلية)', 'equipment_name' => 'اسم المعدة', 'expected_count' => 'العدد التعاقدي', 'actual_count' => 'العدد الفعلي', 'difference' => 'الفارق', 'status' => 'الحالة', 'asset_inventory' => 'حصر الأصول التفصيلي', 'serial_number' => 'الرقم التسلسلي', 'model' => 'الموديل', 'brand' => 'الماركة', 'condition' => 'الحالة الفنية', 'location_building' => 'المبنى/الموقع', 'signatures' => 'الاعتمادات', 'technician_signature' => 'توقيع الفني', 'client_signature' => 'توقيع العميل', 'client_representative' => 'ممثل العميل', 'date' => 'التاريخ', 'match' => 'مطابق', 'excess' => 'زيادة', 'deficit' => 'عجز', ], 'en' => [ 'title' => 'Handover / Survey Report (Asset Inventory)', 'generated' => 'Generated', 'report_id' => 'Report ID', 'visit_information' => 'Visit Information', 'visit_number' => 'Visit Number', 'project' => 'Project', 'client' => 'Client', 'location' => 'Location', 'comparison_table' => 'Asset Comparison Table (Contracted vs Actual)', 'equipment_name' => 'Equipment Name', 'expected_count' => 'Contracted Count', 'actual_count' => 'Actual Count', 'difference' => 'Difference', 'status' => 'Status', 'asset_inventory' => 'Detailed Asset Inventory', 'serial_number' => 'Serial Number', 'model' => 'Model', 'brand' => 'Brand', 'condition' => 'Technical Condition', 'location_building' => 'Building/Location', 'signatures' => 'Signatures', 'technician_signature' => 'Technician Signature', 'client_signature' => 'Client Signature', 'client_representative' => 'Client Representative', 'date' => 'Date', 'match' => 'Match', 'excess' => 'Excess', 'deficit' => 'Deficit', ], ]; $t = $translations[$locale] ?? $translations['en']; @endphp {{ $t['title'] }} - {{ $report->code }}

{{ $t['title'] }}

{{ $t['report_id'] }}: {{ $report->code }} | {{ $t['generated'] }}: {{ now()->format('Y-m-d H:i') }}

{{ $t['visit_information'] }}
{{ $t['visit_number'] }} {{ $visit->visit_number }} {{ $t['project'] }} {{ $visit->project?->name }}
{{ $t['client'] }} {{ $visit->project?->customer?->name }} {{ $t['location'] }} {{ $visit->location?->name }}
{{ $t['comparison_table'] }}
@foreach($details['comparison_table'] ?? [] as $row) @endforeach
{{ $t['equipment_name'] }} {{ $t['expected_count'] }} {{ $t['actual_count'] }} {{ $t['difference'] }} {{ $t['status'] }}
{{ $row['equipment_name'] }} {{ $row['expected_count'] }} {{ $row['actual_count'] }} {{ $row['difference'] > 0 ? '+' . $row['difference'] : $row['difference'] }} {{ $t[$row['status']] ?? $row['status'] }}
{{ $t['asset_inventory'] }}
@foreach($details['actual_assets_inventory'] ?? [] as $index => $asset) @endforeach
# {{ $t['equipment_name'] }} {{ $t['brand'] }} {{ $t['model'] }} {{ $t['serial_number'] }} {{ $t['condition'] }} {{ $t['location_building'] }}
{{ $index + 1 }} {{ $asset['equipment_name'] }} {{ $asset['brand'] ?? $asset['manufacturer'] ?? '-' }} {{ $asset['model'] ?? '-' }} {{ $asset['serial_number'] ?? '-' }} {{ $asset['asset_status'] ?? '-' }} {{ $asset['location_building'] ?? '-' }}

{{ $t['technician_signature'] }}

@if($details['technician_signature'] ?? null) @else
@endif

{{ $t['client_signature'] }}

@if($details['client_signature'] ?? null) @else
@endif

{{ $t['client_representative'] }}: {{ $details['client_representative'] ?? '-' }}

{{ $t['date'] }}: {{ $details['signatures_date'] ?? now()->toDateString() }}