@extends('layouts.app') @section('content')

Shipment Management

Manage orders, track shipments, and process bulk shipping

Order Tracking

Track shipments by entering an order number

@csrf
Bulk Shipping

Upload CSV file to process multiple shipments

@csrf
Latest Shipments
{{ $shipments->total() }} Total
@forelse($shipments as $shipment) @php // Get first order item to access order info $firstItemRef = DB::table('orders_items_shipments') ->where('shipment_id', $shipment->shipment_id) ->first(); if (!$firstItemRef) continue; $orderItem = DB::table('orders_items') ->where('order_item_id', $firstItemRef->order_item_id) ->first(); if (!$orderItem) continue; $order = DB::table('orders') ->where('order_id', $orderItem->order_id) ->first(); if (!$order) continue; $tracking_number = $shipment->tracking_number ?: 'N/A'; $date_shipped = $shipment->date_shipped ? \Carbon\Carbon::parse($shipment->date_shipped)->format('M j, g:i a') : 'N/A'; // Determine shipment status $status = 'pending'; $statusClass = 'bg-secondary'; $statusText = 'Pending'; if ($shipment->date_delivery) { $status = 'delivered'; $statusClass = 'bg-success'; $statusText = 'Delivered'; } elseif ($shipment->date_shipped) { $status = 'shipped'; $statusClass = 'bg-info'; $statusText = 'Shipped'; } elseif ($shipment->tracking_number) { $status = 'label_created'; $statusClass = 'bg-warning'; $statusText = 'Label Created'; } @endphp @empty @endforelse
Order / Shipment Customer Shipping Address Carrier Method Warehouse Tracking # Submitted Shipped Actions
{{ $order->external_order_id }} #{{ $shipment->external_shipment_id ?: $shipment->shipment_id }}
{{ !empty($order->shipping_company) ? $order->shipping_company : $order->shipping_name }}
@if(!empty($order->shipping_email)) {{ $order->shipping_email }} @endif
{{ $order->shipping_street_address }}
{{ $order->shipping_city }}, {{ $order->shipping_state }} {{ $order->shipping_zip }}
{{ $order->shipping_country }}
@if($shipment->carrier) {{ strtoupper($shipment->carrier) }} @else - @endif {{ $shipment->shipment_method ?: '-' }} {{ $shipment->warehouse_id }} @if($tracking_number !== 'N/A')
{{ $tracking_number }} {{ $statusText }}
@else {{ $tracking_number }} @endif
{{ \Carbon\Carbon::parse($shipment->date_submitted)->format('M j, g:i a') }} {{ $date_shipped }}
@if($shipment->tracking_number && $shipment->carrier) @php $trackingUrl = '#'; $carrier = strtolower($shipment->carrier); $tracking = $shipment->tracking_number; $trackingUrls = [ 'ups' => "https://www.ups.com/track?tracknum={$tracking}", 'fedex' => "https://www.fedex.com/fedextrack/?tracknumbers={$tracking}", 'usps' => "https://tools.usps.com/go/TrackConfirmAction?tLabels={$tracking}", 'stamps_com' => "https://tools.usps.com/go/TrackConfirmAction?tLabels={$tracking}", 'dhl_express' => "https://www.dhl.com/en/express/tracking.html?AWB={$tracking}", 'amazon_shipping' => "https://track.amazon.com/tracking/{$tracking}", 'amazon_shipping_us' => "https://track.amazon.com/tracking/{$tracking}" ]; $trackingUrl = $trackingUrls[$carrier] ?? '#'; @endphp @endif @if(!$shipment->date_shipped) @endif

No shipments found

@if($shipments->hasPages()) @endif
@endsection @section('scripts') @endsection