Payroll Calculation Functions
Path: Administration / Payroll Calculation Functions
This document provides a detailed description of all payroll calculation functions used in payroll element and report configuration in the SMART Payroll system. Each function has a unique number and performs a specific calculation operation during payroll document processing.
How to Read This Document
Each function is described using a consistent structure:
- What it does — general description of the function's purpose
- Parameters — what data the function accepts and from which tables
- Result — what the function returns and which Payroll Document Line fields it updates
- Calculation logic — step-by-step algorithm
Function Groups
| Number Range | Description | Codeunit |
|---|---|---|
| 100–550 | Time & calendar, limits, base amounts, ranges, allocation, salaries | SMA Payroll Document Calculate |
| 2002–2301 | Taxation, withholding, YTD amounts, salaries by period, service, advances | SMA Payroll Document Calculate |
| 21094000–21094050 | Salaries by date, sick leave, indexation, currency, accruals by period | SMA Payroll Document Calculate |
| 21094051–21094112 | Leave & reserves, data validations, balances, net pay calculation | SMA Payroll Document Calculate |
| 21094900–21094924 | Ranges, service, base amounts, action dates, positions | SMA Payroll Document Calculate |
| 21094500–21094518 | Report functions: statistics, amounts | SMA Payroll Report Calculation |
Note: Functions marked DEPRECATED are kept for backward compatibility. For new configurations, use the recommended replacements.
Payroll Calculation Functions (Part 1): Time, Limits, Base Amounts, Salaries, Advances (100–550, 2002–2301)
This section contains functions for time and calendar, limits, base amounts, ranges, salaries, taxation, and advances. Each function is used in payroll element calculation lines and is invoked during Payroll Document computation.
Time, Calendar, Limits, Base Amounts, Allocation, Salaries (100–550)
Function 100 — Calculate Time Measure (CalcTimeMeasure)
What it does: A universal configurable function that returns planned or actual days or hours for a selected period. Depending on parameters, it can query the production calendar (planned values) or the timesheet (actual values).
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Parameter Code | Calculation Line (Parameter Code) | Required. Identifies the function parameter set in the "Calculation Function Parameters" table |
| Time Measure Type | Calculation Function Parameter (Time Measure Type) | Required. Determines which value to return. Possible values: Planned Calendar Days, Planned Working Days, Planned Weekend Days, Planned Working Hours, Planned Night Hours, Planned Evening Hours, Planned Holiday Hours, Official versions of the same indicators, Actual Calendar Days, Actual Hours, Actual Working Days, Actual Calendar Days Without Holidays, Planned Working Days (by Timesheet) |
| Period Filter | Calculation Function Parameter (Period Filter) | Required. Determines the date range. Possible values: By Action Dates, By Pay Period, By Wage Period Code, By Period Code, By Bonus Period, By Intersection Dates, In Current Year, By Average Earnings Period |
| Use Dimensions Filter | Calculation Function Parameter (Use Dimensions Filter) | Optional. When enabled, filters timesheet data by dimensions (Shortcut Dimension 1 Code, Shortcut Dimension 2 Code) of the Payroll Document Line |
| Time Activity Group | Calculation Line (Time Activity Group) | Used to filter timesheet data by time activity group |
Result:
- Returns: Decimal -- number of days or hours according to the selected time measure type
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads the function parameter by parameter code from the calculation line.
- Validates required fields "Time Measure Type" and "Period Filter".
- Determines the date range (FromDate, ToDate) based on the period filter:
- "By Action Dates" -- takes action dates from the document line.
- "By Pay Period" -- takes the start and end of the document's pay period.
- "By Wage Period Code" -- takes the wage period dates.
- "By Period Code" -- takes the current payroll period dates.
- "By Bonus Period" -- takes the bonus period dates.
- "By Intersection Dates" -- takes the intersection of action dates with period dates.
- "In Current Year" -- from the start of the first period of the year to the end of the year.
- "By Average Earnings Period" -- takes the average earnings period dates.
- Depending on the time measure type:
- For planned values -- calls CalendarMgt.GetPeriodInfo() with the employee's calendar or the official calendar (for "Off." types).
- For actual values -- calls TimesheetMgt.GetTimesheetInfo() or TimesheetMgt.GetTimesheetInfoWithDimension() (if dimensions filter is enabled).
- Returns the resulting numeric value.
Function 150 — Get Payroll Limit (GetPayrollLimit)
What it does: Returns the payroll limit value from the "Payroll Limits" table for the specified limit type and period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Parameter Code | Calculation Line (Parameter Code) | Required. Identifies the function settings |
| Payroll Limit Type | Calculation Function Parameter (Payroll Limit Type) | Determines which limit to return. Possible values: Minimum Wage, SSC Limit, Indexation Threshold, Subsistence Minimum, Minimum Wage Hourly, Compensation Coefficient, Per Diem Allowance, Per Diem Allowance Abroad |
| Period Filter | Calculation Function Parameter (Period Filter) | Required. Determines which period to use for the limit lookup. Possible values: By Period Code, By Wage Period Code, By Pay Period, In Current Year, By Action Dates, By Intersection Dates, By Bonus Period |
Result:
- Returns: Decimal -- limit amount from the "Payroll Limits" table
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads the function parameter and validates the required period filter.
- Determines the period code based on the filter:
- "By Period Code" -- takes the Period Code from the document line.
- "By Wage Period Code" -- takes Wage Period From.
- "By Pay Period" -- takes the document's pay period.
- "In Current Year" -- takes the first period code of the year.
- "By Action Dates" -- finds the period by the action start date.
- "By Intersection Dates" -- finds the period by the document start date.
- "By Bonus Period" -- takes the bonus period code.
- Searches the "Payroll Limits" table for the last entry with the limit type and period code
<=the determined one. - Returns the Amount field of the found record, or 0 if no record is found.
Function 220 — Base Amount from Current Document (BaseAmount)
What it does: Sums amounts from lines of the current payroll document according to the "Base Amount" table settings. This is the primary function for determining the accrual or deduction base.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Required. Identifies the filter set in the "Base Amount" table |
Filter settings in the "Base Amount" table:
| Parameter | Description |
|---|---|
| Employee Filter | By Employee / By Person / By Other Employees |
| Period Filter | By Period Code / By Wage Period Code / By Bonus Period / By Action Dates / By Intersection Dates / By Pay Period |
| Amount Type | Payroll Amount / Corr. Amount / Taxable Amount / Tax Deduction and others |
| Element Code Filter | Filter by payroll element code |
| Element Type Filter | Filter by element type |
| Element Group Filter | Filter by element group |
| Income Tax Base Filter | Filter by income tax base |
| SSC Base Filter | Filter by SSC base |
Result:
- Returns: Decimal -- amount according to the configured amount type
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads base amount settings by element code and base amount code.
- Validates the required "Amount Type" field.
- Determines the employee filter:
- "By Employee" -- filters by document number of the current line.
- "By Person" -- filters by person code across all documents. If the calculation group has type "Between" (interperiod), additionally aggregates data from posted documents of other calculation groups.
- "By Other Employees" -- filters by person code, excluding the current employee.
- Sets base amount filters (element codes, types, groups, etc.).
- Sets the period filter according to the setting.
- Sums the corresponding amount type from filtered document lines.
- Returns the result.
Function 230 — Detailed Base Amount (DetailedBaseAmount)
What it does: Returns a detailed base amount for taxes. Unlike Function 220, it works with the "Detailed Tax Base" table and creates entries for subsequent distribution of the tax amount among sources.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Required. Identifies the filters in the "Base Amount" table |
Result:
- Returns: Decimal -- detailed base amount according to the amount type (Payroll Amount, Corr. Amount, or Tax Deduction)
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads the base amount settings and validates the required amount type.
- Filters the "Detailed Tax Base" table by base document number and tax document number.
- Sets the filter by payroll element code and tax element code.
- Depending on the amount type, sums the corresponding field (Corr. Amount, Payroll Amount, or Deduction Amount).
- Returns the total.
Function 247 — Base Balance from Ledger Entries (BaseBalance)
What it does: Returns an amount from posted payroll entries (the "Payroll Ledger Entry" table). Unlike Function 220, which works with the current document, this function reads data from already posted documents.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Required. Identifies the filters in the "Base Amount" table |
Filters are analogous to Function 220, but applied to the "Payroll Ledger Entry" table.
Result:
- Returns: Decimal -- amount from posted payroll entries
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads the base amount settings and validates the required amount type.
- Sets the base amount filters on the "Payroll Ledger Entry" table.
- Determines the employee filter (By Employee / By Person / By Other Employees).
- Determines the period filter:
- "By Period Code" -- can use the previous period (if the "Use Previous Period" flag is enabled).
- "By Wage Period Code" -- filters by Wage Period From.
- Other filters are analogous to Function 220.
- Sums the corresponding amount type from filtered entries.
- Returns the result.
Function 249 — Range-Based Deduction (Deduction)
What it does: Calculates a deduction amount based on range lines (scale). The function is used for deductions that depend on the amount and have a progressive or tabular structure.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Range Header | Determined automatically (GetRangeHeader) | Loaded by element code, range type, and range code from the calculation line |
| Range Type | Calculation Line (Range Type) | Payroll range type |
| Range Code | Calculation Line (Range Code) | Specific range code |
Result:
- Returns: Decimal -- deduction amount calculated from range lines
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the number of exemptions from the Employee Payroll Element Ledger Entry.
- Filters range lines by element code, range code, and period code.
- Additionally filters by employee gender (if allowed in the header), date of birth, and disability status.
- Iterates through range lines (from highest to lowest):
- If the line contains "Amount Over" -- checks whether this threshold is exceeded.
- Calculates the deduction amount = Amount + (Annual Base * Percentage / 100).
- If "Per Exemption" is enabled -- multiplies by the number of exemptions.
- Checks the minimum and maximum amounts of the line.
- Converts the result to a monthly value (divides by 12).
- Returns the total deduction amount.
Function 250 — Year-to-Date Base Amount (YTDBaseAmount)
What it does: Returns an amount from the Payroll Ledger Entry (posted documents) from the beginning of the calendar year. Uses the same base amount filters as Function 220, but reads from posted data starting from the first period of the year.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Required. Identifies the filters in the "Base Amount" table |
Result:
- Returns: Decimal -- year-to-date amount from the Payroll Ledger Entry
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads the base amount settings and validates the amount type.
- Sets the base amount filters on the "Payroll Ledger Entry" table.
- Determines the employee filter (By Employee / By Person / By Other Employees).
- Determines the period filter:
- "By Period Code" -- from the first period of the year to the current (or previous, if enabled).
- "By Wage Period Code" -- analogously.
- "By Bonus Period" -- filters by the bonus period.
- "By Action Dates" -- by the action date range.
- "By Intersection Dates" -- by intersection dates.
- "By Pay Period" -- from the first period of the year to the pay period.
- Sums the corresponding amount type and returns the result.
Function 252 — Range Minimum Value (Brackets Min)
What it does: Returns the minimum amount from the first matching payroll range line. Used to retrieve threshold values from the range reference.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Range Header | Determined automatically (GetRangeHeader) | Loaded by element code, type, and range code |
| Range Type | Calculation Line (Range Type) | Range type |
| Range Code | Calculation Line (Range Code) | Range code |
Result:
- Returns: Decimal -- value of the "Min Amount" field from the first matching range line
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the Range Header (GetRangeHeader).
- Filters range lines by range code, element code, and period code.
- Additionally filters by gender (if allowed) and employee's date of birth.
- Finds the first line and returns the "Min Amount" field value.
- If no line is found, returns 0.
Function 253 — Range Maximum Value (Brackets Max)
What it does: Returns the maximum amount from the first matching payroll range line. Analogous to Function 252, but returns a different field.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Range Header | Determined automatically (GetRangeHeader) | Loaded by element code, type, and range code |
| Range Type | Calculation Line (Range Type) | Range type |
| Range Code | Calculation Line (Range Code) | Range code |
Result:
- Returns: Decimal -- value of the "Max Amount" field from the first matching range line
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the Range Header (GetRangeHeader).
- Filters range lines by range code, element code, and period code.
- Additionally filters by gender and employee's date of birth.
- Finds the first line and returns the "Max Amount" field value.
- If no line is found, returns 0.
Function 255 — Range Quantity (Brackets Quantity)
What it does: Returns the "Quantity" field value from the first matching payroll range line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Range Header | Determined automatically (GetRangeHeader) | Loaded by element code, type, and range code |
| Range Type | Calculation Line (Range Type) | Range type |
| Range Code | Calculation Line (Range Code) | Range code |
Result:
- Returns: Decimal -- value of the "Quantity" field from the first matching range line
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the Range Header (GetRangeHeader).
- Filters range lines analogously to Functions 252/253.
- Finds the first line and returns the "Quantity" field value.
- If no line is found, returns 0.
Function 261 — Balance to Date (BalanceToDate)
What it does: Returns the sum of payroll accruals from the Payroll Ledger Entry for the employee and element from the beginning of the year through the current period inclusive.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically from current line |
| Element Type | Payroll Document Line (Element Type) | Automatically from current line |
| Element Code | Payroll Document Line (Element Code) | Automatically from current line |
| Period Code | Payroll Document Line (Period Code) | Automatically from current line |
Result:
- Returns: Decimal -- Payroll Amount from the ledger entries
- Updates Payroll Document Line fields: --
Calculation logic:
- Filters the ledger entries by employee code, element type, and element code.
- Sets the period filter from the first period of the year to the current period of the line.
- Uses the FlowField "SMA Payroll Amount" on the Employee Card for summing.
- Returns the total amount.
Function 263 — Year-to-Date Taxable Income Tax (YTDTaxableIncomeTax)
What it does: Returns the taxable income amount (Taxable Amount) from the Payroll Ledger Entry for the employee, element, and posting type from the beginning of the year through the current period inclusive.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically from current line |
| Element Type | Payroll Document Line (Element Type) | Automatically |
| Posting Type | Payroll Document Line (Posting Type) | Automatically |
| Element Code | Payroll Document Line (Element Code) | Automatically |
| Period Code | Payroll Document Line (Period Code) | Automatically |
Result:
- Returns: Decimal -- taxable amount year-to-date
- Updates Payroll Document Line fields: --
Calculation logic:
- Filters the ledger entries by employee, element type, posting type, and element code.
- Sets the period filter from the first period of the year to the current period of the line (inclusive).
- Uses the FlowField "SMA Taxable Amount" for summing.
- Returns the taxable income amount.
Function 270 — Get Minimum Wage Limit (GetFSILimit MROT)
DEPRECATED. Replaced by Function 150 (GetPayrollLimit) with the corresponding limit type.
What it does: Returns the minimum wage value from the "Payroll Limits" table for the current period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Period Code | Payroll Document Line (Period Code) | Automatically from current line |
Result:
- Returns: Decimal -- minimum wage value
- Updates Payroll Document Line fields: --
Calculation logic:
- Searches the "Payroll Limits" table for an entry with type MROT and period code
<=current. - Returns the Amount field or 0.
Function 271 — Get SSC Limit (GetFSILimit SSC)
DEPRECATED. Replaced by Function 150 (GetPayrollLimit) with the corresponding limit type.
What it does: Returns the SSC (Social Security Contribution) base limit value from the "Payroll Limits" table.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Period Code | Payroll Document Line (Period Code) | Automatically from current line |
Result:
- Returns: Decimal -- SSC limit amount
- Updates Payroll Document Line fields: --
Calculation logic:
- Searches the "Payroll Limits" table for an entry with type SSC Limit and period code
<=current. - Returns the Amount field or 0.
Function 280 — Update Payroll Element Code (UpdatePayrollElementCode)
What it does: Replaces the payroll element code, base amount code, and time activity group on the Payroll Document Line. New values are taken from the base amount settings and the time activity group of the function parameter.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Determines the new element code through the base amount element code filter |
| Time Activity Group | Calculation Line (Time Activity Group) | Determines the new time activity |
Result:
- Returns: Integer (0)
- Updates Payroll Document Line fields: Element Code, Time Activity Code
Calculation logic:
- Loads the base amount settings by element code and base amount code.
- Determines the new element code from the base amount element code filter (takes the first value before the "|" character).
- Determines the new time activity from the time activity group filter.
- If the element code differs from the current one -- updates it via Validate.
- If the time activity code differs -- updates it.
- Updates timesheet records, replacing the time activity code in timesheet details.
Function 290 — Create Attention Message (CreateAttention)
What it does: Creates an attention (notification) record in the Payroll Document FactBox. The message text is taken from the "Attention Text" field of the calculation line. Typically used after an IF operator to warn about special conditions.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Attention Text | Payroll Calculation Line (Attention Text) | Text to be displayed in the FactBox. Supports substitution of element code and line number |
Result:
- Returns: Integer (0)
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds the current element calculation line with the attention text.
- Checks whether an identical attention already exists for this document line.
- If the message does not yet exist, creates a new record in the "Document Attention" table with the formatted text.
Function 300 — Disability Group (GetPersonGroupDisability)
What it does: Returns the employee's disability group number (1, 2, or 3) as of a specified date. If the employee has no disability, returns 0.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Parameter Code | Calculation Line (Parameter Code) | Required. Determines which date to use for the disability check |
| Period Filter | Calculation Function Parameter (Period Filter) | Determines the check date: By Wage Period Code, By Period Code, By Pay Period, In Current Year, or By Action Dates |
Result:
- Returns: Integer -- disability group number (1, 2, 3) or 0
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads the function parameter and determines the check date based on the period filter.
- Searches the "Person Medical Information" table for a record with type "Disability".
- Filters by person code, start date
<=current date, end date>=current date (or blank). - Filters for non-empty disability group.
- Returns the disability group number or 0.
Function 310 — Recalculate Line (RecalculateLine)
What it does: Recalculates other lines in the current document. Used when a change to one element requires recalculation of other dependent elements.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Required. Determines which document lines to recalculate through the base amount filters |
Result:
- Returns: Integer (0)
- Updates Payroll Document Line fields: Recalculates dependent lines (zeroes out and recalculates their amounts)
Calculation logic:
- Saves the current document line (Modify).
- Loads the base amount settings.
- Finds document lines matching the base amount filters that have a line number less than the current one.
- For each found line:
- Deletes related average earnings and insurance service records.
- Zeroes out all amounts and time indicators on the line.
- Runs a full recalculation of the line through the "SMA Payroll Document Calculate" codeunit.
- Saves the recalculated line.
Function 320 — Net Amount (GetNetAmount)
What it does: Returns an indicator of whether the line is a net amount (net pay amount). Effectively checks the "Net Amount" flag on the document line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Payroll Document Line | Automatically |
Result:
- Returns: Integer -- 1 if the line has the "Net Amount" flag, 0 otherwise
- Updates Payroll Document Line fields: --
Calculation logic:
- Checks the "Net Amount" field of the document line.
- If true, returns 1; otherwise returns 0.
Function 330 — Amounts from Posted Interperiod Payroll Documents (GetAmountsFromPostedInterperiodPayrollDocuments)
What it does: Returns amounts from posted interperiod payroll documents that have a created payment. Used to account for amounts accrued in other calculation groups of type "Between".
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Required. Identifies the filters |
Result:
- Returns: Decimal -- amount from posted interperiod documents
- Updates Payroll Document Line fields: --
Calculation logic:
- Loads the base amount settings.
- Finds all posted documents with calculation groups of type "Between" (interperiod).
- Filters by employee, period code, and payment created flag.
- Excludes correction and reversal documents.
- Filters posted document lines by base amount settings and period filter.
- Sums the corresponding amount type and returns the result.
Function 340 — Norm Hours for Current Month (SumOfNormHours current month)
What it does: Returns the standard working hours for the current month from the normative calendar. Used for summarized working time accounting.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Action Ending Date | Payroll Document Line (Action Ending Date) | Determines the current month |
Result:
- Returns: Decimal -- standard working hours from the normative calendar
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the employee's calendar as of the action ending date.
- Checks whether summarized working time accounting is enabled.
- Determines the date range according to the accounting period type (month, quarter, half-year, year, week).
- Calculates the norm hours from the normative calendar using CalendarMgt.GetPeriodInfo (working hours).
- Returns the norm hours without averaging.
Function 345 — Norm Hours for Entire Year (SumOfNormHours entire year)
What it does: Analogous to Function 340, but returns the average monthly norm hours for the accounting period. Uses the same summarized working time accounting mechanism.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Action Ending Date | Payroll Document Line (Action Ending Date) | Determines the current month |
Result:
- Returns: Decimal -- average monthly norm hours for the accounting period
- Updates Payroll Document Line fields: --
Calculation logic:
- Performs steps 1--4 of Function 340.
- Additionally divides the result by the number of months in the accounting period (3 for quarter, 6 for half-year, 12 for year).
- Returns the rounded average monthly norm.
Function 400 — Posting Entry Payroll Amount Allocation (AllocatePEPayrollAmount)
What it does: Distributes the payroll accrual amount by posting dimensions. Creates allocation lines for subsequent posting according to the employee's allocation group.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Base Amount Code | Calculation Line (Base Amount Code) | Optional. If specified, determines the element filter through the base amount |
Result:
- Returns: Integer (0)
- Updates Payroll Document Line fields: Creates entries in the "Payroll Doc. Line PE Alloc." table (SMA Payroll Doc. Line PE Alloc)
Calculation logic:
- Deletes existing allocation lines for this document line.
- Retrieves the allocation group code from the Employee Card.
- If no group is set -- exits without action.
- Finds the allocation group type by element code and period.
- For each allocation group line, creates an allocation entry with percentage, posting group, and dimension set.
Function 500 — Average Employee Salary by Date (Hourly) (GetAESalaryByDate hourly)
What it does: Returns the employee's base salary as of a given date, converted to an hourly rate.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Action Starting Date | Payroll Document Line (Action Starting Date) | Date for which the salary is determined |
Result:
- Returns: Decimal -- hourly rate of the base salary
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds the latest salary record in the Payroll Element Ledger Entry effective as of the given date.
- Uses the salary element filter from HR Setup (Daily Rate Element Code, Hourly Rate Element Code, Flat Rate Element Code).
- Divides the salary amount by the number of working hours per month from the employee's calendar.
- For an hourly rate element, multiplies by the number of hours from the official calendar.
- For a daily rate element, multiplies by the number of days from the official calendar.
- Returns the hourly rate.
Function 501 — Average Employee Extra Salary by Date (Hourly) (GetAEExtraSalaryByDate hourly)
What it does: Returns the amount of additional payments (supplements) that depend on the base salary, converted to an hourly rate.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Action Starting Date | Payroll Document Line (Action Starting Date) | Date for which supplements are determined |
Result:
- Returns: Decimal -- hourly rate of additional payments
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds all payroll elements where the "Depends on Salary Element" field references the salary element.
- For each such element, finds the effective record in the ledger entries as of the given date.
- Divides the amount of each element by the number of working hours per month from the calendar.
- Sums and returns the total hourly rate of supplements.
Function 502 — Total Earnings by Date (Hourly) (Sum of 500+501)
What it does: Returns the total earnings (base salary + additional payments) as an hourly rate. This is the sum of the results of Functions 500 and 501.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Action Starting Date | Payroll Document Line (Action Starting Date) | Date |
Result:
- Returns: Decimal -- sum of salary and supplement hourly rates
- Updates Payroll Document Line fields: --
Calculation logic:
- Calls GetAESalaryByDate (with ByHours = true flag) -- obtains the salary hourly rate.
- Calls GetAEExtraSalaryByDate (with ByHours = true flag) -- obtains the supplement hourly rate.
- Returns the sum of the two values.
Function 550 — Base Salary by Date in LCY (GetSalaryByDateLCY)
What it does: Returns the employee's base salary as of a given date, converted to local currency (LCY). Supports salaries in foreign currencies with automatic exchange rate conversion.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Document Starting Date | Payroll Document Line (Document Starting Date) | Date for which the salary is determined |
| Posting Date | Payroll Document Line (Posting Date) | Date for currency conversion |
Result:
- Returns: Decimal -- salary amount in local currency
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds the effective salary record in the Payroll Element Ledger Entry as of the given date.
- If the salary is in a foreign currency -- converts using the exchange rate as of the posting date.
- For an hourly rate element -- multiplies by the number of working hours from the official calendar for the month.
- For a daily rate element -- multiplies by the number of working days from the official calendar for the month.
- Returns the amount in local currency.
Taxation, Withholding, Salaries by Period, Service, Advances (2002–2301)
Function 2002 — Tax Withholding by Scale (Withholding)
What it does: Calculates the tax withholding amount using a progressive scale (payroll range lines). The primary function for calculating income tax and other taxes that use a rate scale.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Range Header | Determined automatically (GetRangeHeader) | Loaded by element code, type, and range code |
| Range Type | Calculation Line (Range Type) | Range type |
| Range Code | Calculation Line (Range Code) | Range code |
| Taxable Base | Payroll Document Line (Corr. Amount) | Adjusted amount for tax calculation |
Result:
- Returns: Decimal -- withholding amount (returned with a negative sign; the function call inverts the sign)
- Updates Payroll Document Line fields: Directory Code -- if the range line contains a directory code
Calculation logic:
- Determines the sign of the taxable base (positive or negative).
- Checks whether the element is of type "Fund" (SSC) -- affects the sort order.
- Filters range lines by element code, range code, and period code.
- Additionally filters by:
- Employee gender (if allowed in the Range Header).
- Date of birth (if age filter is allowed).
- Disability status as of the action start date.
- Finds the last line where "Amount Over" is less than the absolute value of the base.
- If no line is found for disabled employees -- removes the disability filter and searches again.
- If no line is found at all -- returns 0.
- Formula: Tax Amount = Fixed Tax Amount + (Taxable Base - Sign Amount Over) Tax Percentage / 100
- If the result < 0 and the document is not a correction -- returns 0.
- If a maximum withholding is set and the result exceeds it -- caps the result.
- If the range line has a directory code -- updates the "Directory Code" field on the document line.
- Returns the withholding amount.
Function 2003 — Year-to-Date Taxable Amount (YTDTaxableAmount)
What it does: Returns the taxable amount (Taxable Amount) from the Payroll Ledger Entry for the period from the first period of the year to the previous period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Element Type | Payroll Document Line (Element Type) | Automatically |
| Posting Type | Payroll Document Line (Posting Type) | Automatically |
| Element Code | Payroll Document Line (Element Code) | Automatically |
Result:
- Returns: Decimal -- taxable amount from the beginning of the year to the previous period
- Updates Payroll Document Line fields: --
Calculation logic:
- Filters the ledger entries by employee, element type, posting type, and element code.
- Sets the payroll period filter from the first period of the year to the previous period (not including the current one).
- Uses the FlowField "SMA Taxable Amount" for summing.
- Returns the result.
Function 2005 — Year-to-Date Payroll Amount (YTDPayrollAmount)
What it does: Returns the payroll accrual amount (Payroll Amount) from the ledger entries for the period from the first period of the year to the previous period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Element Type | Payroll Document Line (Element Type) | Automatically |
| Posting Type | Payroll Document Line (Posting Type) | Automatically |
| Element Code | Payroll Document Line (Element Code) | Automatically |
Result:
- Returns: Decimal -- payroll amount from the beginning of the year to the previous period
- Updates Payroll Document Line fields: --
Calculation logic:
- Filters the ledger entries by employee, element type, posting type, and element code.
- Sets the payroll period filter from the first period of the year to the previous period.
- Uses the FlowField "SMA Payroll Amount" for summing.
- Returns the result.
Function 2036 — Adjusted Amount for Previous Period (YTDTypeAmount)
What it does: Returns the correction amount (Corr. Amount) from the Payroll Ledger Entry for the previous period. Used to retrieve correction amounts that need to be carried forward to the current period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Element Type | Payroll Document Line (Element Type) | Automatically |
| Element Code | Payroll Document Line (Element Code) | Automatically |
Result:
- Returns: Decimal -- correction amount for the previous period
- Updates Payroll Document Line fields: --
Calculation logic:
- Filters the ledger entries by employee, element type, and element code.
- Sets the payroll period filter to exactly the previous period.
- Uses the FlowField "SMA Corr. Amount" for summing.
- Returns the result.
Function 2070 — Starting Balance (GetStartingBalance)
What it does: Returns the closing balance of the previous month, representing the employee's outstanding debt or overpayment. Used for tracking employee debt/advance.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
Result:
- Returns: Decimal -- starting balance (with inverted sign)
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the Employee Card.
- Sets the date filter from the beginning to the day before the start of the current payroll period.
- Calculates the FlowField "SMA Net Change (LCY)" (net balance in local currency).
- Returns the negative value of the balance (inverts the sign): -Employee."SMA Net Change (LCY)".
Function 2100 — Timesheet Hours by Time Activity Group (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Actual Hours".
What it does: Returns the number of hours from the timesheet for the specified time activity group by period code.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Time Activity Group | Calculation Line (Time Activity Group) | Group for filtering |
Result:
- Returns: Decimal -- number of hours from the timesheet
- Updates Payroll Document Line fields: --
Function 2101 — Timesheet Days by Time Activity Group (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Actual Working Days".
What it does: Returns the number of days from the timesheet for the specified time activity group by period code.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Time Activity Group | Calculation Line (Time Activity Group) | Group for filtering |
Result:
- Returns: Decimal -- number of days from the timesheet
- Updates Payroll Document Line fields: --
Function 2102 — Calendar Days in Period (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Calendar Days" and filter "By Period Code".
What it does: Returns the number of calendar days in the payroll period from the production calendar.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Automatically | Uses the employee's calendar and payroll period dates |
Result:
- Returns: Decimal -- number of calendar days in the period
- Updates Payroll Document Line fields: --
Function 2103 — Working Days in Year (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Working Days" and filter "In Current Year".
What it does: Returns the number of working days from the production calendar for the entire year.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Automatically | Uses the employee's calendar, dates from the first period of the year to the end of the year |
Result:
- Returns: Decimal -- number of working days in the year
- Updates Payroll Document Line fields: --
Function 2104 — Working Days in Period (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Working Days" and filter "By Period Code".
What it does: Returns the number of working days from the production calendar for the payroll period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Automatically | Uses the employee's calendar and payroll period dates |
Result:
- Returns: Decimal -- number of working days in the period
- Updates Payroll Document Line fields: --
Function 2105 — Working Hours in Period (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Working Hours" and filter "By Period Code".
What it does: Returns the number of working hours from the production calendar for the payroll period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Automatically | Uses the employee's calendar and payroll period dates |
Result:
- Returns: Decimal -- number of working hours in the period
- Updates Payroll Document Line fields: --
Function 2106 — Working Hours in Year (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Working Hours" and filter "In Current Year".
What it does: Returns the number of working hours from the production calendar for the entire year.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Automatically | Uses the employee's calendar, dates from the first period of the year to the end of the year |
Result:
- Returns: Decimal -- number of working hours in the year
- Updates Payroll Document Line fields: --
Function 2107 — Calendar Days at Intersection of Action Dates and Period (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Calendar Days" and filter "By Intersection Dates".
What it does: Returns the number of calendar days at the intersection of the document line's action dates and the payroll period dates.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Action Starting Date | Payroll Document Line (Action Starting Date) | Automatically |
| Action Ending Date | Payroll Document Line (Action Ending Date) | Automatically |
Result:
- Returns: Decimal -- number of calendar days at the intersection
- Updates Payroll Document Line fields: --
Calculation logic:
- Determines the start date as the maximum of the action start date and the period start.
- Determines the end date as the minimum of the action end date and the period end.
- Returns the number of calendar days for this range.
Function 2108 — Working Hours at Intersection of Action Dates and Period (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Working Hours" and filter "By Intersection Dates".
What it does: Returns the number of working hours at the intersection of the document line's action dates and the payroll period dates.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Action Starting Date | Payroll Document Line (Action Starting Date) | Automatically |
| Action Ending Date | Payroll Document Line (Action Ending Date) | Automatically |
Result:
- Returns: Decimal -- number of working hours at the intersection
- Updates Payroll Document Line fields: --
Calculation logic:
- Determines the start date as the maximum of the action start date and the period start.
- Determines the end date as the minimum of the action end date and the period end.
- Returns the number of working hours for this range (CalendarMgt.GetPeriodInfo, What=3).
Function 2110 — Fill Average Earnings Data (FillDocLineAEData)
What it does: The main entry point for average earnings calculation. Populates the "Payroll Document Line Average Earnings" and "Payroll Average Earnings Period" tables. Determines the average earnings calculation setup depending on the document type (vacation, sick leave, business trip, etc.).
Parameters:
| Parameter | Source | Description |
|---|---|---|
| AE Setup Code | Calculation Line (AE Setup Code) | Optional. Code of the specific AE setup. If not specified, determined automatically by document type |
Result:
- Returns: Decimal -- calculated average earnings
- Updates Payroll Document Line fields: Average earnings data (AE Daily Earnings, AE Hourly Earnings), AE Period (AE Period From, AE Period To)
Calculation logic:
- Validates the required action start date and element code.
- Deletes previous average earnings records and AE periods for this line.
- Determines the AE calculation type by document type:
- Vacation -- "Vacation" (or "Vacation Compensation" for compensation).
- Sick leave -- "Sick Leave", "Child Care 1", "Child Care 2", or "Pregnancy Leave" depending on the sick leave type.
- Other absence or business trip -- "Others".
- Finds the latest applicable AE setup by type and period.
- Populates the periods and average earnings amounts according to the settings.
- Returns the calculated average earnings.
Function 2111 — Maximum Sick Leave Daily Payment (GetMaxDailyPayment)
What it does: Returns the maximum daily average earnings value for sick leave calculation. The value is taken from the sick leave settings.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Automatically | Uses the sick leave type and action start date |
Result:
- Returns: Decimal -- maximum average earnings
- Updates Payroll Document Line fields: --
Calculation logic:
- Searches the "Sick Leave Setup" table for entries with type "Salary Limits".
- Filters by sick leave type and action start date.
- Returns the "Maximal Average Earning" field value.
Function 2112 — Minimum Sick Leave Wage Amount (GetMinWageAmount)
What it does: Returns the maximum accrual amount for sick leave based on the employee's insurance service length. The value is taken from the sick leave settings.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Automatically | Uses the sick leave type and service length |
Result:
- Returns: Decimal -- maximum (capping) accrual amount
- Updates Payroll Document Line fields: --
Calculation logic:
- Searches the "Sick Leave Setup" table for the corresponding record.
- Takes the employee's insurance service length into account to determine the threshold.
- Returns the "Maximal Wage Amount" field value (maximum payroll amount for sick leave).
Function 2113 — Salary for Previous Period (GetSalaryPrevPeriod)
What it does: Returns the accrual amount for salary elements from the previous payroll period. Used for comparison or indexation calculation.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
Result:
- Returns: Decimal -- salary amount for the previous period
- Updates Payroll Document Line fields: --
Calculation logic:
- Determines the previous payroll period (offset -1 from the current).
- Filters the ledger entries by employee, previous period, and salary element filter.
- The element filter is composed from HR Setup: "Daily Rate Element Code" + "Hourly Rate Element Code" + "Flat Rate Element Code" + "Hourly Wage Element Code" + "Daily Wage Element Code".
- Uses the FlowField "SMA Payroll Amount" for summing.
- Returns the amount. If the previous period does not exist, returns 0.
Function 2114 — Calendar Days in Wage Period (DEPRECATED)
DEPRECATED. Replaced by Function 100 (CalcTimeMeasure) with type "Planned Calendar Days" and filter "By Wage Period Code".
What it does: Returns the number of calendar days in the wage period from the production calendar.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Automatically | Uses the employee's calendar and wage period dates |
Result:
- Returns: Decimal -- number of calendar days in the wage period
- Updates Payroll Document Line fields: --
Function 2220 — Base Salary for Period (GetBaseSalary)
What it does: Returns the weighted average base salary of the employee for the payroll period, accounting for rate changes during the period. If the salary changed within the period, it is calculated proportionally by working days.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Payroll Period | System variable (PayrollPeriod) | Current payroll period |
Result:
- Returns: Decimal -- weighted average salary for the period
- Updates Payroll Document Line fields: --
Calculation logic:
- Builds the salary element filter from HR Setup: "Daily Rate Element Code", "Hourly Rate Element Code", "Flat Rate Element Code".
- Finds all Payroll Element Ledger Entry records effective during the period.
- For each record, determines the actual date range within the period (takes the maximum of the action start date and the period start; minimum of the action end date and the period end).
- Calculates the number of working days for each record (CalendarMgt.GetPeriodInfo, What=2).
- Sums the total number of working days.
- Formula: Salary = Sum(Record Amount * Record Working Days / Total Working Days)
- Returns the weighted average salary amount.
Function 2221 — Extra Salary for Period (GetExtraSalary)
What it does: Returns the weighted average amount of additional payments (supplements) that depend on the salary element, for the payroll period. Analogous to Function 2220, but for elements with the "Depends on Salary Element" field.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
| Payroll Period | System variable (PayrollPeriod) | Current payroll period |
Result:
- Returns: Decimal -- weighted average supplement amount for the period
- Updates Payroll Document Line fields: --
Calculation logic:
- Builds the salary element filter (analogous to Function 2220).
- Finds all payroll elements where the "Depends on Salary Element" field references one of the salary elements.
- For each found supplement element, searches for effective records in the ledger entries.
- Calculates the weighted average amount by working days analogous to Function 2220.
- Returns the result.
Function 2230 — Salary Pay by Hours (GetSalaryPay by Hours)
What it does: Calculates the accrual amount as the monthly salary multiplied by the ratio of actually worked hours to planned hours. The primary function for hourly payroll calculation.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Time Activity Group | Calculation Line (Time Activity Group) | Group for determining actual hours from the timesheet |
| Parameter Code | Calculation Line (Parameter Code) | Optional. If specified, can enable dimension filtering |
Result:
- Returns: Decimal -- accrual amount = Salary * Actual Hours / Planned Hours
- Updates Payroll Document Line fields: Planned Hours, Actual Hours
Calculation logic:
- Retrieves the salary amount from the Payroll Element Ledger Entry by the line's entry number.
- Calculates planned hours from the production calendar for the period (CalendarMgt.GetPeriodInfo, What=3).
- Calculates actual hours from the timesheet by time activity group and by the line's action dates:
- If dimension filtering is enabled (Use Dimensions Filter) -- filters by shortcut dimensions.
- Writes planned and actual hours to the document line.
- Formula: Result = Salary Amount * Actual Hours / Planned Hours
- Returns the calculated amount.
Function 2232 — Advance Pay by Hours (GetAdvancePay by Hours)
What it does: Calculates the advance amount as salary multiplied by the ratio of actual hours to planned hours, but only up to the advance date. Differs from Function 2230 in that it uses the advance date as the upper boundary.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Time Activity Group | Calculation Line (Time Activity Group) | Group for determining actual hours from the timesheet |
Result:
- Returns: Decimal -- advance amount = Salary * Actual Hours / Planned Hours
- Updates Payroll Document Line fields: Action Starting Date, Action Ending Date, Actual Days, Actual Hours
Calculation logic:
- Builds the hourly salary element filter from HR Setup.
- Finds all salary records effective during the payroll period.
- Checks for the presence of an advance date in the period (Advance Date).
- For each record, determines the date range from the action start (or period start) to the advance date (or action end date).
- Calculates actual hours from the timesheet for this range.
- Calculates planned hours from the calendar for the full period.
- Formula: Advance = Sum(Salary Amount * Actual Hours / Planned Hours)
- Updates the action dates and actual time indicators on the document line.
- Returns the advance amount.
Function 2239 — Salary Pro Rata Calendar (SalaryProRataCalendar)
What it does: Calculates the accrual amount accounting for rate changes during the period, proportional to calendar hours. Handles overlapping salary records by adjusting end dates.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| -- | Automatically | Uses element code, employee code, and payroll period dates |
Result:
- Returns: Decimal -- accrual amount distributed by calendar hours
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds all salary records from the Payroll Element Ledger Entry effective during the period.
- Handles overlapping records: if a previous record has an end date
>=the start date of the next, adjusts the end date to the day before the next record's start. - Calculates the total working hours for the period from the production calendar (HoursWork).
- For each record in the temporary set:
- Determines the date range within the period.
- Calculates the calendar hours for this range (CalendarHours).
- Formula: Portion = (Record Amount / Total Hours) * Record Calendar Hours.
- Sums all portions and returns the result.
Function 2240 — Salary Pay by Days (GetSalaryPay by Days)
What it does: Calculates the accrual amount as the monthly salary multiplied by the ratio of actually worked days to planned days. Analogous to Function 2230, but uses days instead of hours.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Time Activity Group | Calculation Line (Time Activity Group) | Group for determining actual days from the timesheet |
| Parameter Code | Calculation Line (Parameter Code) | Optional. Can enable dimension filtering |
Result:
- Returns: Decimal -- accrual amount = Salary * Actual Days / Planned Days
- Updates Payroll Document Line fields: Planned Days, Actual Days
Calculation logic:
- Retrieves the salary amount from the ledger entries.
- Calculates planned days from the production calendar (CalendarMgt.GetPeriodInfo, What=2).
- Calculates actual days from the timesheet by time activity group and by action dates:
- If dimension filtering is enabled -- filters by shortcut dimensions.
- Writes planned and actual days to the document line.
- Formula: Result = Salary Amount * Actual Days / Planned Days
- Returns the calculated amount.
Function 2241 — Extra Pay by Time Activity Group (GetExtraPay)
What it does: Calculates the surcharge amount based on the salary rate and actually worked hours in the specified time activity group. Used for night, evening, holiday, and other surcharges.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Time Activity Group | Calculation Line (Time Activity Group) | Group for determining actual hours (e.g., night hours) |
Result:
- Returns: Decimal -- surcharge amount = Salary * Actual Group Hours / Total Planned Hours
- Updates Payroll Document Line fields: Planned Hours, Actual Hours
Calculation logic:
- Calculates total planned hours from the timesheet by the work time group from HR Setup (Work Time Group Code).
- Writes planned hours to the document line.
- For each salary record effective during the period:
- Determines the date range within the period.
- Calculates actual hours from the timesheet for the specified time activity group (e.g., night hours).
- Formula: Surcharge += Salary Amount * Actual Group Hours / Planned Hours.
- Accumulates actual group hours.
- Writes actual hours to the document line.
- Returns the total surcharge amount.
Function 2242 — Advance Pay by Days (GetAdvancePay by Days)
What it does: Calculates the advance amount proportional to actually worked days up to the advance date. Analogous to Function 2232, but uses days instead of hours.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Time Activity Group | Calculation Line (Time Activity Group) | Group for determining actual days from the timesheet |
Result:
- Returns: Decimal -- advance amount = Salary * Actual Days / Planned Days
- Updates Payroll Document Line fields: Action Starting Date, Action Ending Date, Actual Days, Actual Hours
Calculation logic:
- Builds the daily salary element filter from HR Setup.
- Finds all salary records effective during the payroll period.
- For each record, determines the date range from the start to the advance date.
- Calculates actual days from the timesheet for this range.
- Calculates planned days from the calendar for the full period.
- Formula: Advance = Sum(Salary Amount * Actual Days / Planned Days)
- Updates the action dates and actual time indicators on the document line.
- Returns the advance amount.
Function 2300 — Service Years (ServiceYears)
What it does: Returns the number of full years of employee service from the employment date to the work date. If service is less than 5 years, returns 0.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
Result:
- Returns: Decimal -- number of full years of service (or 0 if less than 5 years)
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the Employee Card and checks for the presence of Employment Date.
- Calculates the difference between WorkDate and Employment Date:
- Years = Year of WorkDate - Year of Employment Date.
- Months = Month of WorkDate - Month of Employment Date.
- Days = Day of WorkDate - Day of Employment Date.
- Adjusts for negative month and day values (with carry to the previous unit).
- If the number of full years < 5 -- returns 0.
- Otherwise returns the number of full years.
Function 2301 — Labor Contract Type (LaborContractType)
What it does: Checks the employee's labor contract type. Returns 1 for a civil contract (Civil Law Agreement) or 0 for a standard labor contract.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line (Employee No.) | Automatically |
Result:
- Returns: Decimal -- 1 if the contract type is "Civil Contract"; 0 if it is a standard labor contract
- Updates Payroll Document Line fields: --
Calculation logic:
- Retrieves the Employee Card and reads the Contract No.
- Finds the labor contract record.
- Checks the "Contract Type" field.
- If type = "Civil Contract" -- returns 1.
- Otherwise returns 0.
Function 2310 — Fill AE Periods for AE Calc Type = Other
What it does: Fills the average earnings (AE) periods in payroll document line based on the SMA AE Calculation Setup for AE Calc Type = Others . Calculates the AE period as of the date equal to "end of current period ".
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | To obtain period code, employee code |
Result:
- Returns: -- (the function does not return a numeric value)
- Updates Payroll Document Line fields:
- AE Period From -- AE period start
- AE Period To -- AE period end
- Action Starting Date -- date = end of current period
- Action Ending Date -- date = end of current period
- Document Starting Date -- same
- Document Ending Date -- same
- Document Type -- Other Absence
- Wage Period From -- period by action date
- Wage Period To -- period by action date
Calculation logic:
- Creates a temporary absence order line (Absence Line) with type "Other Absence".
- Sets the start date = end of current payroll period.
- Calls AEMgt.FillAbsenceLineAEDates for automatic calculation of AE periods.
- Transfers the calculated dates and AE periods to the payroll document line.
- Fills the wage period.
- If the calculated wage period differs from the current one, initializes the payroll period.
Payroll Calculation Functions (Part 2): Salaries by Date, Sick Leave, Indexation, Currency (21094000–21094050)
Functions for salary lookup by date, sick leave calculation, indexation coefficients, and currency operations.
Codeunit: PayrollDocumentCalculate Number range: 21094000 – 21094050
Function 21094000 -- Salary as of Date
What it does: Returns the employee's monthly salary amount effective as of the document starting date. Finds the active record in the Payroll Element Ledger Entry for salary elements defined in HR Setup.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line: "Employee No." | Employee code for whom the salary is looked up |
| Starting Date | Payroll Document Line: "Document Starting Date" | Date on which the effective salary is determined |
Result:
- Returns: Salary amount (Decimal). For hourly rate -- the amount multiplied by planned hours per month. For daily rate -- the amount multiplied by working days per month.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads HR Setup.
- In the Payroll Element Ledger Entry table, searches for an entry for the employee filtered by salary element codes (daily salary element code / hourly salary element code / lump-sum / hourly rate / daily rate from HR Setup).
- Filters entries: "Starting Date"
<=parameter date, "Ending Date">=parameter date or is blank. - Returns the "Amount" field from the found entry.
- If the element is an hourly rate, multiplies the amount by the planned working hours of the month from the Official Calendar.
- If the element is a daily rate, multiplies the amount by the working days of the month from the Official Calendar.
Function 21094001 -- Average Salary for Period
What it does: Calculates the average salary over a specified date range. For each working day according to the payroll calendar, calls GetSalaryByDate and computes the arithmetic mean.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line: "Employee No." | Employee code |
| Starting Date | Payroll Document Line: "Action Starting Date" | Start of the date range |
| Ending Date | Payroll Document Line: "Action Ending Date" | End of the date range |
Result:
- Returns: Average salary for the period (Decimal). Formula: sum of salaries for all working days / number of working days.
- Updates Payroll Document Line fields: --
Calculation logic:
- Determines the employee's payroll calendar via the Employee Job Entry table.
- Filters payroll calendar lines (Payroll Calendar Line) within the date range, working days only (Nonworking = false).
- For each working day, calls GetSalaryByDate (function 21094000) and totals the salary amounts.
- If working days = 0, returns 0.
- Returns: total amount / number of working days.
Function 21094002 -- Average Daily Salary as of Date (for Average Earnings)
What it does: Returns the average daily salary as of the specified date for average earnings calculation. Divides the monthly salary by the number of working days in the month according to the employee's payroll calendar.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line: "Employee No." | Employee code |
| Starting Date | Payroll Document Line: "Action Starting Date" | Date on which the average daily salary is calculated |
Result:
- Returns: Average daily salary (Decimal). Formula: Salary Amount / Number of working days in the month per employee calendar.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads HR Setup and finds the effective salary record from the Payroll Element Ledger Entry.
- Divides the salary amount by the number of working days in the month according to the employee's payroll calendar (CalendarMgt.GetPeriodInfo with type 2 -- working days).
- For hourly rate: multiplies the result by the planned hours from the Official Calendar.
- For daily rate: multiplies the result by the working days from the Official Calendar.
Function 21094003 -- Average Additional Salary as of Date
What it does: Returns the amount of average daily supplementary payments (allowances) that depend on the base salary, as of the specified date. Used for average earnings calculation.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line: "Employee No." | Employee code |
| Starting Date | Payroll Document Line: "Action Starting Date" | Date on which allowances are determined |
Result:
- Returns: Sum of supplementary payments (allowances) per working day (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads HR Setup and builds a salary element filter.
- In the Payroll Element table, finds all elements where "Depends on Salary Element" is populated with salary element codes.
- Builds a filter from the found element codes.
- In the Payroll Element Ledger Entry table, finds active entries for these elements as of the date.
- For each found entry: divides the amount by the number of working days in the month per payroll calendar.
- Totals all average daily amounts and returns the result.
Function 21094004 -- Earnings as of Date
What it does: Returns the total average daily earnings as of the specified date -- the sum of average salary and average supplementary payments. Equivalent to the sum of functions 21094002 + 21094003.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line: "Employee No." | Employee code |
| Starting Date | Payroll Document Line: "Action Starting Date" | Date on which earnings are determined |
Result:
- Returns: Total average daily earnings (Decimal) = average daily salary + average daily allowances.
- Updates Payroll Document Line fields: --
Calculation logic:
- Calls GetAESalaryByDate (function 21094002) to obtain the average daily salary.
- Calls GetAEExtraSalaryByDate (function 21094003) to obtain the average daily allowances.
- Returns the sum of the two values.
Function 21094005 -- Planned Working Days
What it does: Calculates the number of planned working days for a specified period, taking into account the employee's employment periods.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line: "Employee No." | Employee code |
| Starting Date | Payroll Document Line: "Action Starting Date" | Start of the date range |
| Ending Date | Payroll Document Line: "Action Ending Date" | End of the date range |
Result:
- Returns: Number of planned working days (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- In the Employee Job Entry table, searches for entries for the employee filtered by "Position Changed" = true.
- Filters by dates: "Starting Date"
<=end of range, "Ending Date">=start of range or is blank. - For each found entry, determines the date intersection with the specified range.
- Reads the number of working days from the payroll calendar (CalendarMgt.GetPeriodInfo, type 2) for each intersection.
- Totals and returns the overall number of working days.
Function 21094006 -- Average Monthly Calendar Days
What it does: Returns the "Average Calendar Days per Month" value from the Sick Leave Setup table. Used in sick leave calculations.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses "Action Starting Date" to find the effective setup |
Result:
- Returns: Average calendar days per month (Decimal), e.g. 30.44.
- Updates Payroll Document Line fields: --
Calculation logic:
- In the Sick Leave Setup table, filters entries: Type = "Salary Limits", "Sick Leave Type" = All.
- Filters by "Starting Date"
<="Action Starting Date" from the document line. - Finds the last effective record.
- Returns the "Average Calendar Days" field value.
Function 21094007 -- Minimum Wage by Document Date (DEPRECATED)
Note: This function is DEPRECATED. It is recommended to use function 150 with the appropriate parameter.
What it does: Returns the minimum wage (MROT) amount from the Payroll Limit table as of the document starting date.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Period Code | Determined automatically from Document Starting Date | Payroll period code used to look up the limit |
| Limit Type | Fixed: MROT | Payroll limit type |
Result:
- Returns: Minimum wage amount (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Determines the payroll period code from the document starting date in the line.
- In the Payroll Limit table, filters entries: Type = MROT, "Payroll Period"
<=period code. - Finds the last effective record and returns the "Amount" field.
Function 21094008 -- Maximum Average Earnings for Sick Leave
What it does: Returns the maximum average earnings amount for sick leave from the Sick Leave Setup table, taking into account the sick leave type.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses "Payroll Elem. Ledger Entry No." to determine the sick leave type and document starting date |
Result:
- Returns: Maximum average earnings (Decimal) from the "Maximal Average Earning" field.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the entry from the Payroll Element Ledger Entry by the entry number from the document line.
- In the Sick Leave Setup table, filters: Type = "Salary Limits", "Sick Leave Type" = type from the entry, "Starting Date"
<=document starting date from the entry. - Finds the last effective record and returns "Maximal Average Earning".
- If not found for the specific sick leave type, searches with "Sick Leave Type" = All.
Function 21094009 -- Maximum Accrual Amount by Length of Service
What it does: Returns the maximum accrual amount for sick leave from the Sick Leave Setup table, taking into account the sick leave type and the employee's insured length of service.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses "Payroll Elem. Ledger Entry No.", "Employee No." |
Result:
- Returns: Maximum accrual amount (Decimal) from the "Maximal Wage Amount" field.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the entry from the Payroll Element Ledger Entry by the entry number from the document line.
- Determines the Employee Job Entry and calculates the employee's insured length of service as of the document starting date from the entry (via CalcEmplInsuredService).
- If years of service = 0, takes months of service / 12.
- In the Sick Leave Setup table, filters: Type = "Salary Limits", "Sick Leave Type" = type from the entry, "Starting Date"
<=date, "Insured Service (Years)"<=calculated service. - Finds the last record and returns "Maximal Wage Amount".
- If not found for the specific sick leave type, searches with "Sick Leave Type" = All.
Function 21094010 -- Insured Service in Months
What it does: Calculates the number of months of insured service over the last 12 months prior to the document starting date. Used to determine the sick leave payment percentage.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses "Employee No.", "Document Starting Date" |
Result:
- Returns: Number of months of insured service (Decimal), maximum 12, rounded down to a whole number.
- Updates Payroll Document Line fields: --
Calculation logic:
- Determines the calculation range: from the beginning of the month 13 months prior to the document starting date, to the last day of the month preceding the document starting date month.
- If the employee has the "Use Data for Insured Service Calculation" flag set, calls CalcEmplInsServInsByInsPeriod (calculation using the Data on Insurance Period table).
- Otherwise, calls CalcEmplInsServByPeriod (calculation based on the employment record book).
- Additionally calls CalcEmplInsServInsData for the total service from the start to the document date.
- Caps the result: no more than 12 months.
- If the calculated 12-month service exceeds the total service, uses the total service.
- Rounds the result down to a whole number (Round,
<).
Function 21094011 -- 31 for Sick Leave
What it does: Returns 31 if the action ending date falls on the 31st day of the month, otherwise returns 0. Used in average daily earnings calculation for sick leave (month length adjustment).
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses "Action Ending Date" |
Result:
- Returns: 31 or 0 (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Checks whether the day of the month in the "Action Ending Date" field equals 31.
- If yes -- returns 31.
- If no -- returns 0.
Function 21094012 -- Indexation Coefficient (by Salary Change)
What it does: Calculates the weighted average indexation coefficient for a period, taking into account salary changes under the labor contract. Finds labor contract lines of type "Transfer" and calculates the coefficient based on the salary change.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Document Starting Date", "Action Ending Date" |
Result:
- Returns: Weighted average indexation coefficient (Decimal). Default = 1 (no indexation).
- Updates Payroll Document Line fields: --
Calculation logic:
- Initial coefficient value = 1.
- Finds the employee's labor contract.
- Searches for labor contract lines with status "Approved" in the range from document starting date to action ending date.
- If the last line has operation type "Transfer":
- Finds contract terms (Labor Contract Terms) for salary elements.
- If the raise coefficient limitation is enabled and the coefficient value = 0, returns 1.
- If the coefficient value is populated, uses it directly.
- Otherwise, calculates the indexation coefficient using the salary change formula.
- Calculates the weighted average coefficient for the period: ((days before change) + (days after change * coefficient)) / (total days in period).
Function 21094013 -- Currency Exchange Rate
What it does: Returns the currency exchange rate from the Payroll Element Ledger Entry as of the action ending date of the payroll document line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Payroll Elem. Ledger Entry No.", "Action Ending Date" |
Result:
- Returns: Currency exchange rate (Decimal). If the entry is not found, returns 1.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the entry from the Payroll Element Ledger Entry by the entry number from the document line.
- If the entry is not found, returns 1 (no conversion).
- Returns the currency exchange rate (ExchangeRate) as of the "Action Ending Date" for the currency from the entry.
Function 21094014 -- Salary for Wage Period (Hourly)
What it does: Calculates the salary amount proportional to the hours worked. Similar to function 2230, but uses Wage Period dates instead of Period Code. Updates planned and actual hours on the document line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Wage Period From", "Employee No.", "Payroll Elem. Ledger Entry No." |
| Time Activity Group | Payroll Document Line Calc: "Time Activity Group" | Time activity filter for the timesheet |
Result:
- Returns: Salary amount proportional to hours worked (Decimal). Formula: Amount * Actual Hours / Planned Hours.
- Updates Payroll Document Line fields: "Planned Hours", "Actual Hours".
Calculation logic:
- Determines the start and end dates of the Wage Period by the Wage Period From code.
- Reads the entry from the Payroll Element Ledger Entry by the entry number.
- Planned Hours = working hours from the payroll calendar in the Wage Period.
- Actual Hours = hours from the timesheet filtered by time activity group within the action date range.
- Writes "Planned Hours" and "Actual Hours" values to the document line.
- If planned hours = 0, raises an error.
- Reads the amount from the original payroll ledger entry (Orig. Payroll Ledger Entry No.) and returns: Amount * Actual Hours / Planned Hours.
Function 21094015 -- Salary for Wage Period (Daily)
What it does: Calculates the salary amount proportional to the days worked. Similar to function 2240, but uses Wage Period dates instead of Period Code. Updates planned and actual days on the document line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Wage Period From", "Employee No.", "Payroll Elem. Ledger Entry No." |
| Time Activity Group | Payroll Document Line Calc: "Time Activity Group" | Time activity filter for the timesheet |
Result:
- Returns: Salary amount proportional to days worked (Decimal). Formula: Amount * Actual Days / Planned Days.
- Updates Payroll Document Line fields: "Planned Days", "Actual Days".
Calculation logic:
- Determines the start and end dates of the Wage Period by the Wage Period From code.
- Reads the entry from the Payroll Element Ledger Entry by the entry number.
- Planned Days = working days from the payroll calendar in the Wage Period.
- Actual Days = days from the timesheet filtered by time activity group within the action date range.
- Writes "Planned Days" and "Actual Days" values to the document line.
- If planned days = 0, raises an error.
- Reads the amount from the original payroll ledger entry and returns: Amount * Actual Days / Planned Days.
Function 21094016 -- Hours from Timesheet for Wage Period (DEPRECATED)
Note: This function is DEPRECATED. Replaced by function 100 with the appropriate parameter code.
What it does: Returns the number of hours from the timesheet filtered by time activity group within the Wage Period date range.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses Wage Period dates |
| Time Activity Group | Payroll Document Line Calc: "Time Activity Group" | Time activity filter |
Result:
- Returns: Number of hours from the timesheet (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Calls TimesheetMgt.GetTimeSheetData with parameters: document line, type = 1 (hours), time activity group, use Wage Period = true.
Function 21094017 -- Days from Timesheet for Wage Period (DEPRECATED)
Note: This function is DEPRECATED. Replaced by function 100 with the appropriate parameter code.
What it does: Returns the number of days from the timesheet filtered by time activity group within the Wage Period date range.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses Wage Period dates |
| Time Activity Group | Payroll Document Line Calc: "Time Activity Group" | Time activity filter |
Result:
- Returns: Number of days from the timesheet (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Calls TimesheetMgt.GetTimeSheetData with parameters: document line, type = 0 (days), time activity group, use Wage Period = true.
Function 21094018 -- Taxable Amount YTD by Wage Period
What it does: Returns the accumulated taxable amount (Taxable Amount) from the beginning of the year for the specified element. Uses Wage Period for filtering. Can calculate for either an employee or a person.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Element Type", "Posting Type", "Element Code", "Wage Period From" |
Result:
- Returns: Taxable amount (Decimal) from the Payroll Ledger Entry year-to-date.
- Updates Payroll Document Line fields: --
Calculation logic:
- On the Employee table, sets filters: by employee code (or "Person No." for person-level calculation), element type, posting type, element code.
- Sets the "Wage Period Filter" = Wage Period From value from the document line.
- Calculates the FlowField "Taxable Amount" and returns the result.
Function 21094019 -- Payroll Amount YTD by Wage Period
What it does: Returns the accumulated payroll amount (Payroll Amount) from the beginning of the year for the specified element. Uses Wage Period for filtering.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Element Type", "Posting Type", "Element Code", "Wage Period From" |
Result:
- Returns: Payroll amount (Decimal) from the Payroll Ledger Entry year-to-date.
- Updates Payroll Document Line fields: --
Calculation logic:
- On the Employee table, sets filters: by employee code, element type, posting type, element code.
- Sets the "Wage Period Filter" = Wage Period From value from the document line.
- Calculates the FlowField "Payroll Amount" and returns the result.
Function 21094020 -- Scale-Based Deduction by Period Code
What it does: Calculates the deduction (tax) amount using a payroll range scale, using Period Code to find the range header. Extended version of function 2002 with period code-based range lookup.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Element Code", "Corr. Amount", "Employee No.", "Period Code" |
| Range Header | Determined automatically | Payroll range header by element code and period |
Result:
- Returns: Deduction amount with a negative sign (Decimal). Formula: -(Tax Amount + (Corr. Amount - Over Amount) * Tax Rate / 100).
- Updates Payroll Document Line fields: "Rate" = tax rate %, "Directory Code", "Dimension Set ID" -- merged with dimensions from the range line.
Calculation logic:
- Finds the payroll range header (Range Header) by element code and period code.
- Filters range lines (Range Line) by element code, range code, period code from the header.
- Based on header settings, additionally filters: by employee gender, by date of birth, by disability status as of the wage period ending date.
- Filters "Over Amount" < absolute value of Corr. Amount from the document line.
- If not found -- sequentially clears filters by disability and "Over Amount".
- Calculates: Tax Amount + (Corr. Amount - Sign Over Amount) Tax Rate / 100.
- If there is a "Max Deduction" and the result exceeds it -- caps the result.
- Writes the rate to the "Rate" field of the document line.
- If the range line has a "Directory Code" populated, updates the field on the document line.
- If the range line has a dimension set, merges it with the document line's dimension set.
- Returns the result with a negative sign.
Function 21094021 -- Scale-Based Deduction by Wage Period
What it does: Same as function 21094020, but uses the Wage Period code (Wage Period From) instead of Period Code to find the payroll range header.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Element Code", "Corr. Amount", "Employee No.", "Wage Period From" |
Result:
- Returns: Deduction amount with a negative sign (Decimal).
- Updates Payroll Document Line fields: "Rate", "Directory Code", "Dimension Set ID".
Calculation logic:
- Same as function 21094020, but the range header is filtered by "Period Code" in the range from the first payroll period to Wage Period From from the document line.
Function 21094022 -- Amount from Range by Period Code
What it does: Returns the amount from a payroll range line filtered by period code. Unlike the deduction functions (21094020/21094021), simply returns the "Amount" field from the found range line without calculating the tax formula.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Element Code", "Period Code", "Employee No." |
| Parameter Code | Payroll Document Line Calc: "Parameter Code" | Determines the period filter type (by period code, by wage period, by payment period) |
Result:
- Returns: Amount from the range line (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds the payroll range header (Range Header) by element code.
- If "Parameter Code" is specified, determines the period filter type from the Calc. Function Parameter table:
- By Period Code
- By Wage Period Code
- By Payment Period
- Finds the last effective range header.
- Filters range lines by employee gender, date of birth, and disability status.
- Finds the last line and returns the "Amount" field.
Function 21094023 -- Amount from Range by Wage Period
What it does: Same as function 21094022, but uses Wage Period (Wage Period From) to filter the range header.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Element Code", "Wage Period From", "Employee No." |
| Parameter Code | Payroll Document Line Calc: "Parameter Code" | Determines the period filter type |
Result:
- Returns: Amount from the range line (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Same as function 21094022, but the range header is filtered by "Period Code" in the range from the first payroll period to Wage Period From from the document line.
Function 21094024 -- Taxable Amount from Document (DEPRECATED)
Note: This function is DEPRECATED. It is recommended to use function 220 or 21094030.
What it does: Returns the base amount (taxable) from the current payroll document lines according to the base amount settings.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Element Code", "Document No." |
| Base Amount Code | Payroll Document Line Calc: "Base Amount Code" | Code for lookup in the Payroll Base Amount table |
Result:
- Returns: Amount from the current document lines (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Calls the standard BaseAmount function with parameters: document line, base amount code.
- Filters are applied based on the Payroll Base Amount table settings.
Function 21094025 -- Set FSI Payment Source
What it does: Sets the "Payment Source" field to "FSI" (Fund of Social Insurance) on the payroll document line. This is a side-effect function that always returns 0.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | The "Payment Source" field is modified |
Result:
- Returns: 0 (always).
- Updates Payroll Document Line fields: "Payment Source" = FSI.
Calculation logic:
- Sets PayrollDocLine."Payment Source" := FSI.
- Returns 0.
Function 21094026 -- Minimum Wage by Wage Period (DEPRECATED)
Note: This function is DEPRECATED. It is recommended to use function 150 with the appropriate parameter.
What it does: Returns the minimum wage (MROT) amount from the Payroll Limit table by the Wage Period code.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Wage Period | Payroll Document Line: "Wage Period From" | Wage Period code for filtering |
| Limit Type | Fixed: MROT | Payroll limit type |
Result:
- Returns: Minimum wage amount (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- In the Payroll Limit table, filters entries: Type = MROT, "Payroll Period"
<=Wage Period From. - Finds the last effective record and returns the "Amount" field.
Function 21094027 -- SSC Limit by Wage Period (DEPRECATED)
Note: This function is DEPRECATED. It is recommended to use function 150 with the appropriate parameter.
What it does: Returns the maximum SSC (Social Security Contribution) assessment base from the Payroll Limit table by the Wage Period code.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Wage Period | Payroll Document Line: "Wage Period From" | Wage Period code for filtering |
| Limit Type | Fixed: SSC Limit | Payroll limit type |
Result:
- Returns: SSC limit amount (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- In the Payroll Limit table, filters entries: Type = "SSC Limit", "Payroll Period"
<=Wage Period From. - Finds the last effective record and returns the "Amount" field.
Function 21094028 -- Salary Change
What it does: Calculates the difference between the current and previous salary (including allowances that depend on the salary) from labor contract lines. Used for indexation accrual.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Element Code | Payroll Document Line: "Element Code" | Payroll element code |
| Base Amount Code | Payroll Document Line Calc: "Base Amount Code" | Used to determine the date filter |
| Employee No. | Payroll Document Line: "Employee No." | Employee code |
| Starting Date | Payroll Document Line: "Action Starting Date" | Date for finding the contract line |
| Period Code | Payroll Document Line: "Period Code" | Period code |
Result:
- Returns: Salary increase amount (Decimal) = Current Salary - Previous Salary. If there is a decrease or a position change -- returns 0.
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds the employee's labor contract.
- Searches for labor contract lines with type "Hire" or "Transfer", status = "Approved".
- Filters by the effective date (determined via base amount and period code).
- For the found line, determines the current position.
- Finds labor contract terms (Contract Terms) for salary elements -- obtains the current salary, divides by position rate.
- For hourly/daily rate, converts to the monthly equivalent.
- Adds allowance amounts from the Payroll Element Ledger Entry that depend on the salary.
- Moves to the previous contract line (previous assignment).
- Compares positions: if the date
>=01.12.2015 and the Job Title Code has changed, returns 0. - Calculates the previous salary in the same way as steps 5-7.
- If the previous salary < the current salary, returns the difference. Otherwise returns 0.
Function 21094029 -- Indexation Coefficient
What it does: Returns the indexation percentage from the Indexation Indices table. Finds a record by Wage Period and the indexation base month from the linked payroll element entry.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Payroll Elem. Ledger Entry No." |
| Wage Period | Payroll Document Line: "Wage Period From" | Wage Period code for looking up the index |
Result:
- Returns: Indexation percentage (Decimal), rounded to 0.1.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the entry from the Payroll Element Ledger Entry by the entry number from the document line.
- Determines the "Indexation Base Month" from the entry.
- In the Indexation Indices (Indexes) table, finds a record by the Wage Period code and the base month.
- Returns the "Percent" field value, rounded to 0.1.
Function 21094030 -- Base Amount with Detail
What it does: Similar to function 220 (BaseAmount), but additionally creates detail records in the Detailed Base for Tax table. Used for tax calculations where it is necessary to know which specific lines (elements) formed the base.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Element Code", "Document No.", "Wage Period From" |
| Base Amount Code | Payroll Document Line Calc: "Base Amount Code" | Code for lookup in the Payroll Base Amount table. Required field. |
Result:
- Returns: Base amount (Decimal) from the current document lines.
- Updates Payroll Document Line fields: --
- Creates records: in the Detailed Base for Tax table for each line included in the base.
Calculation logic:
- Checks that "Base Amount Code" is mandatory.
- Filters the current document lines by Payroll Base Amount settings: element type filter, element code filter, PIT base filter, SSC base filter.
- By "Period Filter" from the base amount:
- By Period Code -- filters by Period Code.
- By Wage Period Code -- filters by Wage Period From.
- By Action Dates / By Fit Dates -- filters by action dates.
- For each found document line:
- Checks that the line is not fully paid (Payroll Amount - Paid Amount > 0).
- Checks that the PIT/SSC base corresponds to the Wage Period.
- Adds the amount to the result.
- Creates a record in the Detailed Base for Tax table with information about the base document, element code, tax type, and amount.
Function 21094031 -- Update Tax Deduction Code
What it does: Similar to function 21094030, but additionally updates the "Tax Deduction Code" field on the payroll document line, taking the value from the first found base line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | The "Tax Deduction Code" field is modified |
| Base Amount Code | Payroll Document Line Calc: "Base Amount Code" | Code for lookup in the Payroll Base Amount table. Required field. |
Result:
- Returns: -- (procedure with no return value).
- Updates Payroll Document Line fields: "Tax Deduction Code" = "Directory Code" value from the first base line.
Calculation logic:
- Checks that "Base Amount Code" is mandatory.
- Filters the current document lines by Payroll Base Amount settings (same as function 21094030).
- Finds the first line matching the filters.
- Writes the "Directory Code" field value from that line to the "Tax Deduction Code" field of the payroll document line.
Function 21094032 -- Distribute Tax Amount (Payroll Amount)
What it does: Distributes the payroll amount (Payroll Amount) from the payroll document line proportionally across the Detailed Base for Tax records. Used after tax calculation (by functions 21094020/21094021) to determine what portion of the tax corresponds to each base line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Document No.", "Line No.", "Payroll Amount" |
Result:
- Returns: 0 (always).
- Updates Payroll Document Line fields: --
- Updates records: in the Detailed Base for Tax table -- the "Deduction Amount" field.
Calculation logic:
- Finds all Detailed Base for Tax records for this document line.
- Filters records with a non-zero "Payroll Amount".
- Calculates the total base (WholeBaseForTax) -- the sum of the "Payroll Amount" field across all records.
- If total base = 0, returns 0.
- For each record, calculates: "Deduction Amount" = round(Total Tax Amount * Line Base Amount / Total Base).
- For the last record, assigns the remainder (to avoid rounding errors).
Function 21094033 -- Distribute Corr. Amount
What it does: Similar to function 21094032, but distributes the Corr. Amount instead of the payroll amount.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Document No.", "Line No.", "Corr. Amount" |
Result:
- Returns: 0 (always).
- Updates Payroll Document Line fields: --
- Updates records: in the Detailed Base for Tax table -- the "Corr. Amount" field.
Calculation logic:
- Finds all Detailed Base for Tax records for this document line.
- Calculates the total base.
- For each record: "Corr. Amount" = round(Total Corr. Amount * Line Base Amount / Total Base).
- For the last record, assigns the remainder.
Function 21094034 -- Populate Insured Service Data
What it does: Creates records in the Data on Insurance Period table for subsequent use in insured service calculation and reporting.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Wage Period From", "Document No.", "Line No.", "Corr. Amount", "Action Starting Date", "Action Ending Date" |
Result:
- Returns: -- (procedure with no return value).
- Updates Payroll Document Line fields: --
- Creates records: in the Data on Insurance Period table.
Calculation logic:
- Checks that the calculation group is not inter-period (type = Between); if so -- exits without action.
- Creates a new record in the Data on Insurance Period table with fields:
- "Employee No.", "Wage Period", "Document No.", "Line No.".
- "Base Amount" = Corr. Amount from the document line.
- "Minimum Wage Amount" = minimum wage for the Wage Period (via GetFSILimit).
- "Period Inclusion Coefficient" = Base Amount / Minimum Wage Amount, rounded to 0.01 (maximum 1).
- "Action Starting Date", "Action Ending Date" from the document line.
- "Calculation" flag = true.
Function 21094035 -- Service with Insurance Data
What it does: Calculates the number of months of insured service for a period (similar to function 21094010), but taking into account inclusion coefficients from the Data on Insurance Period table. Extended version of service calculation.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Document Starting Date" |
Result:
- Returns: Number of months of insured service (Decimal) with inclusion coefficients taken into account.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the employee record.
- Determines the calculation range: from the beginning of the month one year prior to the document starting date, to the last day of the preceding month.
- Calls RecOfServiceMgt.CalcEmplInsServInsData -- service calculation taking into account the period inclusion factor from the Data on Insurance Period table.
- Returns the calculated service.
Function 21094036 -- Taxable Amount for Person by Wage Period
What it does: Returns the accumulated taxable amount (Taxable Amount) from the beginning of the year for a person (Person No.) instead of an employee. Used when the same individual works in multiple positions and the total amount across all positions is needed.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Person No.", "Element Type", "Posting Type", "Element Code", "Wage Period From" |
Result:
- Returns: Taxable amount for the person (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Same as function 21094018, but instead of filtering by "Employee No.", sets a filter by "Person No." (Person No. Filter).
- This means the result includes amounts across all positions held by the person.
Function 21094037 -- Service by Insurance Period Data (DEPRECATED)
Note: This function is DEPRECATED. It is recommended to use function 21094035.
What it does: Returns the YTD base amount from the current document.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Payroll document line |
| Base Amount Code | Payroll Document Line Calc: "Base Amount Code" | Code for filtering |
Result:
- Returns: Amount (Decimal).
- Updates Payroll Document Line fields: --
Function 21094038 -- Employment Date Check
What it does: Checks whether the employee's hire date falls within the specified period (and whether the employee was not dismissed before the end of the period). Returns 1 or 0. The period filter type is determined by the function parameter.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No." |
| Parameter Code | Payroll Document Line Calc: "Parameter Code" | Determines the period filter type (by wage period, by period code, by action dates, by fit date, by payment period, by bonus period, in current year) |
Result:
- Returns: 1 if the hire date falls within the start of the period, and the dismissal date (or infinity)
>=end of period; 0 -- otherwise. - Updates Payroll Document Line fields: --
Calculation logic:
- Reads the employee record.
- If "Parameter Code" is specified, reads the period filter type from the Calc. Function Parameter table:
- By Period Code: dates from the payroll period (Period Code).
- By Wage Period Code: first and last working day of the Wage Period per payroll calendar.
- By Action Dates: Action Starting Date.
- By Fit Dates: Action Starting Date and Action Starting Date + 1.
- By Payment Period: dates from the document's payment period.
- By Bonus Period: dates from the "Bonus Period" field.
- In Current Year: from the start to the end of the current year.
- If "Parameter Code" is not filled, the Wage Period is used by default.
- If the dismissal date is not filled, sets 31.12.9999.
- Returns 1 if: Starting Date
>=Hire Date, and Ending Date<=Dismissal Date.
Function 21094039 -- Contract Type Check
What it does: Checks whether the employee's labor contract is an employment contract (not a civil law contract) and whether it is the primary position (not a secondary job). Returns 1 or 0.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses "Employee No." |
Result:
- Returns: 1 if "Contract Type" = "Labor Contract" AND "Work Mode" = "Primary Job"; 0 -- otherwise.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the employee record.
- From the labor contract number on the employee card, reads the labor contract.
- Checks two fields:
- "Contract Type" = "Labor Contract".
- "Work Mode" = "Primary Job".
- If both conditions are met, returns 1. Otherwise -- 0.
Function 21094040 -- Medical Information Check
What it does: Checks whether the employee has a disability status as of the wage period ending date. Returns 1 if the employee is NOT disabled, and 0 if disabled. Used to determine the SSC rate.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Wage Period From" |
Result:
- Returns: 1 if the employee is NOT disabled as of the wage period ending date; 0 if disabled.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the employee record.
- Determines the wage period ending date by the Wage Period From code.
- Checks the disability status as of that date (Employee.SMAIsInvalid).
- If NOT disabled -- returns 1. If disabled -- returns 0.
Function 21094041 -- Corr. Amount for Person YTD (DEPRECATED)
Note: This function is DEPRECATED.
What it does: Returns the amount from the Payroll Ledger Entry year-to-date for a person.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Payroll document line |
| Base Amount Code | Payroll Document Line Calc: "Base Amount Code" | Required field |
Result:
- Returns: Amount from ledger entries (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Checks that "Base Amount Code" is mandatory.
- Calls the YTDBaseAmount function with parameters: document line, base amount code.
Function 21094042 -- Corr. Amount from Document (DEPRECATED)
Note: This function is DEPRECATED. It is recommended to use function 220.
What it does: Returns the base amount from the current payroll document lines according to the base amount settings.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Payroll document line |
| Base Amount Code | Payroll Document Line Calc: "Base Amount Code" | Code for filtering |
Result:
- Returns: Amount from the document lines (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Calls the standard BaseAmount function with parameters: document line, base amount code.
Function 21094043 -- Period Comparison
What it does: Compares the Wage Period code (Wage Period From) with the Period Code of the document line. Used in conditional constructs (IF) to determine whether the current Wage Period is not later than the posting period.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Wage Period From", "Period Code" |
Result:
- Returns: 1 if Wage Period From
<=Period Code; 0 -- otherwise. - Updates Payroll Document Line fields: --
Calculation logic:
- Compares the Wage Period code (Wage Period From) value with the Period Code value.
- If Wage Period
<=Period Code, returns 1. - Otherwise returns 0.
Function 21094044 -- Indexation Threshold (DEPRECATED)
Note: This function is DEPRECATED. It is recommended to use function 150 with the appropriate parameter.
What it does: Returns the indexation threshold (maximum salary amount subject to indexation) from the Payroll Limit table.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Period Code | Payroll Document Line: "Period Code" | Payroll period code |
| Limit Type | Fixed: Indexation Threshold | Payroll limit type |
Result:
- Returns: Indexation threshold amount (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- In the Payroll Limit table, filters entries: Type = "Indexation Threshold", "Payroll Period"
<=Period Code. - Finds the last effective record and returns the "Amount" field.
Function 21094045 -- Subsistence Minimum
What it does: Returns the subsistence minimum amount from the Payroll Limit table by the Wage Period code. Used for calculating minimum guarantees and indexation.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Wage Period | Payroll Document Line: "Wage Period From" | Wage Period code for filtering |
| Limit Type | Fixed: Survival Minimum | Payroll limit type |
Result:
- Returns: Subsistence minimum amount (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- In the Payroll Limit table, filters entries: Type = "Survival Minimum", "Payroll Period"
<=Wage Period From. - Finds the last effective record and returns the "Amount" field.
Function 21094046 -- Position Rate
What it does: Returns the position rate (Position Rate) from the labor contract line effective as of the action date of the payroll document line. The position rate determines the fraction of a full-time position the employee works (1, 0.5, 0.25, etc.).
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Action Starting Date", "Action Ending Date" |
Result:
- Returns: Position rate (Decimal), e.g. 1.0, 0.5, 0.25.
- Updates Payroll Document Line fields: --
Calculation logic:
- Finds the employee's labor contract.
- Filters labor contract lines (Labor Contract Line):
- Operation type = "Hire" or "Transfer".
- "Starting Date"
<="Action Ending Date" from the document line. - "Ending Date"
>="Action Starting Date" or is blank.
- Finds the last record and returns the "Position Rate" field.
Function 21094047 -- Indexation Amount (Hourly)
What it does: Calculates a coefficient for proportional indexation accrual based on hours worked. Formula: 100 * Actual Hours / Planned Hours. Updates planned and actual hours fields on the document line.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Action Starting Date", "Action Ending Date", "Payroll Calendar Code" |
| Time Activity Group | Payroll Document Line Calc: "Time Activity Group" | Time activity filter for the timesheet |
Result:
- Returns: Proportionality coefficient (Decimal). Formula: 100 * Actual Hours / Planned Hours.
- Updates Payroll Document Line fields: --
Calculation logic:
- Checks that "Action Starting Date" and "Action Ending Date" are mandatory.
- Planned Hours = working hours from the payroll calendar of the document line in the current payroll period.
- If planned hours = 0, raises an error.
- Actual Hours = hours from the timesheet filtered by time activity group within the action date range.
- Returns: 100 * Actual Hours / Planned Hours.
Function 21094048 -- Indexation Amount (Daily)
What it does: Calculates a coefficient for proportional indexation accrual based on days worked. Formula: 100 * Actual Days / Planned Days.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Employee No.", "Action Starting Date", "Action Ending Date", "Payroll Calendar Code" |
| Time Activity Group | Payroll Document Line Calc: "Time Activity Group" | Time activity filter for the timesheet |
Result:
- Returns: Proportionality coefficient (Decimal). Formula: 100 * Actual Days / Planned Days.
- Updates Payroll Document Line fields: --
Calculation logic:
- Checks that "Action Starting Date" and "Action Ending Date" are mandatory.
- Planned Days = working days from the payroll calendar of the document line in the current payroll period.
- If planned days = 0, raises an error.
- Actual Days = days from the timesheet filtered by time activity group within the action date range.
- Returns: 100 * Actual Days / Planned Days.
Function 21094049 -- Fixed Indexation Coefficient
What it does: Returns the fixed indexation coefficient from the Indexation Indices table. Unlike function 21094029, additionally checks whether the job title changed during a transfer.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Payroll Document Line | Payroll Document Line | Uses: "Payroll Elem. Ledger Entry No.", "Employee No.", "Element Code" |
Result:
- Returns: Indexation coefficient (Decimal), rounded to 0.1. Returns 0 if the job title changed.
- Updates Payroll Document Line fields: --
Calculation logic:
- Reads the entry from the Payroll Element Ledger Entry by the entry number.
- Finds the labor contract line (Labor Contract Line) for this contract number with type "Hire" or "Transfer", status = "Approved", with starting date = the entry's action starting date.
- Determines the current position from the contract line.
- Moves to the previous labor contract line.
- Determines the previous position.
- If the date
>=01.12.2015 and the Job Title Code of the current position does not equal the Job Title Code of the previous position, returns 0 (indexation does not apply when the job title changes). - Finds the previous payroll element entry (with a smaller Entry No.).
- In the Indexation Indices table, finds a record by the entry's period code and the indexation base month of the previous entry.
- Returns the "Percent" value, rounded to 0.1.
Function 21094050 -- Salary at Period End
What it does: Similar to function 21094000, but returns the salary as of the payroll period ending date instead of the document starting date.
Parameters:
| Parameter | Source | Description |
|---|---|---|
| Employee No. | Payroll Document Line: "Employee No." | Employee code |
| Date | Payroll period ending date determined by "Period Code" from the document line | Date on which the salary is determined |
Result:
- Returns: Salary amount as of the payroll period end date (Decimal).
- Updates Payroll Document Line fields: --
Calculation logic:
- Determines the payroll period ending date by the period code from the document line (PayrollPeriod.PeriodEndDateByPeriodCode).
- Calls GetSalaryByDate (function 21094000) with this date.
- Returns the result.
Payroll Calculation Functions (Part 3): Leave, Reserves, Validations, Balances (21094051–21094112)
Detailed description of functions for leave calculation, reserves, employee data validations, and balances.
Path: Administration / Payroll Calculation Function