Docs

# Calculations

Calculations can be used on Forms, in Transformations and in Templates

## General operators you can use

&& And
|| Or
== Equals
!= Does not equal
>, >=, <, <=
concat("text") paste the text which is in brackets concat("Invoice")

## Forms

To make fields visible
To calculate fields

## Transformations

To add information from one form to another when it meets a condition (eg. add an invoice line for a subscription when that subscription does not have an cancel date)

if cs3=='VPS' then concat(" SLA: ", cg7, ", CPU: ", cs1, ", RAM: ", ms0, "GB", ", HDD: ", ds0, "GB")
In this example everything between brackets will be entered into the field when the field cs3 had the value "VPS".

To do calculations on fields (eg. add VAT to a price to calculate a total)
so0+so1+so7+so2+so3+so4 - in this example a number of fields are added up to give a total

To concatenate two fields into one in another form
concat(fb0," ",lb0)
In this example two fields will be combined with a space in between

Calculations can be very simple or very complex In this example you calculate if the product was

• Activated between the start and end date of your transformation run (prorate amount is calculated).
• Cancelled between the start and end date of your transformation run. (protata amount is calculated)
• Cancel date was before start date of run (the product will not be billed because it was cancelled before the run)
• Activation date was after the end date of the run (product will not be billed because the activation date is in the future, after the end date of the run)

If the Activation date (aa0) is between the start date and the end date (entered when you run the transformation) then take (the end date - the activation date) devide that by (the end date - start date) and multiply that with the price

Activation was on 15 April
You run the transformation for april (1 april - 30 april)
First part of the statement is true so then the second part will be calculated
((30 april - 15 april) = 15 days / (30 april - 1 april) = 29 days) = 0,52 * (€35) = €18,10

In the second step the same is done with a cancel date in the future

### Templates

To add information from a field when it meets a condition (eg. print the information when a cancel date is empty)
To do calculations on fields (eg. add VAT to a price to calculate a total)
To concatenate two fields into one