Tracking Order No - {{ $order->code ?? 'N/A' }}
@php $status = (string) $order->status; $statusSteps = [ 'pending' => 1, 'confirmed' => 2, 'picked_up' => 3, 'on_the_way' => 4, 'delivered' => 5, ]; $currentStep = $statusSteps[$status ?? 'pending'] ?? 0; // Step titles and icons $stepDetails = [ ['title' => 'Pending Order', 'icon' => 'mdi-cart'], ['title' => 'Confirmed Order', 'icon' => 'mdi-repeat'], ['title' => 'Picked Up Order', 'icon' => 'mdi-gift'], ['title' => 'On The Way Order', 'icon' => 'mdi-truck-delivery'], ['title' => 'Order Delivered', 'icon' => 'mdi-hail'], ]; $IsCashSale = $order->user_id == 104; @endphp
@foreach ($stepDetails as $index => $step)

{{ $step['title'] }}

@endforeach
{{-- Left Side: Purchase Order + Vendor Details --}}

Order Details

{{-- ORDER INFORMATION --}}

Order Code:

{{ $order->code ?? '-' }}

Order Date:

{{ $order->created_at ? \Carbon\Carbon::parse($order->created_at)->format('d-m-Y') : 'N/A' }}

{{-- CUSTOMER INFORMATION --}}

Customer Name:

@if ($IsCashSale)

Cash Sale

@else

{{ $order->user->name ?? '-' }}

@endif

Phone Number:

@if ($IsCashSale)

-

@else

{{ $order->user->phone ?? '-' }}

@endif

Email:

@if ($IsCashSale)

-

@else

{{ $order->user->email ?? '-' }}

@endif

Total Products:

{{ $order->orderProducts->count() ?? 0 }}

{{-- COMPANY INFORMATION --}}

Company Name:

@if ($IsCashSale)

-

@else

{{ $order->user->company_name ?? '-' }}

@endif

Company Phone:

@if ($IsCashSale)

-

@else

{{ $order->user->company_phone_no ?? '-' }}

@endif

Company Email:

@if ($IsCashSale)

-

@else

{{ $order->user->company_email ?? '-' }}

@endif

Company Address:

@if ($IsCashSale)

-

@else

{{ $order->user->company_address ?? '-' }}

@endif
{{-- BILLING ADDRESS --}} @if (!$IsCashSale)

Billing Address:

@if($finalBilling) {{ $finalBilling->address }} {{ $finalBilling->city ? ', ' . $finalBilling->city : '' }} {{ $finalBilling->state ? ', ' . $finalBilling->state : '' }} {{ $finalBilling->country ? ', ' . $finalBilling->country : '' }} {{ $finalBilling->zip ? ' - ' . $finalBilling->zip : '' }} @else - @endif

Payment Status:

{{ $order->payment_status ?? '-' }}

{{-- SHIPPING ADDRESS --}}

Shipping Address:

@if($finalShipping) {{ $finalShipping->address }} {{ $finalShipping->city ? ', ' . $finalShipping->city : '' }} {{ $finalShipping->state ? ', ' . $finalShipping->state : '' }} {{ $finalShipping->country ? ', ' . $finalShipping->country : '' }} {{ $finalShipping->zip ? ' - ' . $finalShipping->zip : '' }} @else - @endif

Payment Method:

{{ ucwords(str_replace('_', ' ', $order->payment_method ?? 'N/A')) }}

@endif {{-- PRICE & TAX DETAILS --}}

Tax Amount:

{{ number_format($order->tax_amount ?? 0, 2) }}

Total Price:

{{ number_format($order->sub_total ?? 0, 2) }}

{{-- REMARKS & PROOF --}}

Remarks:

{{ $order->description ?? '-' }}

Payment Proof:

@if ($order->proof_file)

{{ $order->proof_file }}

@else

-

@endif
{{-- TERMS --}} @php $termIds = $order->terms_conditions ? json_decode($order->terms_conditions, true) : []; $terms = $termIds ? \App\Models\EcTermCondition::whereIn('id', $termIds)->get() : collect(); @endphp

Terms & Conditions:

@forelse($terms as $term)

{!! $term->description !!}

@empty

-

@endforelse
{{-- Right Side: Status Dropdowns --}}

Status

Product Detail

@if (($order->orderProducts ?? collect())->isNotEmpty())
{{--
entries
--}}
{{-- --}} @php $rowIndex = 1; @endphp @foreach ($orderProducts as $product) {{-- --}} @endforeach
# Name Qty Price AmountAction
{{ $rowIndex++ }}
{{ $product->product_name ?? '-' }}
Category: {{ $product->product->categories->first()->name ?? '-' }} | SKU: {{ $product->product->sku ?? '-' }} | Price: ${{ number_format($product->price, 2) }}
{{ $product->qty ?? 0 }} {{ number_format($product->price, 2) }} {{ number_format($product->amount, 2) }}
{{--

Showing 1 to {{ ($order->orderProducts ?? collect())->count() }} of {{ ($order->orderProducts ?? collect())->count() }} entries

@if (isset($orderProducts) && method_exists($orderProducts, 'appends')) {{ $orderProducts->appends(request()->except('page'))->links() }} @endif
--}}
@else

No related products found.

@endif