Rule 1: Product Type Minimum Transit Override
Interpretation => If product type is 3 → minimum transit time must be at least 1 day.
Condition:
KeyIndexProductType == "3"Example =>
if (KeyIndexProductType == "3")
{
Session[this.OrderNumber + facilityCode + "MinTransitDays"] = 1;
}
Rule 2: Shipping Date Edit RestrictionInterpretation => If the delivery date is today or in the past → the user cannot modify the shipping date.
Condition:
Today ≥ Delivery Date
Rule 3: Minimum Shipping Date (MinDate) – With Transit DaysInterpretation => If transit days are defined → shipping must occur early enough to meet delivery.
Condition:
facilityCode is not empty
AND Session[TransitDays] exists
AND Session[TransitDays] != "0"
Example => MinDate = DeliveryDate - TransitDays
Rule 4: MinDate Adjustment Based on Selected Shipping DateInterpretation => If the selected shipping date is earlier than allowed → adjust MinDate to maintain consistency.
Condition:
Shipping Date is already selected
AND Selected Shipping Date < Calculated MinDate
Example =>
days = MinDate - SelectedShippingDate
If (days > 0)
MinDate = MinDate - days
Else
MinDate = MinDate
Rule 5: Minimum Shipping Date (MinDate) – Default
Condition:
TransitDays not availableInterpretation:
If no transit days are defined → shipping cannot be in the past.
System Behavior:
MinDate = TodayRule 6: Maximum Shipping Date (MaxDate) – With Minimum Transit Days
Condition:
facilityCode is not empty
AND Session[MinTransitDays] exists
AND Session[MinTransitDays] != "0"Interpretation:
Shipping must occur early enough to satisfy minimum transit time before delivery.
System Behavior:
CandidateMaxDate = DeliveryDate - MinTransitDays
If (MinDate ≥ CandidateMaxDate)
MaxDate = MinDate
Else
MaxDate = CandidateMaxDateRule 7: Maximum Shipping Date (MaxDate) – Default
Condition:
MinTransitDays not availableInterpretation:
If no minimum transit restriction exists → shipping can be scheduled up to delivery date.
System Behavior:
MaxDate = DeliveryDateRule 8: Shipping Date Enablement Based on Override
Condition:
_isShippingOverride == trueInterpretation:
Shipping date can only be edited if override is allowed.
System Behavior:
_wtbShippingDate.Enabled = trueElse:
_wtbShippingDate.Enabled = falseFinal Consolidated Rule
Interpretation:
Shipping date must always fall within the allowed range and respect delivery and transit constraints.
System Behavior:
MinDate ≤ Shipping Date ≤ MaxDate