In this article, you will find a list of the available variables that can be used to create your custom calculation for the salary and invoice you want to produce. The contributions feature is described in this article.

### Salary variables

Variable name | Notes |
---|---|

all.salary or sumPeriodSalary | Fetches all Salary values in the set period. |

hours.salary or sumPeriodHourSalary | Fetches all Hour salary in the set period. |

overtime.salary or sumPeriodOvertimeSalary | Fetches all Overtime salary in the set period. |

allHours.salary or sumPeriodAllHoursSalary | Fetches Salary values for Hours and Overtime in the set period. |

allAbsence.salary | Fetches all (Self-managed Absence + Absence) absence salary values in the set period. |

absence.salary or sumPeriodAbsenceSalary | Fetches all Absence salary values in the set period. |

selfManagedAbsence.salary | Fetches all Self-managed Absence salary values in the set period. |

expenses.salary or sumPeriodExpensesSalary | Fetches Expenses salary values in the set period. |

monthPay.salary | Fetches Monthly pay salary in the set period. |

deduction.salary or sumPeriodDeductionSalary | Fetches Deduction salary values in the set period. |

addition.salary | Fetches all Addition salary values in the set period. |

timeAddition.salary | Fetches all Time Addition salary in the set period. |

dayPay.salary | Fetches all Day Pay salary values in the set period. |

piecework.salary | Fetches all Piecework salary values in the set period. |

guaranteeSalary.salary | Fetches all Guarantee salary in the set period. |

performanceSalary.salary | Fetches all Performance 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. |

all.invoice or sumPeriodInvoice | Fetches all Invoice values in the set period. |

hours.invoice or sumPeriodHourInvoice | Fetches all Hour invoices in the set period. |

overtime.invoice or sumPeriodOvertimeInvoice | Fetches all Overtime invoices in the set period. |

allHours.invoice or sumPeriodAllHoursInvoice | Fetches all invoice values for Hours and Overtime in the set period. |

allAbsence.invoice | Fetches all (Self-managed Absence + Absence) Absence invoice values in the set period. |

absence.invoice or sumPeriodAbsenceInvoice | Fetches Absence invoice values in the set period. |

selfManagedAbsence.invoice | Fetches all Self-managed Absence invoice values in the set period. |

expenses.invoice or sumPeriodExpensesInvoice | Fetches all Expenses invoice values in the set period. |

monthPay.invoice | Fetches Monthly pay invoices in the set period. |

deduction.invoice or sumPeriodDeductionInvoice | Fetches Deduction invoice values in the set period. |

addition.invoice | Fetches all Addition invoices values in the set period. |

timeAddition.invoice | Fetches all Time Addition invoices in the set period. |

dayPay.invoice | Fetches all Day Pay invoice values in the set period. |

piecework.invoice | Fetches all Piecework invoices values in the set period. |

guaranteeSalary.invoice | Fetches all Guarantee salary invoices in the set period. |

performanceSalary.invoice | Fetches all Performance salary invoices in the set period. |

companyMarkUp |
Fetches the Mark up value set in the "Salary and project data" section in the company card. |

companyFactor |
Fetches the Factor value set in the "Salary and project data" section in the company card. |

companyAdditionFactor | Fetches the Addition factor value set in the "Salary and project data" section in the company 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
- Self-managed absence → selfManagedAbsence
- Receipt → expenses

**Article type alias:** allAbsence = this will include both regular absence and self-managed 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.

### Jobs variables

#### Structure: job{article type}Article_{id}.salary|invoice

jobAdditionArticle_{id}.salary|invoice

jobDeductionArticle_{id}.salary|invoice

jobAbsenceArticle_{id}.salary|invoice

jobSalaryArticle_{id}.salary|invoice

**Example:**

jobSalaryArticle_52.salary - Fetches from job card the salary value for the article type "salary" which has ID 52 in the system.

### “Exist” variables

Returns 1 if the corresponding article type is registered for the specified period, and returns 0 if there is no record.

#### Structure: {articleType}.exist

**Example:**

allHours.exist

allAbsence.exist

hours.exist

overtime.exist

absence.exist

selfManagedAbsence.exist

expenses.exist

performanceSalary.exist

guaranteeSalary.exist

timeAddition.exist

monthPay.exist

dayPay.exist

piecework.exist

deduction.exist

addition.exist

#### Structure: {articleType}_{id}.exist

**Example:**

hours_63.exist - Returns the value 1 if logged Hours article with ID 63 for the set period, and gives the value 0 if the record is missing.

### “Unique Days” variables

Fetches the number of unique days that have been logged, according to the selected article.

#### Structure: {articleType}.uniqueDays

**Example:**

allHours.uniqueDays

allAbsence.uniqueDays

hours.uniqueDays

overtime.uniqueDays

absence.uniqueDays

selfManagedAbsence.uniqueDays

expenses.uniqueDays

performanceSalary.uniqueDays

guaranteeSalary.uniqueDays

timeAddition.uniqueDays

monthPay.uniqueDays

dayPay.uniqueDays

piecework.uniqueDays

deduction.uniqueDays

addition.uniqueDays

#### Structure: {articleType}_{id}.uniqueDays

**Example:**

hours_63.uniqueDays - Gets the number of unique days that have been registered for the Hours article that has ID 63 for selected period.

#### Note

Some articles (e.g addition) can be registered several times on the same day, but the system will return 1, because the unique day of registration is only 1.

### “Price list - collective agreement” variables

Fetches the factor from the "Price list - collective agreement" section in the project set for salary/invoice for the selected articles.

#### Note

It is necessary to take into account that in the section "Price list - collective agreement" in the project card it is displayed as a percentage and not as a factor. This means that if you have a salary of 1.94%, then in the contribution formula this value will be equal to 0.0194 (as a factor).

#### Structure: projectPriceList{articleType}_{id}.{value}

**Example**:

**projectPriceListSalary_7.salary** - Gets the factor from the "Price list - collective agreement" section in the project configured for salary for the article with ID 7;**projectPriceListAddition_7.salary** - Gets the factor from the "Price list - collective agreement" section in the project configured for addition for the article with ID 7;**projectPriceListDeduction_7.salary** - Gets the factor from the "Price list - collective agreement" section in the project configured for deduction for the article with ID 7;**projectPriceListAbsence_7.salary** - Gets the factor from the "Price list - collective agreement" section in the project configured for Absence for the article with ID 7.

#### Note

In the case when it is necessary to use "Price list - collective agreement" variables, but for some projects the "Price list - collective agreement" section is empty (not used), in this case, it is necessary to use the formula (projectPriceListSalary_7.salary||0.0194) - this formula will allow you to avoid the value 0 when multiplied, the system will choose the value 0.0194 if the "Price list - collective agreement" section is empty.