@php $invoiceType = (int)($info->invoice_type ?? 1); @endphp @if($invoiceType === 1) {{-- ====================================================== DESIGN 1: STANDARD A4 INVOICE (Classic) ====================================================== --}} Order Invoice
@foreach($items as $item) @php $subTotal = 0; @endphp
logo
{{ $info->site_name ?? config('app.name') }}
{{ $info->address ?? '' }}
Invoice
ID: #{{ $item->invoice_no }}
Order Summary
Invoice To
{{ $item->first_name }} {{ $item->last_name }}
{{ $item->shipping_address }}
Phone: {{ $item->mobile }}
Invoice#{{ $item->invoice_no }}
Date{{ dateFormate($item->date) }}
@foreach($item->details as $idx => $detail) @php $unitPrice = $detail->unit_price ?? 0; $qty = (int)($detail->quantity ?? 1); $rowTotal = $unitPrice * $qty; $subTotal += $rowTotal; @endphp @endforeach
SL. Item Color Size Price Qty Total
{{ $idx+1 }} {{ $detail->product->name ?? '' }} {{ (optional($detail->variation->color)->name !== 'Default') ? optional($detail->variation->color)->name : '' }} {{ (optional($detail->variation->size)->title !== 'free') ? optional($detail->variation->size)->title : '' }} {{ priceFormate($unitPrice) }} {{ $qty }} {{ priceFormate($rowTotal) }}
@if($item->note)
Note: {{ $item->note }}
@endif
@php $delivery = (float)($item->shipping_charge ?? 0); $grandTotal = $item->final_amount ?? ($subTotal + $delivery - ($item->discount ?? 0)); @endphp
Sub Total{{ priceFormate($subTotal) }}
Delivery{{ priceFormate($delivery) }}
@if($item->discount > 0)
Discount-{{ priceFormate($item->discount) }}
@endif
Total
{{ priceFormate($grandTotal) }}
@endforeach @elseif($invoiceType === 2) {{-- ====================================================== DESIGN 2: 75mm x 100mm STICKER INVOICE ====================================================== --}} Order Sticker
@foreach($items as $item)
logo
{{ $info->site_name }}
Help: {{ $info->owner_phone }}
{{-- ✅ QR code will output only mobile number --}}
Invoice: #{{ $item->invoice_no }} | Date: {{ dateFormate($item->date) }}
To: {{ trim(($item->first_name ?? '').' '.($item->last_name ?? '')) }}
Phone: {{ $item->mobile }}
{{ $item->shipping_address }}
@php $st=0; @endphp @foreach($item->details as $line) @php $rt=($line->unit_price ?? 0)*($line->quantity ?? 1); $st+=$rt; @endphp @endforeach
ProductQtyTotal
{{ $line->product->name ?? '' }}{{ $line->quantity }}{{ number_format($rt,2) }}
@php $dc=(float)($item->shipping_charge ?? 0); @endphp
Sub Total{{ number_format($st,2) }}
Delivery{{ number_format($dc,2) }}
Grand Total{{ number_format($st+$dc-($item->discount ?? 0),2) }}
@endforeach @elseif($invoiceType === 3) {{-- ====================================================== DESIGN 3: PREMIUM CORPORATE A4 INVOICE (NO QR CODE) ====================================================== --}} Premium Corporate Invoice
@foreach($items as $item) @php $subTotal = 0; @endphp
@if(strtolower($item->payment_status) == 'paid') @else
DUE
@endif
@if(isset($info->site_logo)) Logo @else

{{ $info->site_name ?? 'COMPANY NAME' }}

@endif

{{ $info->address }}

Tel: {{ $info->owner_phone }}

Email: {{ $info->owner_email }}

INVOICE

#{{ $item->invoice_no }}

Date: {{ date('d M, Y', strtotime($item->date)) }}

Billed To

{{ trim(($item->first_name ?? '') . ' ' . ($item->last_name ?? '')) }}

{{ $item->shipping_address }}

📞 {{ $item->mobile }}

Payment & Shipping

Status: {{ $item->status }}

Payment: {{ $item->payment_status ?? 'Due' }}

@if($item->courier)

Courier: {{ $item->courier->name ?? '' }}

@endif
@foreach($item->details as $idx => $detail) @php $unitPrice = $detail->unit_price ?? 0; $qty = (int)($detail->quantity ?? 1); $rowTotal = $unitPrice * $qty; $subTotal += $rowTotal; $variantInfo = ""; if(isset($detail->variation)){ $c = optional($detail->variation->color)->name; $s = optional($detail->variation->size)->title; if($c && $c != 'Default') $variantInfo .= "Color: $c "; if($s && $s != 'free') $variantInfo .= " | Size: $s"; } @endphp @endforeach
# Item Description Qty Price Total
{{ $idx + 1 }} {{ $detail->product->name ?? '' }} {{ trim($variantInfo, ' |') }} {{ $qty }} {{ number_format($unitPrice, 2) }} {{ number_format($rowTotal, 2) }}
{{-- ✅ Design 3: QR Code Removed as requested --}}
@if($item->discount > 0) @endif @php $delivery = (float)($item->shipping_charge ?? 0); $grandTotal = $item->final_amount ?? ($subTotal + $delivery - ($item->discount ?? 0)); @endphp
Subtotal {{ number_format($subTotal, 2) }}
Delivery Charge {{ number_format($item->shipping_charge ?? 0, 2) }}
Discount - {{ number_format($item->discount, 2) }}
Grand Total{{ number_format($grandTotal, 2) }} BDT
@endforeach @elseif($invoiceType === 4) {{-- ====================================================== DESIGN 4: PREMIUM POS / THERMAL RECEIPT (80mm) WITH SCANNER ====================================================== --}} POS Receipt
@foreach($items as $item)

{{ $info->site_name }}

{{ $info->address }}

Phone: {{ $info->owner_phone }}

{{-- ✅ SCANNABLE BARCODE AT TOP --}}
Barcode
Date: {{ date('d/m/Y h:i A', strtotime($item->created_at)) }}
Customer: {{ trim(($item->first_name ?? '') . ' ' . ($item->last_name ?? '')) }}
Phone: {{ $item->mobile }}
@if($item->payment_status)
Payment: {{ $item->payment_status }}
@endif
@php $subTotal = 0; @endphp @foreach($item->details as $detail) @php $unitPrice = $detail->unit_price ?? 0; $qty = (int)($detail->quantity ?? 1); $rowTotal = $unitPrice * $qty; $subTotal += $rowTotal; @endphp @endforeach
Item Qty Total
{{ \Illuminate\Support\Str::limit($detail->product->name ?? '', 20) }} @if(isset($detail->variation) && isset($detail->variation->size) && $detail->variation->size->title != 'free') Size: {{ $detail->variation->size->title }} @endif {{ $qty }}
x{{ number_format($unitPrice, 0) }}
{{ number_format($rowTotal, 2) }}
Subtotal: {{ number_format($subTotal, 2) }}
Delivery: {{ number_format($item->shipping_charge ?? 0, 2) }}
@if($item->discount > 0)
Discount: -{{ number_format($item->discount, 2) }}
@endif @php $delivery = (float)($item->shipping_charge ?? 0); $grandTotal = $item->final_amount ?? ($subTotal + $delivery - ($item->discount ?? 0)); @endphp
TOTAL: Tk {{ number_format($grandTotal, 2) }}
{{-- ✅ QR CODE AT BOTTOM (Outputs only Mobile Number) --}}
QR Code
@endforeach @endif