How to display warnings when Airport Slots fall outside of a designated window of tolerance

At some stations whereby Airport Slots are in place, there is a designated window of tolerance for arriving/departing before or after the given Airport Slot times.
It may therefore be useful to create a warning, both for FBO One users and the client, to signal when an STA/STD no longer falls within the period of slot tolerance as per the given Airport Slots.

The warnings can be setup to display in two key places:

  1. Within the Order screen of FBO One
  2. On the Handling Confirmation Email Body

To begin, the Inbound and Outbound Slot warning messages must be setup as 'Order Calculated Custom Values'
Go to Administration > Custom Values

1.Displaying the warnings within the Order screen

Use the 'Add new' button to create each of the new Custom Values.

In this example, the two custom values have been created as 'Inbound Slot Warning' and 'Outbound Slot Warning'.
The check-box 'Is visible in order screen' has been checked, enabling the warning to display also in the order screen 

Select each of the Custom Values individually by clicking on 'values'. Once selected, use the 'Add new' button, highlighted below, to open up the 'formula' field

For this example, the warning must be displayed if the Arrival time is entered as more than 15-Mins earlier or later than the Airport Slot time entered.
The below formula is used to do this. The text highlighted in red will be the warning text displayed. The text highlighted in green will display when the Airport Slot is within the tolerated period.

  

Custom Formula - Inbound
((Func<string>)(() => {
var result = "None"; // this will make the output of the template variable to be an empty text instead of '-'
var inSlotLt = (DateTime?)input.GetOrderField("AirportSlotInDateTimeLt");
if (inSlotLt.HasValue)
{
  var arrivalText = (string)input.GetTemplateValue("MostActualArrivalTimeLTOrPendingTextWithoutSlots");
  if (!string.IsNullOrEmpty(arrivalText))
  {     
     var indexOfLt = arrivalText.IndexOf("(LT)");
     if (indexOfLt > 0)
     { 
       DateTime arrivallt;     
       if (DateTime.TryParse(arrivalText.Substring(0, indexOfLt), out arrivallt))
        {
          if ((arrivallt - inSlotLt.Value).Duration().TotalMinutes > 15)
                result = "WARNING - Requested arrival time is outside the Airport Slot Tolerance +/- 15mins";
        }
     }    
  }
}
return result;
}))();

The below formula is then entered as the formula for the second custom value - 'Outbound Slot Warning'

Custom Formula - Outbound
 ((Func<string>)(() => {
var result = "None"; // this will make the output of the template variable to be an empty text instead of '-'
var outSlotLt = (DateTime?)input.GetOrderField("AirportSlotOutDateTimeLt");
if (outSlotLt.HasValue)
{
  var departureText = (string)input.GetTemplateValue("MostActualDepartureTimeLTOrPendingTextWithoutSlots");
  if (!string.IsNullOrEmpty(departureText))
  {     
     var indexOfLt = departureText.IndexOf("(LT)");
     if (indexOfLt > 0)
     { 
       DateTime departurelt;     
       if (DateTime.TryParse(departureText.Substring(0, indexOfLt), out departurelt))
        {
          if ((departurelt - outSlotLt.Value).Duration().TotalMinutes > 15)
                result = "Warning - Requested departure time is outside the available airport slot tolerance ± 15mins";
        }
     }    
  }
}
return result;
}))();

Finally, each of the custom values must be linked to the 'Order' table

To test the above setup, go to an open order, ensure the STA/STD and Airport Slots are set.
On the below order the Airport Slot is 20-mins after the STA meaning that the warning should display to indicate that the Inbound Slot is outside of the tolerated time period. The Outbound slot is only 10-mins after the STD, meaning that no warning should display.

 

The Order screen now shows the relevant warnings

2. Displaying the warnings on the Handling Confirmation Email Body

Next, the custom values should be added to the Handling confirmation email body to act as a warning to clients if and when their schedule is not in line with their current airport slots.
Go to Administration and locate the relevant setting. Depending on the FBO One setup, the setting may require updating either via 'Email Message Settings' or via 'FBO Location Settings'. It may also be either the setting  'HnConfirmationEmailBody' or 'HnConfirmationEmailBodyTextOnly' depending on which is used.

For this example, the 'Email message setting' 'HnConfirmationEmailBody' is in use and the warnings must be added to this email body which accompanies the Handling Confirmation pdf.
The setting is selected then the 'edit' button is used to make the changes 

The custom value must be added according to the name it was given when created.
It should be added in the following format after the dash ( - ) ~Custom-Inbound Slot Warning~
The outbound custom value will therefore be ~Custom-Outbound Slot Warning~

The text 'Slot Remarks:' precedes each of the custom values so that if a warning displays, it displays after 'Slot Remarks:' and if not, the mention 'None' displays.

The outgoing Handling confirmation will therefore show as follows:


Related slot pages:

Related pages: