@if(!$drop)
Loading...

Loading split drop form...

@else @if($errorMessage)
{{ $errorMessage }}
@endif @if($successMessage)
{{ $successMessage }}
@endif
@for($i = 1; $i <= $totalSteps; $i++) @endfor
{{ $this->getCurrentStepDescription() }}
@if($step === 1)
Step 1: Order Overview

Review the order quantities and existing drops.

Order Quantities
@foreach($orderQtys as $sizeId => $orderData) @php $shippedQty = $currentDropShippedQtys[$sizeId]['shipped_qty'] ?? 0; $remaining = $orderData['qty'] - $shippedQty; @endphp @endforeach
Size Order Qty Shipped Remaining
{{ $orderData['size_name'] }} {{ $orderData['qty'] }} {{ $shippedQty }} {{ $remaining }}
@if(count($existingDrops) > 1)
Existing Drops
@foreach($existingDrops as $existingDrop) @php $totalShipped = array_sum($existingDrop['shipped_quantities'] ?? []); $remaining = $existingDrop['total_pieces'] - $totalShipped; @endphp @endforeach
Drop ID ExFty Status Total Qty Total Shipped To Ship
{{ $existingDrop['id'] }} {{ $existingDrop['exfty'] ? date('d-M-y', strtotime($existingDrop['exfty'])) : '—' }} @if($existingDrop['shipped']) Shipped @else Unshipped @endif {{ $existingDrop['total_pieces'] }} {{ $totalShipped }} {{ $remaining }}
@endif
@endif @if($step === 2)
Step 2: Drop Configuration & Quantities

Configure the new drop date and set quantities.

Must be after {{ $drop->exfty ? $drop->exfty->format('d-M-Y') : 'existing drop date' }} @error("newDropDates.0")
{{ $message }}
@enderror

Set quantities for the new drop. Total quantities should equal order quantities.

@if($this->canShowTakeFromExistingCheckbox())
@endif
@foreach($existingDrops as $dropIndex => $existingDrop) @endforeach @for($i = 0; $i < $newDropCount; $i++) @endfor @foreach($orderQtys as $sizeId => $orderData) @php $existingDropsQty = 0; $existingDropsShipped = 0; foreach($existingDrops as $existingDrop) { $existingDropsQty += $existingDrop['quantities'][$sizeId] ?? 0; $existingDropsShipped += $existingDrop['shipped_quantities'][$sizeId] ?? 0; } $newDropsQty = 0; foreach($newDropQtys as $dropQtys) { $newDropsQty += $dropQtys[$sizeId]['qty'] ?? 0; } $totalAllocated = $existingDropsQty + $newDropsQty; $totalShipped = $existingDropsShipped; $remaining = $orderData['qty'] - $totalShipped; @endphp @foreach($existingDrops as $dropIndex => $existingDrop) @php $dropQty = $existingDrop['quantities'][$sizeId] ?? 0; $shippedQty = $existingDrop['shipped_quantities'][$sizeId] ?? 0; @endphp @endforeach @for($i = 0; $i < $newDropCount; $i++) @endfor @endforeach
Size Order Qty {{ $existingDrop['exfty'] ? date('d-M-y', strtotime($existingDrop['exfty'])) : 'No date' }} @if($existingDrop['shipped'])
(Shipped) @endif
{{ $newDropDates[$i] ? date('d-M-y', strtotime($newDropDates[$i])) : 'Date not set' }}Allocated Totals
{{ $orderData['size_name'] }} {{ $orderData['qty'] }} @if(!$existingDrop['shipped'] && $this->canEditExistingDrops()) Shipped: {{ $shippedQty }} @else
Due: {{ $dropQty }} @if($shippedQty > 0)
Shipped: {{ $shippedQty }} @endif
@endif
{{ $totalAllocated }}
To Ship: {{ $remaining }} Ordered: {{ $orderData['qty'] }} Shipped: {{ $totalShipped }} Drop Orders: {{ $totalAllocated }}
@endif @if($step === 3)
Step 3: Drops Overview

Review the complete drops configuration and quantities.

@foreach($overview as $sizeId => $data) @php $totalAllocated = $data['total_new_drop_qty'] + $data['existing_drops_qty']; $isBalanced = $totalAllocated == $data['order_qty']; @endphp @endforeach
Size Order Qty Shipped New Drop Qty Totals
{{ $data['size_name'] }} {{ $data['order_qty'] }} {{ $data['total_shipped'] }} {{ $data['total_new_drop_qty'] }} @if($isBalanced) Balanced @else Unbalanced @endif
@php $hasUnbalanced = false; foreach($overview as $sizeId => $data) { $totalAllocated = $data['total_new_drop_qty'] + $data['existing_drops_qty']; if ($totalAllocated != $data['order_qty']) { $hasUnbalanced = true; break; } } @endphp @if($hasUnbalanced)
Warning: Some sizes have quantities that don't balance with the order. Please review the quantities in Step 2 to ensure totals equal order quantities.
@endif
New Drop to be Created:
  • {{ $newDropDates[0] ? date('d-M-y', strtotime($newDropDates[0])) : 'Date not set' }}
      @foreach($orderQtys as $sizeId => $orderData) @php $qty = $newDropQtys[0][$sizeId]['qty'] ?? 0; @endphp @if($qty > 0)
    • {{ $orderData['size_name'] }}: {{ $qty }} units
    • @endif @endforeach
@if(!empty($existingDropChanges))
Existing Drops to be Updated:
    @foreach($existingDropChanges as $change)
  • Drop #{{ $change['id'] }} ({{ $change['exfty'] ? date('d-M-y', strtotime($change['exfty'])) : 'No date' }}):
      @foreach($change['size_changes'] as $sc)
    • {{ $sc['size_name'] }}: {{ $sc['old'] }} → {{ $sc['new'] }} (@if($sc['delta']>0)+@endif{{ $sc['delta'] }})
    • @endforeach
  • @endforeach
@endif
@endif @endif