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

Order Details

Order Code:

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

Order Date:

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

Vendor Name:

{{ $order->user->first_name . ' ' . $order->user->last_name ?? '-' }}

Total Products:

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

Phone Number:

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

Total Price:

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

Email:

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

Payment method:

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

Vendor Invoice Number:

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

Vendor Invoice Document:

@if($order->vendor_invoice_document) View Document @else - @endif

Billing Address:

@if ($BillingAddress) {{ $BillingAddress->address }}, {{ $BillingAddress->city_name }}, {{ $BillingAddress->state_name }}, {{ $BillingAddress->country_name }} - {{ $BillingAddress->zip_code }} @else - @endif

Payment Status:

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

@php $shippingData = $order->shipping_address ? json_decode($order->shipping_address, true) : null; @endphp

Shipping Address:

@if ($ShippingAddress) {{ $ShippingAddress->address }}, {{ $ShippingAddress->city_name }}, {{ $ShippingAddress->state_name }}, {{ $ShippingAddress->country_name }} - {{ $ShippingAddress->zip_code }} @else - @endif

Remarks:

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

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

Terms & Conditions:

@if($terms->isNotEmpty()) @foreach($terms as $index => $term) @if($term->description)

{!! $term->description !!}

@endif @endforeach @else

-

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

Status

Product Detail

@if (($order->orderProducts ?? collect())->isNotEmpty())
@php $rowIndex = 1; @endphp @foreach ($orderProducts as $product) @endforeach
# Name Qty Price Amount
{{ $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) }}
@else

No related products found.

@endif