@php $takaIconSvg = 'data:image/svg+xml;base64,' . base64_encode(file_get_contents(public_path('images/taka.svg'))); @endphp
@php $headerLogoPath = \App\Models\Setting::get('header_logo_path'); $defaultLogoPath = public_path('images/sob-offer-logo.png'); $logoCandidates = []; if ($headerLogoPath) { $normalizedHeaderLogoPath = ltrim($headerLogoPath, '/'); $normalizedHeaderLogoPath = preg_replace('/^storage\//', '', $normalizedHeaderLogoPath); $logoCandidates[] = storage_path('app/public/' . $normalizedHeaderLogoPath); $logoCandidates[] = public_path('storage/' . $normalizedHeaderLogoPath); $logoCandidates[] = public_path($normalizedHeaderLogoPath); } $logoCandidates[] = $defaultLogoPath; $logoPath = collect($logoCandidates)->first(fn($p) => is_string($p) && file_exists($p)) ?? $defaultLogoPath; @endphp
{{ config('app.name') }}
{{ config('app.address', 'Address not set') }}
{{ config('app.phone', 'Phone not set') }}
{{ config('app.email', 'Email not set') }}
INVOICE

Invoice #: {{ $order->order_number }}

Date: {{ $order->created_at->format('d M Y') }}

Status: {{ ucfirst($order->status) }}

Bill To:

{{ $order->customer_name }}

{{ $order->address }}

{{ $order->city }}, {{ $order->postal_code }}, {{ $order->country }}

Email: {{ $order->customer_email }}

Phone: {{ $order->customer_phone }}

Billing Details:

Order Date: {{ $order->created_at->format('d M Y') }}

Payment Method: {{ strtoupper($order->payment_method) }}

Order Status: {{ ucfirst($order->status) }}

@foreach ($order->items as $item) @php $product = $item->product; $itemSerials = $serialNumbers[$item->id] ?? collect(); $serialList = $itemSerials->sortBy('item_quantity_index')->pluck('serial_number')->implode(', '); @endphp @endforeach
Product Serial Numbers Qty Unit Price Total
{{ $product?->name ?? 'Product unavailable' }} @if ($product?->warranty)
Warranty: {{ str_replace('_',' ',ucfirst($product->warranty)) }} @endif
{{ $serialList ?: 'N/A' }} {{ $item->quantity }} Taka {{ number_format($item->price, 2) }} Taka {{ number_format($item->total, 2) }}
@php $subtotal = $order->items->sum('total'); $tax = $subtotal * (tax_rate()/100); $total = $subtotal + $tax; @endphp
Subtotal Taka {{ number_format($subtotal, 2) }}
Tax ({{ tax_rate() }}%) Taka {{ number_format($tax, 2) }}
Total Taka {{ number_format($total, 2) }}