How To Create A Pay Sheet For My Country
ERP5 Pay Sheet have changed and now use a Pay Sheet Model. A Pay Sheet Model permits to define some parameters specific to a country, a company, employee group, or a single employee. It's used to describe the common parts in several pay sheets and the method to calculate the elements. It could be applied on many employees or just on one. The model makes easy to create slices, constants, payment conditions or annotations and modify the values if they change. This module has been developed to ease the work of accounting when the laws (and therefore the calculations) are changing and to have the least possible modification of the source code. It can also generate the Pay Sheet of a group of employees from the same model.
In calculating the paysheet, many elements depend on the legislation of the concerned country. That is why it was chosen to separate the initial Business Template (bt) in several bt's:
A generic bt, which contains no information of specific legislation: 'erp5_payroll',
A bt for each legislation with the specific data used by it (e.g. : 'erp5_payroll_l10n_fr' for France),
A bt for each project containing the datas used by this project (payroll services, organisations, ...), (e.g. : 'nexedi_payroll' for Nexedi project).
Specifically, the informations that may vary from one country to another are as follow :
- the slices,
the Delivery Builder (pay_sheet_transaction_builder)
add here the future things...
The informations that vary from one project to another are as follow :
- the payroll services,
- the organizations (used in payroll service),
the Rules (Invoice Transaction Rule)
- the categories including :
the slices (salary_range category),
the employees grades (grade category),
tax_category can be added to have more part than employer and employee (tax_category category).
Create a Business Template for my country
If you need slices to calculate pay sheets in your country (general case), create a category (in the 'portal_categories' module) for your country. In this category, you will create sub categories :
You must create as categories as different amount slice you have. (more explaination in 'Create Payroll Services').
After that, create a bt for your country (respecting the naming convention so call it erp5_payroll_l10n_YourCountryCode e.g. : 'erp5_payroll_l10n_fr' for France). Add slices used for pay sheets in your country in the 'Paths' LinesField of the bt.
Create a Business Template for my project
Create Payroll Services
You must create as many Payroll Service as there are contributions on pay sheets to create : a line of pay sheets = a payroll service. In the payroll service, some parts are important and new :
The Base Participation it's an amount type list. It's used to define the amount group this contribution belongs to. A contribution can belong to several amounts:
The base salary contributes to the Gross Salary and to the Base Salary groups (because the gross salary is composed by the base salary + the bonus) . Also a bonus contributes to Gross Salary and Bonus groups. But a tax generally contribute only to deductible or non-deductible taxes group.
Variation Base permit to select the base categories which will help define the rules for calculating the payroll service. I recommend always select tax_category and salary_range which will allow you respectively to select the parts (employer, employee, etc.) and the slices used.
After your Variation Base selection, you must save your data to see the Variation Range.
Variation Range permits to select the slices and parts used. Normally, there is no yet slices, you must add the one you want to use. To do this go to 'portal_categories/salary_range' and create slices. A Slice is composed by a min and a max value, so you must create as categories as min an max values (but min and max values are not entered here. I'll explain that later).
e.g : In France, a lot of contributions used this 3 slices :
0 <= Tranche A < 2682 2682 <= Tranche B < 10728 10728 <= Tranche C < 21456
So we are going to create 3 categories : 'Tranche A', 'Tranche B', 'Tranche C'. (Adapt it to your legislation).
Repeat this process for all the slices required to calculate all your paysheet. I recommend that you create a generic slice (call it 'infinty_slice' for example) that you add to each of your services that do not use slices. Later, you will define value from 0 to a very big number for this slice, which will remains the same as if there were no slice, but simplifies the operations of the program. When you have all slice you need, continue creating your Payroll Service by selecting the slices used for this contribution and the different parts (Employer Share, Employee Share, ...)
Create Portal Rules
Go to 'http://yourInstanceAddress/portal_rules' and add a new Invoice Transaction Rule. Call it 'default_pay_sheet_transaction_rule'. Then add the Predicate and configure the behavior for the different shares and services.
Add Employees Grade
If your company use grade, it may be a good idea to add the different grade category in 'portal_categories/grade'. That will permit to use a predicate to apply a paysheet model only on a certain grade.
Create the new Business Template
Then, create a new bt for your project (call it YourProjectName_payroll e.g. : 'nexedi_payroll'), see HowToCreateBusinessTemplates for help. Now you are ready to follow the next HowTo : HowToCreatePaySheet.