# Number of days calculator

This calculator will charge 1 unit per calendar day that the aircraft is on the ground. Does not apply any parking assignments logic.

Note that it does not take parking assignments into account.

Example: When arriving on 01 Apr 2012 23:00 hr and departing on 02 Apr 2012 01:00 hr the calculator will calculate 2 days.

It uses Local Time for calculating the days.

###### Optional properties

FreeMinutesAfterArrival (int; default=0)
Number of minutes after arrvial that won't be charged.

ChargeFreeMinutesIfStayingLonger (bool; default=false)
Wheter or not to charge the FreeMinutesAfterArrival

AboveQuantity (int, default =0)
The total quantity minus the AboveQuantity is returned, where the quantity is the number of days (even if MultiplyByTons is true)

MultiplyByTons (bool; default=false)
Wheter to multiply the found number of time intervals by the mtow in tons of the aircraft

MultiplyRemainderAboveTons (int, default=0)
If MultiplyByTons is true, with this option the number of days parked is multiplied by the MTOW minus the MultiplyRemainderAboveTons

takeMTOWInKgFromCustomProperty (string; default not set)
Allows to configure the name of a custom property to be used instead of the actual MTOW. This can be needed if the MTOW for this calclulaton should not be the standard one, but a different one, for example to calculate airport fees for a specific airport that uses different MTOW values. Only valid if 'MultiplyByTons' is true.

ForceToBlankIfCustomPropertyIsNotSet (bool, default=true)
If true, and a custom property is used for the MTOW (see takeMTOWInKgFromCustomProperty) an error will be shown if the custom property is missing. If set to false, the standard MTOW will be used silently.

MaximumQuantity (int, default = NULL)
If set and the total quantity is higher than the maximum, the maximum quantity is returned, where the quantity is the number of days (even if MultiplyByTons is true)

The combination of the settings AboveQuantity and MaximumQuantity can be used to configure time bands.
For example 'AboveQuantity=0;MaximumQuantity=24' to return the first 24 hours and 'AboveQuantity=24;MaximumQuantity=24' for the next 24 hours.

TargetUnitBetween(string, default = 0 AND 99999)
Similar as in Quantity band from parent calculator, this setting can be used to apply a number of days to the length of the interval. This setting works only when MultiplyByTons is True and it is applied after MultiplyRemainderAboveTons is substracted from MTOW.
Eg:

Suppose you would like to charge Parking with two rates depending on the MTOW of the a/c ( first 2 tons are charged with a different price than the remaining tons).
In this case you would need two different products with different TargetUnitBetween settings:

'Parking Standard (up to 2T)' with setting TargetUnitBetween=0 AND 2;
'Parking Extra (above 2T)' with setting TargetUnitBetween=2 AND 99999;
Suppose an a/c with MTOW 10T, with a parking time of 1 day. The following parking rates will be applied:
'Parking Standard (up to 2T)' : 1x2T = 2 tondays
'Parking Extra (above 2T)' : 1x8T = 8 tondays