Please Note: This page is for reference purposes only. Due to the nature of this functionality, it's use is restricted to the FBO One team. Should you require assistance with this functionality please create a new support request detailing your exact requirements.
Introduction
Price calculations in FBO One are typically using a combination of product price agreements and price calculators whereby the unit price is driven by the price agreement and the quantity by the price calculator.
Unit price formulas are used to inject extra code into FBO One with the aim of allowing background calculations of a unit price. This is very useful for complex calculations such as Aircraft Nox Emission charges or Terminal Navigation charges.
A very basic example would be to simply multiple the unit price by the aircraft footprint
input.UnitPrice * input.FootprintInM2
and a more complex scenario would be the MTOWTons divided by 50 over the power of 0.7.
((Func<decimal?>)(() => {
decimal? result = null;
if (input.UnitPrice.HasValue && input.MtowInKg.HasValue)
{
int mtowTons = Convert.ToInt32(Math.Floor((input.MtowInKg.Value / 1000M)));
result = input.UnitPrice * (decimal)Math.Pow((double)mtowTons/50, 0.7);
result = Math.Floor(result.Value);
}
return (decimal?)result;
}))();
Formula specifications
The system is able to process formulas containing the following optional input values along with numerical values.
-
input.CustomValue: Use a custom value assigned to either an order, a/c registration, a/c type, debtor, or form of payment.
-
input.UnitPrice: a unit price specified in price agreements or a manually entered unit price.
-
input.MtowInKg / input.MtowInPounds: when available, the maximum take-off weight of the aircraft is expressed in kilograms or pounds.
-
input.FootprintInM2 / input.FootprintInSqFt: when available, the aircraft footprint is in meters square or square feet.
Syntax
Formulas supported are written in C# programming language syntax. Supported functions are listed here.
An incorrect syntax will trigger an on-screen error highlighting the issue. Errors may be displayed if one of the input parameters is missing. For example, if a price agreement unit price is not available.
To prevent this, you need to write a more complex formula syntax:
((Func<decimal?>)(() => { // always use this type of declaration decimal? result = null; // always set a default return value if (input.CustomValue.HasValue && input.UnitPrice.HasValue) // the formula is applied only when both input parameters have a value { result = (input.CustomValue.Value * input.UnitPrice.Value); // the actual formula where the return value is set } return (decimal?)result; // return of the value: this will show the result of the calculation or a '?' in the order screen, indicating that something is missing (price agreement unit price or the custom value) }))(); // always end the formula like this
Frequently used formulas
Unit price multiplied by the aircraft footprint m².
input.UnitPrice * input.FootprintInM2
Unit price multiplied per 45m²of the aircraft footprint.
Unit price multiplied by the MTOW in tons (rounded up) e.g 22,001Kg = 23 Tons
Unit price multiplied by the MTOW in tons (rounded to the nearest) and then subtract 1 ton e.g. 22,001Kg = 22 Tons
Unit price multiplied by each 1,000Lbs of the MTOW
((Func<decimal?>)(() => {
decimal? result = null;
if (input.UnitPrice.HasValue && input.MtowInPounds.HasValue)
{
var mtowLbs = (decimal)input.MtowInPounds / 1000;
var mtowLbsRounded = Math.Ceiling(mtowLbs * 100) / 100;
result = input.UnitPrice * mtowLbsRounded;
}
return (decimal?)result;
}))();
Unit price, multiplied by custom value 'emission' and the MTOW in tonnes
Unit price multiplied by the intial 6 tons of the MTOW.
Unit price multiplied by the MTOW ton range of ton 7 to 20.
Terminal Navigation Charges (TNC) e.g. unit rate * (MTOWTons/50)^0.7
Comments
0 comments
Please sign in to leave a comment.