“Payroll Setup” scenario
“Payroll Elements” scenario
The main payroll elements for calculating the salary are set up as follows:
Path: HR and Payroll Module Setups
The system provides for the main types of payroll elements intended to determine the employee's salary amount, specified in the Element code for salary settings:
• "1001" – salary for the month, provided that all days in the month are worked. The main indicator for the calculation is the ratio of planned and actually worked days in the month. A day is considered worked if the timesheet for this day contains a time activity code defined in the calculation settings as working time.
• "1002" – salary for the month, provided that all hours in the month are worked. The main indicator for the calculation is the ratio of planned and actually worked hours in the month.
• "1003" – salary for the month in the amount, regardless of the number of days worked.
• "1004" – hourly rate.
For the specified algorithms, the localization database supports configured algorithms for calculating additional accruals and deductions.
Payroll Element Card
Path: Payroll Elements
The General tab of the card contains a general description of the element and its relation to various directories and calculation types.
Field | Description |
---|---|
Code | Payroll element code. |
Type | The type of payroll element selected from the list. The element type determines the accrual/deduction type, which, together with the posting group setup specified in the payroll document line (Posting Groups scenario), determines the scheme for generating a posting in G/L. The Accrual element type – accruals to employees that are included in the basic earnings and are associated with the performance of their job duties. The Bonus element type – bonus payments taken into account when calculating the average earnings (AE) in a special way. The PDFO element type – PDFO (personal income tax) deduction. The Salary element type – elements of this type are not used in the current version of the system. The Tax deductions element type – reduction of the tax base for income tax. The Deduction element type – deductions from employee's earnings. The Other element type – other types of accruals to employee. The USC element type – accrual of the unified social contribution. The Reporting element type – the element can be used to calculate totals for subsequent use in reports. The Vacation reserve element type – the element is used to calculate the vacation reserve. The Military tax element type – deduction of the Military tax. |
Element group | Element group code. It is recommended to always fill in the specified field and not leave it blank, since payroll reports do not allow processing a blank group of elements. |
Description | Text description of the payroll element. |
Directory code | Income code according to the income directory. Used in reports. |
Bonus type | The element is defined for payroll elements with the Bonus element type and allows additional classification of bonus types: Blank, Monthly, Quarterly, Semi-annual, Annual. Correct filling of the field is important for including the bonus in the AE calculation, read more in the Average Earnings Calculation Setup scenario. |
Depends on payroll element | If the amount of the calculation element depends on the main payroll element (the Payroll Elements scenario), then the linked element will be used when calculating average earnings, where the main element is used. For example, if a surcharge must be taken into account when calculating daily earnings as well as salary, then in the payroll element created for such a surcharge, in the "Depends on payroll element" field, you must specify the payroll element code of the salary (for example, 1001). |
Normal sign | The sign of the amount in case of normal calculation of the element (negative or positive). If, as a result of calculating the element, the sign of the amount matches the sign specified in the element setup, then a direct posting is generated corresponding to the posting scheme defined in the setup (read more in the Posting Groups scenario). Otherwise, a reverse posting is generated. |
Posting type | The posting type that determines the scheme for generating a financial posting when posting for transactions on an element, according to the selected posting group: Do not post, Expenses, Liabilities, Expenses on liabilities, Information only. |
Payroll Posting Group | The value of the payroll posting group (Posting Groups scenario), which will be selected automatically when adding an element to the line of the payroll calculation type (Calculation Groups scenario). The value of the posting group can be changed in the setup of the line of the Payroll Calculation Type. |
Blocked | If the field is set to "Yes", then it will not be possible to post this element in the employee's journal and absence orders. |
Accrual type code | Accrual type code for the unified social contribution. The value of this field is transferred to the line of the payroll document and is used to generate reports. |
IP Category | Category of the insured person for the unified social contribution. The value of this field is transferred to the line of the payroll document (IP Category field) if the employee does not have a disability on the last day of the month and is used to generate reports. A similar field is also available on the employee card and in the Employee Ledger Entry. If the payroll element card does not have a value in the IP Category field, then when adding a line to the payroll document, the value from the Ledger Entry or from the employee card is entered in the IP Category field. |
IP Category for disabled persons | Category of the insured person (employee with a disability) for the unified social contribution. The value of this field is transferred to the line of the payroll document (IP Category field) if the employee has a disability on the last day of the month and is used to generate reports. If the payroll element card does not have a value in the IP Category for disabled persons field, then when adding a line to the payroll document, the value from the Ledger Entry or from the Employee Card is entered in the IP Category field. |
Recalculation element code | Code of the element that will recalculate the amounts when entering absence orders for the past period. |
The Calculation tab contains information about the current settings of the element, the periods of inclusion of the element in the calculation, and the inclusion of the element in the tax bases for various types of tax.
Field | Description |
---|---|
Calculate | Set to "Yes" so that the calculation in the payroll document is made in the line with this element according to the settings defined for this element (the Payroll Elements scenario). All the options necessary for setting up the element are collected in the menu located on the "Calculation" button. |
Calculations | A field that cannot be edited manually. If the setting is set to "Yes", the element has a calculation algorithm setting. The calculation algorithm is set up using the "Calculation" – "Calculation" buttons. |
Base amounts | A field that cannot be edited manually. If the setting is set to "Yes", the element has a base amount setting. The base amounts are configured using the "Base amount" button. |
Ranges | A field that cannot be edited manually. If the setting is set to "Yes", the element has a range setting. The ranges are set by clicking the Range button. |
Use of increase factor | For a payroll element intended for salary payment, the setting must be set to "Yes" if the increase factor must be used in calculating the average earnings (AE). The setting value is transferred to the line of the Labor Contract Terms, from where it is analyzed when calculating the AE. |
Distribute by periods | The setting must be set to "Yes" so that when generating vacation accrual entries, the system distributes according to the periods for which income is accrued. This setting is used, for example, when distributing the amount of vacations in a future period or sick leave amounts in a past period. |
Include in calculation by | The field value determines the order of including the element in the payroll document of the current period: "Validity period" - the inclusion of the element is determined by the accrual period of the amount specified in the Start Date and End Date fields of the corresponding entry posted in the Employee Ledger Entry, "Period code" - the inclusion of the element in the calculation is determined by the period code specified in the Period Code field of the corresponding entry posted in the Employee Ledger Entry. |
Fixed amount bonus | The setting must be set to “Yes” so that the accrued bonus is taken into account as a fixed amount when calculating the AE. The field must be filled in for an element of the "Bonus" type. Please note that this field and the bonus amount calculation setting are independent of each other. |
Personal income tax base | The setting must be set to "Yes" if the element is included in the base for calculating income tax. The field is used to determine the base amount when calculating payroll elements. |
Personal income tax base by | The setting determines the base of which period the line with the accrual will be included. The field must have a value if the Personal Income Tax Base setting is enabled. Available values: Accrual period, Period code. |
Unified Social Contribution Base | The setting must be set to "Yes" if the element is included in the base for calculating the unified social contribution. The field is used to determine the base amount when calculating payroll elements. |
Unified Social Contribution Base by | The setting determines the base of which period the line with the accrual will be included. The field must have a value if the Unified Social Contribution Base setting is enabled. Available values: Accrual period, Period code. |
Amount required | If the setting is set to "Yes", then when posting the line of the Employee Journal, the element must have a value in the "Amount" field. |
Quantity required | If the setting is set to "Yes", then when posting the line of the Employee Journal, the element must have a value in the "Quantity" field. |
Percentage required | If the setting is set to "Yes", then when posting the line of the Employee Journal, the element must have a value in the "Percentage" field. |
Writ of Execution | If the setting is set to Yes, then when posting the line of the Employee Journal, a check is performed to fill in the required fields for the writ of execution: External Document No., Deduction for a Person. |
Related tab
Element bookmark:
Field | Description |
---|---|
Dimensions | List of dimensions set for the payroll element by default. |
Comments | Comments for the payroll element. |
Ledger Entry | Payroll Ledger Entry reflecting the list if accruals/deductions made for the payroll element. |
Calculation bookmark:
Field | Description |
---|---|
Calculation | Setting up the algorithm for calculating the payroll element. |
Base amount | Setting up base amounts. |
Range | Setting up ranges. |
Payroll Data Sets | Setting up payroll data sets. |
Note: When adding a new element, for further use in calculations, it is necessary to check the need to add it to the required Base amounts used in other calculations, check the need to add it to the report generation setting, inclusion of the element (Average Earning Calculation Setup scenario) and other possible settings that analyze the payroll element.
Element Calculation Setup
Path: Payroll Elements
The calculation of elements is determined by 4 categories of settings: • Calculation algorithm. The calculation method includes a number of pre-defined steps by which the element is calculated. The step can use arithmetic and logical expressions, as well as standard functions built into the system. Intermediate values obtained at each step are saved either in a variable or in one of the fields of the calculation document line. • Base amounts. Amounts defined in a special way that determine the order of data selection for already calculated lines of the payroll document, as well as already posted payroll entries. Base amounts can be obtained by applying filters specified in this setting to the total mass of elements and their groups. Fields are filled in that ensure the selection of a specific group of elements. • Ranges. Ranges are used to enter the values of various coefficients, percentages (percentage tables), statutory amounts, also used in the calculation algorithm. • Payroll data set. A link to the "Work" module is defined. It is used as a calculation option for piecework wages for employees.
Element Calculation Algorithms Setup
Path: Payroll elements
Setting up each element begins with a specific posting period or combination of periods. In the Payroll Element card, on the "Main" tab, click the "Calculation" button:
Field | Description |
---|---|
Period code | Code of the period from which the calculation algorithm works. |
Description | Description of the calculation algorithm. |
To go to the calculation algorithm lines, click the Calculation button. On the Payroll calculation lines page, create an algorithm for calculating an element, which usually consists of several steps. Each step of the algorithm is designed as a separate line of the payroll calculation table:
Field | Description |
---|---|
Label | The field specifies the label code. The label is used to mark the line and ensure the execution of the GOTO command. |
Result field No. | The field number of the payroll document line, in which the calculation result of this line will be placed. In the current version of the system, it is possible to use the following fields of the payroll document line: 14 Payroll Amount, 15 Taxable Amount, 104 Corr. Amount, 221 AE Daily Earnings. Please note that a number of fields are filled in automatically during the initial generation of the document or calling the corresponding calculation functions (for example, CALCULATION OF AVERAGE EARNINGS). Be careful when using fields to save the calculation results. |
Result field name | The name of the field, the number of which is specified in the Result field No. field. The field is not editable and is filled in automatically. |
Statement 1 | Operand group for the IF operator: IF, THEN, ELSE, ENDIF. |
Statement 2 | Group of action operators: MIN – selects the minimum value from the data array specified in the Expression field (the values must be listed separated by “;”). MAX – selects the maximum value from the data array specified in the Expression field (the values must be listed separated by “;”). ABS – the absolute value of the number/expression calculated in the Expression field. GOTO – goes to the label the code of which is specified in the Expression field. STOP – stop operator. Calculation of the element is stopped. |
Variable | The variable to which the expression value should be assigned. To define a new variable, simply enter the variable name in the field. If you need to set the value of an already created variable, click the select button and select the name from the list of variables. |
Expression | The field value displays the expression text generated in a special editor. To create a new expression, click the button. To delete a previously created expression, you must delete all of its lines in the expression editor. |
Structured | A field that cannot be edited manually. If the field has the value "Yes", it means that the line has an expression that can only be edited in the expression editor. Please note that you should delete such expressions in the expression editor. |
Function code | The code of the built-in function that must be executed when calculating the payroll element. Click the button to select the required function. The list of possible functions, their parameters and the procedure for working with them are provided in the Payroll Calculation Functions scenario. |
Description | Text description of the algorithm line. |
Range type | One of the ways to pass calculation parameters to the function. The field must be filled in if the function is passed a range as a parameter. |
Range code | One of the ways to pass calculation parameters to the function. The field must be filled in if the function is passed a calculation range as a parameter. |
Base amount code | One of the ways to pass calculation parameters to the function. The field must be filled in if the base amount is passed as a parameter to the function. |
Time activity group | One of the ways to pass calculation parameters to the function. The field must be filled in if the time activity group is passed as a parameter to the function. |
AE Setup Code | Average earnings setup code. |
Rounding type | The type of rounding of the resulting expression. After calculation, the result is rounded according to the instructions in the Rounding type and Rounding accuracy fields. |
Rounding accuracy | The accuracy of rounding the resulting expression value in the 0.01 format. After calculation, the result is rounded according to the instructions in the Rounding type and Rounding accuracy fields. |
Code | The field value is generated automatically, is not editable, and displays the expression that should be calculated/executed in the current algorithm line. |
Bult-in Calculation Functions
Path: Administration/Payroll Calculation Function
The system contains a number of specific functions that provide calculation of individual indicators based on already posted payroll entries, as well as the employee's working time accounting schedule. Most often, each function is atomic and returns a specific value. Most functions do not modify the document line. The list of built-in functions and their brief description is presented in the Payroll Calculation Functions scenario. The current version of the system does not support the ability to create your own user functions. New functions can be added by Microsoft Corporation or a partner as part of Microsoft Dynamics implementation projects.
Expressions editor
Path: Payroll elements / Calculation / Calculation / Expression
To set up and edit complex expressions that can be part of payroll calculation algorithms, a special expression editor has been developed in Microsoft Dynamics BC, ensuring correct data entry. Each line of the Payroll expression form defines one operand and its relationship with the subsequent operand (the next line). Depending on the expression type, the following fields can be filled in the Payroll Expressions editor:
Field | Description |
---|---|
Variable for assignment | The name of the variable in which the expression calculation result will be saved. |
Field No. for assignment | The field number of the payroll document line in which the expression calculation result will be saved. |
Type | The field value determines the source type. The selected type determines the order in which other fields in the line are filled. The following data sources are available: Constant defined in the Expression field. "Field" is the value of a field from one of the data source tables (the code of the data source table is specified in the "Source table" field, and the field number is defined in the "Field No." field). "Variable" is a variable the name of which is defined in the "Expression" field. “Expression” is a built-in logical expression defined via the expression editor in the “Expression” field. |
Source table | The source table from which you can select a value in the “Field No.” field. |
Field No. | The field is filled with a line of the "Field" type. In the field, you must select a field from the table defined as the "Source table", which will be the data source for the calculation operand. |
Left bracket | Writes the "(" character to the expression line. This setting is used if you need to define the order of expression calculation. |
Logical Prefix | Writes the logical NOT expression to the expression line. This setting is used if you need to invert the value obtained in the "Expression" field. |
Expression | Constant/Variable or new logical expression. The order of filling the field depends on the Type value. |
Operator | Arithmetic operator that connects the current operand and the operand specified in the next expression line. The following arithmetic operations can be used: +,-,*,/, The ";" ("semicolon") operator is used to define a list of values for the MAX, MIN functions, etc. |
Comparison | Logical comparison operator. |
Right bracket | Writes the ")" character to the expression line. This setting is used if you need to define the order of expression calculation. |
Logical Suffix | Logical expression operator. The following operators can be used: AND, OR, XOR. |
Rounding Type | Rounding type for the resulting expression. After calculation, the result is rounded according to the instructions in the “Rounding type” and “Rounding accuracy” fields. |
Rounding accuracy | The rounding accuracy of the resulting expression value. After calculation, the result is rounded according to the instructions in the “Rounding type” and “Rounding accuracy” fields. |
** Examples of setting up expressions in payroll elements**.
Path: Payroll elements / Calculation / Calculation / Expression
Assignment operator. The expression value can be assigned: • In a specific field of the current line of the payroll document. • In a variable defined in the current calculation algorithm. If the assignment must be made to a field from the current line of the payroll document, then on the Payroll calculation lines page, in the Field No. for assignment field, select the field number of the document line. The selected field will contain the expression result or the function calculation result. List of fields available for assignment by default:
Field number | Field name | Description |
---|---|---|
14 | Payroll Amount | The total amount of payment/deduction calculated in this line. The field value is used to generate financial entries when posting a document. |
15 | Taxable Amount | Taxable base. When calculating all accrual elements included in the taxable base for an element, the specified field must be filled in. |
104 | Corr. Amount | Calculation storage amount. The value is passed to the function as a base that calculates the tax amount at the rate. |
221 | AE Daily Earnings | Average daily earnings amount. |
If the assignment needs to be performed by a variable, then the variable name must be specified in the "Variable" field. You can enter the name of the new variable either directly in the field, in which case the entered name is automatically added to the list of variables, or you can click the V button in the "Variable" field and select the name of an existing variable on the "Variable Payroll Elements" page. Subsequent settings depend on the value of the "Type" field:
Value type for the assignment operator | Setting procedure |
---|---|
Calculation result of the built-in function | In the “Function code” field, select the code of the required function and, if necessary, define the parameters for calling it. |
Constant | In the "Expression" field, click the button and in the Payroll Expression form, in the Type field, specify the Constant; in the Expression field, enter the value of the constant. |
Expression | In the "Expression" field, click the button and in the Payroll Expression form, generate the required expression. |
Conditional operator
The format of the conditional operator can be described as follows: IF Expression THEN Statements1 ELSE Statements2 ENDIF Where Expression is a logical expression of the {NOT}Comparison 1 AND/OR/XOR{NOT}Comparison 2 etc. form, i.e. NOT and the use of logical operators AND/OR/XOR are allowed, for example (I = 0) AND NOT (A >0 ). Statement1 is one or more assignment operators. The block ends with ELSE Statement2 - one or more assignment operators. The block ends with ENDIF (a required operator for closing IF). On the "Payroll Calculation Lines" page, conditional expression operators are entered in the "Statement 1" field by selecting the desired field value from the list. Expressions are entered using the expression builder in the "Expression" field. For example, you need to set up the following calculation algorithm:
A = 0
I = 0
IF I = 0 OR A <> 0
THEN A = 2 (result A = 2)
Payroll Amount = 7 (result B = 7)
ELSE
B = 4 (not executed)
Payroll Amount = 5 (not executed)
ENDIF
The result of setting up such a payroll algorithm will look as follows:
If the "Number of runs" field specifies 1, then the setup line was processed by the payroll element. If the field specifies 0, then the calculation of these lines was not performed according to the payroll element setup conditions. The line with the function code is always executed, except: if it is in a line with the THEN operator and the logical result of the previous line = FALSE.
In-built operators
The system allows to use built-in operators: • MIN. • MAX. • ABS. • ROUND. The name of the built-in operator is selected from the list of possible values in the "Statement 2" field. The number of parameters for the MIN and MAX operators can be any. Parameters are entered using the expression builder, separated by ";". The ";" sign is entered in the "Operator" field of the expression builder. Constants, variables, and document fields can be used as expressions.
Transition operators
The concept of a label is used to organize conditional transitions when setting up expressions. The name of which is entered in the Label field of the expression line, as well as the GOTO operators and STOP operators.
Setting up base amounts
Path: Payroll elements
Setting up base amounts defines the rules for selecting data from lines of a payroll document or a payroll ledger entry in accordance with the rules defined in the setup. To set up base amounts used in calculation algorithms, on the Payroll Element Card, on the "Main" tab, click the "Base amount" button:
Field | Description |
---|---|
Code | Base amount line code. The line code allows you to pass a specific line or set of lines to set a filter by the base amount. |
Description | Brief description of the selection rule. |
Element type filter | The field is filled in if you need to set an element type filter (the filter is applied on the "Data set type" field). The element type is determined by its ordinal number: 0. Accrual, 1. Bonus, 2. Personal Income Tax, 3. Salary (not used in the current version). 4. Tax Deduction, 5. Deduction, 6. Other, 7. Unified Social Contribution, 8. Reporting, 14. Military Tax, 15. Vacation Reserve. The system implements interactive configuration of this field with sequential selection of an element from the list. |
Filter by element group | The field is filled in if you need to set a filter for an element group (the filter is applied on the Data Set Element Group field). |
Filter by element code | The field is filled in if you need to set a filter by an element code (the filter is applied on the Data Set Code Element field). |
Filter for personal income tax base | The field is filled in with the values: Tax or Do not tax, if you need to apply a filter for elements in which the "Personal Income Tax Base" field is filled in. |
Filter for unified social contribution base | The field is filled in with the values: Tax or Do not tax, if you need to apply a filter for elements in which the "Unified Social Contribution Base" field is filled in. |
Posting type filter | This field is filled in if you need to set a filter for the posting type. In this case, the posting type is determined by a numeric code: 0 – do not post, 1 – expenses, 2 – liabilities, 3 – expenses for liabilities. |
Element code | The code of the element for which the line with the base amount was created. Filled in automatically. |
Period code | Filter by the value of "Period code". |
Filter by period | This field is filled in if you need to set a filter by period. Allowed values: By period code; By accrual period code. |
Filter by payment source | This field is filled in if you need to set a filter by payment source. Allowed values: Employer, Social Insurance Fund. |
Filter by persons with disabilities | The field is filled in with the “Tax” or “Do not tax” values if you need to apply a filter to the operations of a disabled person or a disabled person by position. |
Ranges setup
Path: Payroll elements
Ranges are used to set up the percentage scale, specific percentages and other constants that can be used in the calculation algorithm. To set up the ranges used in the calculation algorithms, on the Payroll Element Card, on the Main tab, click the Range button. The range setup is determined by the following parameters:
Field | Description |
---|---|
Code | The range code used to transfer data to the corresponding calculation functions. |
Period Code | Specifies the period from which the specified range begins to apply. |
Description | Text description/comment for the range. |
Range Type | Specifies the range type. Depending on the range type, certain fields may be visible in the setup lines. When transferring a range to a function, each type of range uses its own function (a function that analyzes only a certain field in the range). |
Consider employee gender | If you want the range to consider the employee's gender, enable the setting. |
Consider employee age | If you want the range to consider the employee's age, enable the setting. |
Consider relatives | If you want the range to consider the employee's relatives, enable the setting. |
Payroll Data Sets Setup
Path: Payroll elements
The salary data set is used to set up a connection with the “Work” module to set up payroll data sets that are used in the Piecework wage calculation algorithms. On the payroll element card, on the Main tab, click the Payroll data set button. The settings for the data sets are determined by the following parameters:
Field | Description |
---|---|
Element code | The code of the element for which the settings are being made. |
Code | The numeric value for subsequent data calculation is specified. Example: 20%. |
Description | Text description/comment. |
Period code | Specifies the period from which this setting comes into effect. |
Work code | Selected from the list generated in the Work module based on the entered work. You can set up a filter for selecting work. |
Work task number | Selected from the list generated in the Work module based on the entered work tasks. |
Operation type | Select from the list: • Use, • Sale. |
Copying Element Setup
Path: Payroll elements
The system provides the ability to copy elements and their settings. To copy the current element in the Payroll element card, click the Copy button: In the New element field, enter the code of the new element and click OK. Change the description and other parameters in the new element card. To copy the element calculation, specify from which element and period to copy the calculation.
“Payroll Calculation – Setup” report
Path: Reports/Payroll Calculation – Setup The report displays the setup data for calculating payroll elements specified on the payroll element card.
Payroll element groups
Path: Administration/Payroll element groups
Element group codes are used to determine the types of accruals and deductions. A payroll element group is an additional grouping of payroll elements that are similar in purpose. Payroll element grouping can be used for various purposes, such as determining the base amount for a payroll element.