Introduction:
This calculator defines the quantity based on the value of the custom value. This calculator is based on the value of a custom value as a decimal. For example: 'Noise factor (L)' which is calculated based upon the noise factor value of the aircraft.
The calculator can only use custom values assigned to: Order, Aircraft Registration, Aircraft Type, Debtor, FBO Location or Administration .
The result is similar to Custom Value Unit Price Calculator, however, the custom value actual value is shown in the quantity, showing the calculation more clearly. The Custom Value Quantity Calculator however, does not allow rounding of the total amount.
Required properties
CustomProperty (string)
The name of the custom property to use as the quantity source. The custom value is retrieved from the order, aircraft registration, aircraft type, or debtor. If not specified or not applicable to the FBO location, an error is thrown. The custom property must be applicable to the FBO location of the order line's product data.
example: CustomProperty=Noise factor (L);
Optional properties
-
RoundingMethod (string)
Indicates the type of the rounding to be applied to the quantity from a decimal custom value. For example Floor. If not specified, the default is Floor.
example: RoundingMethod=Floor -
MultiplyByFuelQuantity (bool)
If true, multiplies the custom value by the fuel quantity (in SKU units) from the associated stock mutation. If no stock mutation exists, the quantity becomes 0. The result is stored in order line quantity in SKU units and converted to invoice quantity units by the order calculator based on the customer contract.
Example: If the custom value is 0.05 and the fuel quantity is 1000 liters, the calculated quantity would be 50 (0.05 × 1000). -
MultiplyByConstant (int) (default = 1)
A constant multiplier applied to the custom value (and fuel quantity if MultiplyByFuelQuantity is true). Use this to scale the custom value.
Example: If the custom value is 100 and you set MultiplyByConstant=0.01, the quantity becomes 1.0 (100 × 0.01). This is useful for converting units, such as cents to dollars.
Example
Scenario 2: With fuel quantity multiplier
- Settings: MultiplyByFuelQuantity=true, MultiplyByConstant=1.0
- Custom value: 0.05
- Fuel quantity: 1000 liters
- Calculation: 0.05 × 1000 = 50
- Result: Quantity = 50
Scenario 3: With constant multiplier
- Settings: MultiplyByFuelQuantity=false, MultiplyByConstant=0.01
- Custom value: 100 (stored as cents)
- Calculation: 100 × 0.01 = 1.0
- Result: Quantity = 1.0 (converted to dollars)
Scenario 4: Combined multipliers
- Settings: MultiplyByFuelQuantity=true, MultiplyByConstant=0.001
- Custom value: 5.0
- Fuel quantity: 2000 liters
- Calculation: 5.0 × 2000 × 0.001 = 10.0
- Result: Quantity = 10.0
Notes
- If the custom value is missing or invalid, the quantity is set to 1 (arbitrary) and the unit price is set to null, which displays "awaiting price" in the UI.
- A validation warning is added to the order if the custom value is not defined, explaining that it should be assigned to the registration, aircraft type, or debtor.
- The calculation order is: custom value → rounding → multiply by fuel quantity (if enabled) → multiply by constant.
Comments
0 comments
Please sign in to leave a comment.