How to set up salary rules and salary rule categories¶
A salary rule is a formula that computes one amount of an employee payslip, for example the basic salary, an allowance, an insurance contribution or the net salary. Every rule belongs to a salary rule category, and the rules are grouped in a salary structure. You manage the rules in , and the categories in .
Who |
|
App |
Payroll |
Before you start
Required modules: Payroll.
Install the Payroll app. If you have not done so yet, click Generate Payroll Rules in : it creates the default salary rule categories, the base salary structure and its salary rules, which are the examples of this article.
What is a salary rule category and how do I set it up?¶
Salary rules are allocated to categories, so that a formula can read the total of a whole category, for example the total of all the allowances. The Salary Rule Categories menu is visible only when the developer mode is activated.
Go to . The list shows the categories of your company with their code, parent category and options.
Open a category to see its information.
Field |
What it does |
If you get it wrong |
|---|---|---|
Name |
The name of the category. |
Required. |
Code |
The code of the category. A formula reads the total of the category with this code, for example |
A duplicated code is refused. |
Parent |
The category that groups this one. The amounts of the rules of a category are also added to the total of its parent, so the parent gives the total of all its children. |
Without a parent, the category is a top-level total. |
Paid by Company |
Tick it when the amounts of this category are a cost of the company, not a deduction from the employee. A new category takes the value of its parent. |
The amounts are not counted as a company cost. |
Personal Sensitive |
Tick it for the categories whose amounts are personal data, for example advances or personal deductions. The employee and the payroll officers still see their lines, but the team leaders no longer see the lines of this category of their team members. |
Team leaders can read the amounts of their team. |
You can add a description in the Notes area. The Company field appears only when you work with several companies.
How do I list the salary rules of a category?¶
On the category, click the Salary Rules button at the top of the record. It shows the number of rules that belong directly to this category.
The list of these salary rules opens.
How do I find a salary rule?¶
Go to . The salary rules are grouped by salary structure, and the left panel lists the salary structures of your company.
Click a structure in the left panel to see only its rules, or unfold a group. The list shows the code, the category, the salary structure, the sequence and the contribution register of every rule. With the Filters menu you can show the regular rules only or the input salary rules only, and with Group By you can group by category or by structure.
How do I set up a salary rule?¶
Open a salary rule to edit it. To create one, click New, or click Add a line in the Salary Rules tab of a salary structure.
Field |
What it does |
If you get it wrong |
|---|---|---|
Name |
The name of the rule, as shown on the payslip, for example Travel Allowance. Name it exactly after what it computes. |
Required. |
Code |
The identifier of the rule. Other rules read the result of this rule with its code, which is case sensitive. |
A wrong code makes the formulas that use it fail. |
Salary Structure |
The structure the rule belongs to. A rule belongs to one structure only, it cannot be shared between structures. |
The rule is computed only on the payslips of this structure and of the structures that inherit from it. |
Category |
The category of the rule. It appears once you chose the salary structure. |
The rule is counted in the wrong total. |
Sequence |
The order of computation: a rule with a smaller number is computed first. A rule can use the result of another rule only if that rule has a smaller sequence. |
The formula does not find the result it needs. |
Input Salary? |
Tick it when the amount is typed by hand on every payslip, for example a bonus that is not regular. The rule then appears in the Inputs Salary area of the payslip, see inputs salary. |
The amount cannot be typed on the payslip. |
Appears on Payslip |
Tick it to print the result of the rule on the payslip. It is ticked by default. |
The line is computed but not printed. |
How do I set the condition and the computation of a rule?¶
The General tab holds the condition for the rule to apply and the formula of its amount.
The Condition Based on field decides whether the rule applies to a payslip. When the condition is not met, the rule is ignored for this payslip. Choose one of three types.
Always True: the rule applies to every payslip.
Range: the rule applies when a value is between a minimum and a maximum, both included. Range Based on is the value to test, for example
contract.wagefor the basic wage of the contract. Fill in Minimum Range and Maximum Range. For instance, with a range from 0 to 5,000, the rule applies only to the payslips whose basic wage is within it.
Python Expression: write the condition in Python in Python Condition. The rule applies when the code sets
resultto a true value. The travel allowance, for example, applies only if the contract has this advantage with an amount above zero.
The Amount Type field is the computation of the amount. Choose one of three types.
Fixed Amount: the rule has a fixed value. Fill in Fixed Amount and Quantity. For instance, a meal allowance of 30 for a Quantity of 20 days gives 600. The quantity is a number or a short expression, such as the number of days worked.
Percentage (%): Percentage based on is the value to take, for example the code of another rule such as
BASIC. The amount is this value multiplied by Quantity and by Percentage (%).
Python Code: write the formula in Python in Python Code and put the amount in
result. The code can use the payslip, the contract, the advantages, the inputs, the contributions, the codes of the other rules and the totals of the categories.
Tip
When you choose a Python type on a new rule, the code area starts with comments that list the variables and functions available in the code.
How do I record a contribution paid to a third party?¶
When a part of the salary is also paid to a third party, such as the social insurance agency, select the Contribution Register at the bottom of the General tab. The payslips then record the amount in the register, see contribution registers.
How do I restore the default formulas of a rule?¶
If you changed the condition and the computation of a rule created by Generate Payroll Rules, click Reset at the top of the rule to bring them back to the default values. A confirmation message warns you that your changes are lost. A rule you created yourself has no default values, so it is not changed.
How do I generate accounting entries for a rule?¶
The Accounting tab appears when the HR Payroll Accounting module is installed. It decides how the result of the rule is posted in the accounting.
Field |
What it does |
|---|---|
Generate Journal Item |
Tick it to post a journal item for the result of the rule. The other fields of the tab then appear. |
Force Encoding with Employee |
The journal items of this rule are always recorded with the employee as the partner. |
Debit Account and Credit Account |
The accounts of the journal item. Without a debit account, the expense account of the contract or of the department is used. |
Tax |
The tax applied to the amount. |
If you use the analytic accounting, the tab also offers an Analytic Option that decides on which journal item, debit or credit, the analytic line is generated, and an analytic distribution. See accounting configuration for salary rules.
How do I describe a rule?¶
Write in the Description tab how the rule works, so that you and your colleagues remember it later.
Common errors¶
Problem |
What to check |
|---|---|
The payslip shows an error about a wrong condition, quantity or code |
Open the rule named in the message and check its Python expression, its quantity and its code. The code of another rule is case sensitive. |
A rule does not use the result of another rule |
The other rule must have a smaller Sequence, and both rules must belong to the same salary structure family. |
I cannot delete a salary rule |
A rule used by a payslip line cannot be deleted. Open the payslip and remove the line, or delete the payslip. You can also archive the rule. |
I cannot find the Salary Rule Categories menu |
Activate the developer mode. |
Next steps¶
Group your rules in a salary structure.
Define the HR advantage templates that your rules read through the contracts.
Add the personal tax rules of your payslips.
See also
Related article
Optional module