@php $optionsSum = static fn($item) => $item->options->sum('additional_price'); $settings = app(\App\Settings\GeneralSettings::class); $branch = $order->branch; // Prefer Branch details if set, otherwise fallback to General Settings $companyName = $branch?->name ?? $settings->name; $address = $branch?->address ?? $settings->address; $phone = $branch?->phone ?? $settings->phone; $taxId = $settings->tax_id; $footer = $settings->receipt_notes; $createdAt = optional($order->created_at)->format('d M Y h:i A'); @endphp Order #{{ $order->id }}

{{ $companyName }}

{{ $address }}

@if($phone)

Phone: {{ $phone }}

@endif
Order #{{ $order->id }} {{ $createdAt }}
@foreach ($order->items as $item) @php $optionTotal = $optionsSum($item); $lineTotal = ($item->base_price + $optionTotal) * $item->qty; @endphp @endforeach
Qty Item Name Price Amount
{{ $item->qty }} {{ $item->name }} @if($item->options->isNotEmpty())
@foreach ($item->options as $opt)
{{ $opt->name }} @if((float)$opt->additional_price !== 0.0) ({{ currency((float)$opt->additional_price) }}) @endif
@endforeach
@endif
{{ currency($item->base_price + $optionTotal) }} {{ currency($lineTotal) }}
Sub Total:{{ currency((float)$order->subtotal) }}
Discount:{{ currency((float)$order->discount) }}
Tax:{{ currency((float)$order->tax) }}
Total:{{ currency((float)$order->total) }}
Amount Payment Method Date & Time
{{ currency((float)$order->total) }} {{ is_object($order->type) && method_exists($order->type, 'label') ? $order->type->label() : strtoupper((string)$order->type) }} {{ $createdAt }}
@if($taxId)
Tax ID: {{ $taxId }}
@endif