Introduction
Contributions are a strong feature in collective agreements, which can be used for various cases. The feature can apply conditions and variables to automatically add work through simple and complex calculations. In this article, you will be able to find all possible variables with examples of how to use them.
Conditions
Binary conditions
The idea behind binary variables is that they will return 0 or 1. This is really useful in an example where we want to include or exclude something based on something being present or not. An example is that we can have a bonus for an employee if he is not sick.
Example: Give 50 in bonus if the employee has logged work and is not sick. Then we can do as follows:
Condition: hasHours
Salary: 50  (hasAbsence * 50)
With this simple example above, the employee will receive 50 IF he has hours (that is the condition). However, we will reduce the salary to 0 if he has absence. The calculation will be as follows if he has hours and absence: 50  (1 * 50) = 0.
Variables:
 hasAbsence
 hasSelfManagedAbsence
 hasAnyAbsence
 hasHours
 hasOvertime
 hasAddition
 hasTimeAddition
 hasDeduction
 hasPiecework
 hasExpenses
 hasDayPay
 hasMonthPay
Example of using binary variables for condition section: hasHours && addition_132.salary > 0
Employment conditions
Variable name  Notes 

employmentStartDate  Fetches the date of the beginning of employment. 
1monthAgo  Fetches employment condition 1 month ago. 
2monthsAgo  Fetches employment condition 2 months ago. 
3monthsAgo  Fetches employment condition 3 months ago. 
6monthsAgo  Fetches employment condition 6 months ago. 
Variables
Below is a list of the available variables that can be used to create your custom calculation for the salary and invoice you want to produce.
Salary variables
Variable name  Notes 

sumPeriodSalary  Fetches all salary values in the set period. 
sumPeriodHourSalary  Fetches all hour salary in the set period. 
sumPeriodOvertimeSalary  Fetches all overtime salary in the set period. 
sumPeriodAllHoursSalary  Fetches salary values for hours and overtime in the set period. 
sumPeriodAbsenceSalary  Fetches absence salary values in the set period. 
sumPeriodMonthPaySalary  Fetches month pay salary in the set period. 
sumPeriodDeductionSalary  Fetches deduction salary values in the set period. 
sumPeriodExpensesSalary  Fetches expenses salary values in the set period. 
Invoice variables
We've added the possibility to add and use salary variables (described above) in an invoice account formula.
Variable name  Notes 

thisSalary  Fetches salary from the contributions salary calculation. 
sumPeriodInvoice  Fetches all invoice values in the set period. 
sumPeriodHourInvoice  Fetches all hour invoice in the set period. 
sumPeriodOvertimeInvoice  Fetches all overtime invoice in the set period. 
sumPeriodAllHoursInvoice  Fetches invoice values for hours and overtime in the set period. 
sumPeriodAbsenceInvoice  Fetches absence invoice values in the set period. 
sumPeriodMonthPayInvoice  Fetches month pay invoice in the set period. 
sumPeriodDeductionInvoice  Fetches deduction invoice values in the set period. 
sumPeriodExpensesInvoice  Fetches expenses invoice values in the set period. 
companyMarkUp 
Fetches the Mark up value set in the "Salary and project data" section in the companies card. 
companyFactor 
Fetches the Factor value set in the "Salary and project data" section in the companies card. 
companyAdditionFactor  Fetches the Addition factor value set in the "Salary and project data" section in the companies card. 
projectMarkUpFactor  Fetches the Mark up factor value set in the "Salary and project data" section in the project card. 
projectAdditionFactor  Fetches the Addition factor value set in the "Salary and project data" section in the project card. 
projectMarkUp  Fetches the Mark up value set in the "Salary and project data" section in the project card. 
Common variables
Variable name  Notes 

sumContributionMargin  Fetches contribution margin value. 
sumNormalHours  Fetches number of normal hours. 
sumOvertimeHours  Fetches number of overtime hours. 
sumHours  Fetches number of hours. 
sumPiecework  Fetches number of piecework. 
sumAbsenceHours  Fetches number of absence hours. 
sumDayPay  Fetches number of day pay. 
Specific variables
Now you can add all types of items to formulas for all sections in contribution rules (Condition, Salary, Invoice).
Formula structure: {articleType}_{articleId}.{value}
Where {articleType} can be any of the following in our system:
 Hours → hours
 Absence → absence
 Addition → addition
 Deduction → deduction
 Piecework salary → piecework
 Day pay → dayPay
 Month pay → monthPay
 Overtime → overtime
 Time addition → timeAddition
 Guarantee salary → guaranteeSalary
 Performance salary → performanceSalary
 Selfmanaged absence → selfManagedAbsence
 Receipt → expenses
Article type alias: allAbsence = this will include both regular absence and selfmanaged absence.
Example: allAbsence.salary
Values we can use .{value}:
.salary  (Fetches sum all salary values in the set period for a certain article) 
.invoice  (Fetches sum all invoice values in the set period for a certain article) 
.qty  (Fetches sum all QTY values in the set period for a certain article) 
.hoursInclBreak  (Fetches sum incl. Break hours in the set period for a certain article) 
.hoursExclBreak  (Fetches sum excl. Break hours in the set period for a certain article) 
.avgUnitSalary  (Fetches average value for all “Unit salary” in the set period for a certain article) 
.avgUnitInvoice  (Fetches average value for all “Unit invoice” in the set period for a certain article) 
Example: hours_13.avgUnitSalary, expenses_15.salary etc.
Note
When applying the variables listed above to the "Condition" sections will have only the result: 1 or 0.
0  if this article is missing as logged work records,
1  if there are logged work records with this article for a certain period.
Example for "Condition" row
Example 1
hasHours && addition_132.salary > 0
This will mean: to calculate the contribution if hasHours and addition_132.salary have values >0 (if at least one of these values is 0, the condition will not be fulfilled);
Example 2
absence_15.salary < 0
This will mean: to calculate the contribution contribution if there is no entry with the value "salary" for article absence_15 for the set period.
Good to know
 Any change to log work will start the process of analysis and recalculation of contributions (but recalculation of contributions will take place only if the changes made relate to a factor that affects the pricing of the contribution).
 Calculation/recalculation of the contribution takes place within one minute after any actions to log work.
 If the contribution records are approved and the registered work is edited later during the set period, the contribution will be recalculated, but a new contribution record will be created in which the salary and invoice will be compensated according to the changes made in the logged work records.
 If the contribution records that had the status "Approved" are returned to the status "To approval", then both records will be merged into one (taking into account all changes made in logged work records).

Any changes made manually for already created contribution records will suspend their calculation/recalculation for the period in which the changes were made.
Example: If the selected period "month" in the contribution rules.
In the "Register work" module, the system automatically calculated the contribution and created a record for the current month, e.g. August. So, if you make changes to this record manually, the automatic calculation/recalculation of the contribution for the month of August will be suspended.
 In the contribution rules, the option of choosing a date for the "Month" period and a day of the week for the "Week" period has been added. This will allow you to manually choose the date or day of the week on which to create (log) a contribution record.
Note
The date or day of the week selected for the "period" line in the contribution rules answers the question "on which day," not "when" the contribution record will be created, i.e., if the date selected for the "period" section of the contribution rules is the 17th, it will mean that a record of contributions will be registered on the 17th of the current month, immediately upon creation of any logged work records for this month (provided that these records have the types of articles that are involved in the formulas added in the contribution rules).
Examples
Partial pension
Contributions can be used to calculate partial pension and be able to invoice a small premium to the customer.
 2,4% of the normal salary in the period
 0,7% of the absence salary in the period
 The customer will be invoiced a 30% premium
Salary calculation  Invoice calculation 

((sumPeriodSalary  sumPeriodAbsenceSalary) * 0.024) + (sumPeriodAbsenceSalary * 0.007)  thisSalary * 1.3 