@php $dir = $direction ?? 'rtl'; $isRtl = $dir === 'rtl'; $start = $isRtl ? 'right' : 'left'; $end = $isRtl ? 'left' : 'right'; // Determine posted status from raw value (always English from backend) $rawStatus = $type ?? 'Unposted'; $isPosted = strtolower($rawStatus) === 'posted'; // Translate badge label based on language $statusLabel = $isPosted ? ($isRtl ? 'مرحل' : 'Posted') : ($isRtl ? 'غير مرحل' : 'Unposted'); $logoImg = $logoSrc ?? null; if (!$logoImg) { $logoImgRaw = data_get($company ?? [], 'invoice_logo') ?: null; $isHtml = request()->query('view') === 'html'; if ($logoImgRaw) { $logoImg = $isHtml ? asset($logoImgRaw) : public_path($logoImgRaw); if (!$isHtml && !file_exists($logoImg)) $logoImg = null; } } $companyVat = $company_vat ?? data_get($company ?? [], 'company_vat', data_get($company ?? [], 'tax_number', '---')); $companyName = $company_name ?? data_get($company ?? [], 'company_name', data_get($company ?? [], 'name_company', 'Azora')); @endphp
{{-- ── TOP ROW: Badge/Date | Logo/Tax ── --}} {{-- Left: badge + print date --}} {{-- Right: Logo + company name + tax --}}
@if($isPosted)✔ @endif{{ $statusLabel }}
 
{{ $isRtl ? 'تاريخ الطباعة:' : 'Print Date:' }} {{ now()->format('Y-m-d') }}
@if($logoSrc) @endif {{ $companyName }}
 
{{ $isRtl ? 'الرقم الضريبي:' : 'Tax ID:' }} {{ $companyVat }}
{{-- ── Divider ── --}}
{{-- ── Title Block ── --}}
{{ $isRtl ? ' قيد يومية' : 'Journal Entry ' }}
{{ $isRtl ? 'ملف محاسبي' : 'Accounting Document' }}
{{-- ── Spacer ── --}}