@php $stopType = $stopType ?? 'shipper'; $index = $index ?? 1; $stop = $stop ?? null; $title = $stopType === 'shipper' ? 'Shipper' : 'Consignee'; $notesLabel = $stopType === 'shipper' ? 'Shipping Notes' : 'Delivery Notes'; $lookup = $stopType; $modalId = $stopType === 'shipper' ? 'addShipperModal' : 'addConsigneeModal'; $customsEntry = $customsEntry ?? null; $showCustomsBroker = $stopType === 'shipper' && (int) $index === 1; $scheduledAt = isset($stop->scheduled_at) ? \Illuminate\Support\Carbon::parse($stop->scheduled_at) : null; $showTime = (bool) ($stop->show_time ?? true); $selectedTime = ''; if ($showTime && $scheduledAt) { $minutes = ((int) $scheduledAt->format('H') * 60) + (int) $scheduledAt->format('i'); $roundedMinutes = (int) (round($minutes / 15) * 15); $selectedTime = sprintf('%02d:%02d', intdiv($roundedMinutes, 60) % 24, $roundedMinutes % 60); } $timeOptions = []; for ($hour = 0; $hour < 24; $hour++) { foreach ([0, 15, 30, 45] as $minute) { $timeOptions[] = sprintf('%02d:%02d', $hour, $minute); } } @endphp
@if($showCustomsBroker)
@endif