diff --git a/src/components/orders/OrderDetailPanel.jsx b/src/components/orders/OrderDetailPanel.jsx index 3eec303..5a2bf17 100644 --- a/src/components/orders/OrderDetailPanel.jsx +++ b/src/components/orders/OrderDetailPanel.jsx @@ -1197,7 +1197,11 @@ export const OrderDetailPanel = ({ return statusOptions.map((statusOption) => { const isSelected = pendingStatus?.value === statusOption.value; const isMismatch = statusOption.mismatch; - const blockedBySchedule = statusOption.requiresSchedule && !hasDeliverySchedule; + const hasDeliveryDate = !!(order?.deliveryDate || order?.customerDate); + const hasDeliverySchedule = hasDeliveryDate && !!(order?.deliveryTime || order?.deliveryHalfDay || order?.delivery_time); + const canSkipHalfDay = ["logistician", "admin", "mega_admin", "manager"].includes(userRole); + const scheduleReady = canSkipHalfDay ? hasDeliveryDate : hasDeliverySchedule; + const blockedBySchedule = statusOption.requiresSchedule && !scheduleReady; return (