@extends('layouts.app') @section('title', 'B2B Order — '.$order->order_number) @section('content')

Order {{ $order->order_number ?? '#'.$order->id }} {{ strtoupper($order->status) }}

@if(session('status'))
{{ session('status') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

Line items

Fulfilled from location #{{ $order->location_id }} @if($order->transaction_id) · Invoice PDF @endif
@foreach(($order->cart_snapshot ?? []) as $line) @endforeach @if($order->discount_total > 0) @endif
ItemQtyUnitSubtotal
{{ $line['name'] ?? '—' }} {{ $line['sub_sku'] ?? '' }} {{ $line['quantity'] ?? 0 }} {{ config('constants.currency_symbol','₹') }}{{ number_format($line['unit_price'] ?? 0, 2) }} {{ config('constants.currency_symbol','₹') }}{{ number_format($line['subtotal'] ?? 0, 2) }}
Subtotal{{ config('constants.currency_symbol','₹') }}{{ number_format($order->subtotal, 2) }}
Discount−{{ config('constants.currency_symbol','₹') }}{{ number_format($order->discount_total, 2) }}
Tax{{ config('constants.currency_symbol','₹') }}{{ number_format($order->tax_total, 2) }}
Shipping{{ config('constants.currency_symbol','₹') }}{{ number_format($order->shipping_total, 2) }}
Total{{ config('constants.currency_symbol','₹') }}{{ number_format($order->grand_total, 2) }}
@if($siblings->isNotEmpty())

Sibling shipments (same buyer order)

    @foreach($siblings as $sib)
  • {{ $sib->order_number ?? '#'.$sib->id }} · location #{{ $sib->location_id }} · {{ strtoupper($sib->status) }} · {{ config('constants.currency_symbol','₹') }}{{ number_format($sib->grand_total, 2) }}
  • @endforeach
@endif

Customer

{{ optional($order->customer)->name ?? '—' }} @if(optional($order->customer)->business_name)
{{ $order->customer->business_name }} @endif

{{ optional($order->customer)->phone }}

@if(optional($order->customer)->email)

{{ $order->customer->email }}

@endif @if(optional($order->customer)->gstin)

GSTIN: {{ $order->customer->gstin }}

@endif

Shipping address

@php $addr = is_array($order->shipping_address) ? $order->shipping_address : (json_decode($order->shipping_address ?? '{}', true) ?: []); @endphp
{{ $addr['name'] ?? '' }}
{{ $addr['line1'] ?? '' }}
@if(!empty($addr['line2'])){{ $addr['line2'] }}
@endif {{ $addr['city'] ?? '' }}, {{ $addr['state'] ?? '' }} {{ $addr['pincode'] ?? '' }}
{{ $addr['phone'] ?? '' }}

Payment

@if($order->payment_verified_at) Verified {{ $order->payment_verified_at->diffForHumans() }} @endif

Method: {{ strtoupper($order->payment_method_used) }}

@if($order->transaction)

POS payment status: {{ strtoupper($order->transaction->payment_status) }}

@endif @if($order->upi_utr)

UTR: {{ $order->upi_utr }}

@endif {{-- Customer-uploaded payment proof --}} @if($order->payment_proof_path) @php $proofUrl = asset('storage/'.$order->payment_proof_path); $isPdf = str_ends_with(strtolower($order->payment_proof_path), '.pdf'); @endphp
Payment proof uploaded by customer
@if($isPdf) Open PDF proof @else Open full size @endif
@else @if($order->payment_method_used === 'upi')

Customer hasn't uploaded a payment screenshot yet.

@endif @endif {{-- Verify switch: only meaningful for UPI + still pending --}} @if($order->payment_method_used === 'upi' && $order->status === 'pending' && ! $order->payment_verified_at)
@csrf
@endif
@if(!empty($allowed))

Status

@foreach($allowed as $next)
@csrf
@endforeach
@endif
@endsection