@extends('layouts.admin.master') @section('head') @section('title') Bargain Book Hut Sucess Order Summary @endsection @endsection @section('body')
@include('UI.error')

Retail Success Order Summary

Capture package weight and hand orders to the courier once they're packed.

No retail orders match this view yet.

@if(isset($orderdetail)) @foreach($orderdetail as $orderval) {{-- Tracking: one line per shipment (each order_r row is one shipment) --}} @endforeach
Order no Name Telephone Order amount Order date Order status Delivery / weight Send delivery mail Tracking
{{$orderval->order_id}}-R {{$orderval->firstname}} {{$orderval->lastname}} {{$orderval->telephone}} ₹{{$orderval->total}} 01-01-1970 @if($orderval->orderR && $orderval->orderR->orderstatus_m) {{ $orderval->orderR->orderstatus_m }} @else — @endif
@if($orderval->orderR && $orderval->orderR->orderstatus_m) {{ $orderval->orderR->orderstatus_m }} @endif {{-- Shown only when the order is Partial Pending --}} @if($orderval->orderR && $orderval->orderR->orderstatus_m === 'PartialPending') @endif
@if($orderval->diffcour != "") @else @endif @php $ships = $orderval->shipmentsR ?? collect([$orderval->orderR])->filter(); // falls back to the single orderR row if the shipmentsR relation is missing $orderStatus = optional($orderval->orderR)->orderstatus_m; $hasFailed = $ships->contains('status', 'creation_failed'); @endphp @if(in_array($orderStatus, ['Complete', 'PartialPending'])) @foreach($ships as $s)
#{{ $loop->iteration }} @if($s->status === 'creation_failed') Failed: {{ $s->error_message }} @elseif($s->status || $s->ekart_tracking_id) @if(!empty($s->tracking_url)) {{ $s->ekart_tracking_id ?: $s->status }} @else {{ $s->ekart_tracking_id ?: $s->status }} @endif @if($s->status) {{ $s->status }} @endif @else @endif
@endforeach @else — @endif {{-- Create a shipment for the titles still waiting (or retry a failed one) --}} @if($orderStatus === 'PartialPending' || ($orderStatus === 'Complete' && $hasFailed))
@endif
@endif
@if(isset($orderdetail))
{!! $orderdetail->links() !!}
@endif
{{-- Pending titles modal --}} {{-- New shipment modal --}} @section('script') @endsection @endsection