Individual earnings types can be calculated through formulas.
Formulas are a special type of entries to the field. Formulas are used when a value in a field should be calculated from specified parameters, eliminating the need to do so manually. This is especially useful in financial reports, prices, payroll, etc.
In short, where the result is variable and can be calculated from specified parameters.
Available are following operators:
+ (plus) addition
- (minus) deduction
* (asterisk) multiplication
/ (slash) division
> greater than (used in conditional statements)
< less than (used in conditional statements)
= is equal to (used in conditional statements)
 |
Available are two additional operators which can only be used for the calculation of the
length of service bonus:
-
\ - (backslash) inter division
-
| - (pipe) remainder of integer division
|
Operands can be constants (plain numbers) or any or any variables of the program. If the operant is a constant, you can simply enter the appropriate constant. Variable of the program can be used by placing them between hashes (#).
Example:
Correct
| Incorrect
|
-
| 3h
|
0,75
| 75%
|
#PRZnesek#, #prznesek#, #PRZNESEK#
| PRZnesek, PRZnesek#
|
Variables that can be used in formulas depend on where the formula is used. For example, formulas for calculating prices can contain only variables that are related to prices. Available variables for specific formulas are explained in the related topics.
The basic syntax is simple:
Operand Operator Operand
To define the precedence of operations you can use round brackets.
Formulas are calculated from the left to the right.
In the payroll you can also use conditional statements (although, there is rarely the need for it).
Conditional statements can have any number of levels.
Formulas can contain conditional statements with the basic syntax 'if A is true, then B'. Such statements are enclosed in square brackets.
[Condition:Value] if Condition is true, the Value is returned.
Conditional statements can be grouped, the formula has:
[Condition1:Value1] [Condition2:Value2] [Condition3:Value3] Value4
The above formula would be parsed as follows:
if condition1 is true, the result is value1, else
if condition2 is true, the result is value2, else
if condition3 is true, the result is value3, else
the result is value4 (if none of the above are true).