@extends('layouts.app') @section('title', 'Edit Shipment') @push('styles') @include('wuser.shipments.partials.receive-form-styles') @endpush @section('content') @php $selectedSuite = old('suite_number', $shipment->suite_number); $oldItems = old('items'); if (!is_array($oldItems) || count($oldItems) === 0) { if ($shipment->items && $shipment->items->count() > 0) { $oldItems = []; foreach ($shipment->items as $savedItem) { $oldItems[] = [ 'item_name' => $savedItem->item_name, 'item_description' => $savedItem->item_description, ]; } } else { $oldItems = [[ 'item_name' => $shipment->item_name, 'item_description' => $shipment->item_description, ]]; } } $storedFigures = $shipment->shippingFigures(); $savedNotax = old('notax_shipping_amount', $storedFigures['notax']); $savedGst = old('gst_amount', $storedFigures['gst']); $savedShippingTotal = old('shipping_amount', $storedFigures['shipping']); $savedNotaxValue = ($savedNotax === null || $savedNotax === '') ? null : (float) $savedNotax; $savedGstValue = ($savedGst === null || $savedGst === '') ? null : (float) $savedGst; $savedShippingValue = ($savedShippingTotal === null || $savedShippingTotal === '') ? null : (float) $savedShippingTotal; $selectedDestination = old('port_of_destination', $shipment->port_of_destination ?: 'male'); $selectedCargo = old('cargo_type', $shipment->cargo_type ?: 'ecommerce'); $openPhotos = $shipment->photos && $shipment->photos->count() > 0; if (!$openPhotos && $errors->any()) { foreach ($errors->keys() as $errorKey) { if (strpos((string) $errorKey, 'photos') === 0) { $openPhotos = true; break; } } } @endphp
Update {{ $shipment->tracking_number ?: 'this package' }}.