@php $storeName = $store->name ?? ''; if (is_array($storeName)) { $storeName = $storeName[$locale] ?? ($storeName['en'] ?? (array_values($storeName)[0] ?? '')); } @endphp

{{ (string) $storeName }}

{{ $locale === 'ar' ? 'إيصال' : 'RECEIPT' }}
#{{ $order->order_number }}
{{ optional($order->placed_at ?? $order->created_at)->format('Y-m-d H:i') }}

@php $customerName = $order->customer_snapshot['name'] ?? optional($order->customer)->name ?? '-'; if (is_array($customerName)) { $customerName = $customerName[$locale] ?? ($customerName['en'] ?? (array_values($customerName)[0] ?? '-')); } $cashierName = $order->createdByAdmin?->name; if (is_array($cashierName)) { $cashierName = $cashierName[$locale] ?? ($cashierName['en'] ?? (array_values($cashierName)[0] ?? '')); } @endphp
{{ $locale === 'ar' ? 'العميل' : 'Customer' }}: {{ (string) $customerName }}
@if(! empty($order->customer_snapshot['phone']) && ! is_array($order->customer_snapshot['phone']))
{{ $order->customer_snapshot['phone'] }}
@endif @if($cashierName)
{{ $locale === 'ar' ? 'الكاشير' : 'Cashier' }}: {{ (string) $cashierName }}
@endif
@foreach($order->items as $item) @php $rawName = is_array($item->product_name) ? ($item->product_name[$locale] ?? array_values($item->product_name)[0] ?? '') : (string) ($item->product_name ?? ''); @endphp @endforeach
{{ $locale === 'ar' ? 'الصنف' : 'Item' }} {{ $locale === 'ar' ? 'المجموع' : 'Total' }}
{{ $rawName }}
{{ (int) $item->quantity }} × {{ number_format((float) $item->unit_price, 3) }}
{{ number_format((float) $item->line_total, 3) }}

@if(bccomp((string) $order->discount_total, '0', 3) > 0) @endif @if(bccomp((string) $order->shipping_amount, '0', 3) > 0) @endif @if(bccomp((string) $order->tax_amount, '0', 3) > 0) @endif @if(bccomp((string) ($order->wallet_amount_applied ?? '0'), '0', 3) > 0) @endif @if($order->cash_received !== null) @endif @if($order->change_due !== null) @endif
{{ $locale === 'ar' ? 'الإجمالي الفرعي' : 'Subtotal' }} {{ number_format((float) $order->subtotal, 3) }}
{{ $locale === 'ar' ? 'الخصم' : 'Discount' }} -{{ number_format((float) $order->discount_total, 3) }}
{{ $locale === 'ar' ? 'الشحن' : 'Shipping' }} {{ number_format((float) $order->shipping_amount, 3) }}
{{ $locale === 'ar' ? 'الضريبة' : 'Tax' }} {{ number_format((float) $order->tax_amount, 3) }}
{{ $locale === 'ar' ? 'الإجمالي' : 'Total' }} {{ number_format((float) $order->grand_total, 3) }} {{ $order->currency_code }}
{{ $locale === 'ar' ? 'محفظة' : 'Wallet' }} -{{ number_format((float) $order->wallet_amount_applied, 3) }}
{{ $locale === 'ar' ? 'المدفوع نقداً' : 'Cash' }} {{ number_format((float) $order->cash_received, 3) }}
{{ $locale === 'ar' ? 'الباقي' : 'Change' }} {{ number_format((float) $order->change_due, 3) }}