@php use Picqer\Barcode\BarcodeGeneratorPNG; // Generate barcode for order number $barcodeData = ''; try { $generator = new BarcodeGeneratorPNG(); $barcodeData = 'data:image/png;base64,' . base64_encode($generator->getBarcode($order->order_number, $generator::TYPE_CODE_128, 2, 50)); } catch (\Exception $e) { $barcodeData = ''; } // Get logo $logoPath = public_path('assets/images/logo.png'); $logoData = ''; if (file_exists($logoPath)) { $logoData = 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)); } @endphp
INVOICE
@if($barcodeData) {{ $order->order_number }} @endif
@if($logoData) CUPLE @else
CUPLE كابلي
@endif
From
cuple.ae
Al Garhoud Dubai
Bill to
{{ $order->shipping_full_name }}
{{ $order->shipping_street }}
{{ $order->shipping_city }}
@if($order->shipping_email){{ $order->shipping_email }}
@endif {{ $order->shipping_phone }}
Ship to
{{ $order->shipping_full_name }}
{{ $order->shipping_street }}
{{ $order->shipping_city }}
{{ $order->shipping_phone }}
Invoice no: {{ $order->order_number }}

Invoice date: {{ $invoice->created_at->format('m-d-Y') }}

Order no: {{ $order->order_number }}

Order date: {{ $order->created_at->format('m-d-Y') }}

Payment method: {{ ucfirst(str_replace('_', ' ', $order->payment_method)) }}

@foreach($order->items as $index => $item) @endforeach
S.No SKU Product Quantity Unit price Total price
{{ $index + 1 }} {{ $item->sku ?? $item->variant_sku ?? '-' }}
{{ $item->product_name }}
@php $options = is_string($item->options) ? json_decode($item->options, true) : $item->options; @endphp @if($item->variant_name)
{{ $item->variant_name }}
@endif @if($options && is_array($options))
@if(isset($options['color'])) Color: {{ $options['color'] }} @endif @if(isset($options['color']) && isset($options['size']))  |  @endif @if(isset($options['size'])) Size: {{ $options['size'] }} @endif
@endif
{{ $item->quantity }} {{ $invoice->currency }} {{ number_format($item->price, 2) }} {{ $invoice->currency }} {{ number_format($item->total, 2) }}
@php $couponDiscount = (float) ($order->discount_amount ?? $invoice->discount_amount ?? 0); $offerDiscount = (float) ($order->rule_discount_amount ?? 0); $giftBoxDiscount = (float) ($order->gift_box_discount_amount ?? $invoice->gift_box_discount_amount ?? 0); $pointsDiscount = (float) ($order->points_discount_amount ?? 0); $paymentFee = (float) ($order->payment_fee ?? 0); @endphp @if($couponDiscount > 0) @endif @if($offerDiscount > 0) @endif @if($giftBoxDiscount > 0) @endif @if($pointsDiscount > 0) @endif @if($paymentFee > 0) @endif @if($invoice->tax_amount > 0) @endif
Subtotal {{ $invoice->currency }} {{ number_format($invoice->subtotal, 2) }}
Shipping @if($invoice->shipping_amount > 0) {{ $invoice->currency }} {{ number_format($invoice->shipping_amount, 2) }} @else Free @endif
Discount -{{ $invoice->currency }} {{ number_format($couponDiscount, 2) }}
Offer Discount -{{ $invoice->currency }} {{ number_format($offerDiscount, 2) }}
Gift Box Discount -{{ $invoice->currency }} {{ number_format($giftBoxDiscount, 2) }}
Points Discount -{{ $invoice->currency }} {{ number_format($pointsDiscount, 2) }}
Fee (COD) {{ $invoice->currency }} {{ number_format($paymentFee, 2) }}
Tax {{ $invoice->currency }} {{ number_format($invoice->tax_amount, 2) }}
Total {{ $invoice->currency }} {{ number_format($invoice->total, 2) }}