@php $customerName = trim( ($order->contact?->first_name ?? $order->guest_name ?? 'Guest') .' '. ($order->contact?->last_name ?? '') ); $paymentBadge = match($order->payment_status){ 'paid' => 'success', 'pending' => 'warning', 'failed' => 'danger', 'partially_refunded' => 'info', 'refunded' => 'secondary', default => 'dark' }; $orderBadge = match($order->status){ 'completed' => 'success', 'cancelled' => 'danger', default => 'secondary' }; @endphp
{{-- HEADER --}}

POS Order

{{ $order->order_number }} {{ ucwords(str_replace('_',' ',$order->payment_status)) }} {{ ucfirst($order->status) }}
Created {{ $order->created_at?->format('d M Y') }} at {{ $order->created_at?->format('h:i A') }}
@if($order->invoice?->pdf_path) Download PDF @endif @can('pos-order.create') Add Order @endif
{{-- TOP INFO CARDS --}}
{{-- CUSTOMER --}}
Customer
{{ $customerName ?: 'Guest' }}
{{ $order->contact?->email ?? $order->guest_email ?? '-' }}
{{ $order->contact?->phone1 ?? $order->guest_phone ?? '-' }}

{{ ucfirst($order->customer_type) }}
{{-- ORDER --}}
Order Information
Order # {{ $order->order_number }}
Items {{ $order->items->whereNull('parent_order_item_id')->count() }}
Qty {{ $order->items->sum('quantity') }}
Source {{ strtoupper($order->sales_channel) }}
{{-- PAYMENT --}}
Payment
Method {{ ucwords(str_replace('_',' ', $order->payment_method)) }}
Status {{ ucfirst($order->payment_status) }}
Total {{ format_currency($order->total_amount) }}
{{-- INVOICE --}}
Invoice
Invoice # {{ $order->invoice?->invoice_number ?? '-' }}
Date {{ $order->invoice?->issued_at?->format('d M Y') }}
Time {{ $order->invoice?->issued_at?->format('h:i A') }}
{{-- PART 2 yahin se continue hoga --}} {{-- ORDER ITEMS --}}
Order Items
{{ $order->items->whereNull('parent_order_item_id')->count() }} Item(s)
@foreach($order->items as $item) @php $meta = $item->metadata ?? []; $productName = $meta['product_name'] ?? $item->item_name_snapshot; $variant = $meta['variant_name'] ?? $meta['variant_label'] ?? null; $sku = $meta['variant_sku'] ?? $meta['sku'] ?? null; @endphp @endforeach
Product Qty Original Sale Final Discount Tax Line Total
@if($item->parent_order_item_id) @endif {{ $productName }}
@if($variant)
Variant : {{ $variant }}
@endif @if($sku)
SKU : {{ $sku }}
@endif
{{ $item->quantity }} {{ format_currency($item->original_price) }} @if($item->sale_price) {{ format_currency($item->sale_price) }} @else - @endif {{ format_currency($item->final_price) }} @if($item->discount_amount>0) - {{ format_currency($item->discount_amount) }} @else - @endif @if($item->tax_amount>0) + {{ format_currency($item->tax_amount) }} @else - @endif {{ format_currency( $item->line_total - $item->discount_amount + $item->tax_amount ) }}
{{-- ORDER SUMMARY + NOTES --}}
Notes
Customer Notes
{!! nl2br(e($order->customer_notes ?: 'No customer notes available.')) !!}
Order Notes
{!! nl2br(e($order->order_notes ?: 'No order notes available.')) !!}
Order Summary
Subtotal {{ format_currency($order->subtotal_amount) }}
Discount - {{ format_currency($order->discount_amount) }}
Tax + {{ format_currency($order->tax_amount) }}

Grand Total {{ format_currency($order->total_amount) }}
{{-- Order Timeline --}}
Order Timeline
Order Created
{{ $order->created_at?->format('d M Y h:i A') }}
@if($order->payment_status=='paid')
Payment Successful
{{ optional($order->payments->last())->created_at?->format('d M Y h:i A') }}
@endif @if($order->invoice)
Invoice Generated
{{ $order->invoice?->issued_at?->format('d M Y h:i A') }}
@endif
@push('styles') @endpush