Payroll Module — User Guide

Payroll Module — User Guide

Salaries, allowances, and deductions.

ProductVertex ERP
ModulePayroll (`modules/payroll`)
AudiencePayroll officers, finance/HR staff who configure pay rules, and employees using portal advances/deductions
FormatHTML + Mermaid diagrams

1. Overview

The Payroll module calculates and manages monthly employee pay. It combines:

Layer What it covers
Configuration Calculation parameters, formula variables, employee groups, dynamic rules, advance types
Employee money Active salaries, advances and installments, additional deductions, monthly change records
Period output Payslips (generate, review, recalculate, execute/lock) and report APIs
flowchart LR subgraph Config CP[Parameters] FV[Formula variables] DR[Dynamic rules] end subgraph EmployeeData Sal[Active salary] Adv[Advances / installments] Ded[Additional deductions] end subgraph Output PS[Payslip] end Config --> PS EmployeeData --> PS HR[HR employees] --> EmployeeData

Payroll does not replace HR master data. Employees, org structure, and career events live in HR. Attendance punches live in Attendance. Payroll consumes an active salary and configured rules to produce a payslip for a date range.


2. Getting started

2.1 Recommended setup order

flowchart TD A[Calculation Parameters] --> B[Formula Variables] B --> C[Employee Groups optional] C --> D[Dynamic Rules] D --> E[Advance Types] E --> F[Active Salaries] F --> G[Advances / Additional Deductions as needed] G --> H[Generate Payslips] H --> I[Review then Execute]
  1. Calculation parameters — reusable numeric/formula knobs
  2. Formula variables — named bridges used inside formulas and built-in tax/advance totals
  3. Employee groups — optional targeting lists
  4. Dynamic rules — compensations, grants, deductions
  5. Advance types — categories for advances
  6. Salaries — one active salary per employee before any payslip
  7. Operational data: advances, additional deductions, monthly changes
  8. Generate payslips → review → Execute to lock

Payslips are generated per employee for a period (no dedicated batch API; the UI may loop employees).

2.2 Main navigation

Menu Path Purpose
Salaries /payroll/salaries Base fixed salary records
Payslips /payroll/payslips Period payslips
Payslip detail /payroll/payslip-detail/:id Full review/edit of one payslip
Advance types /payroll/advance-types Advance categories
Advances /payroll/advances Employee advances
Installments /payroll/installments Monthly advance repayments
Monthly changes /payroll/monthly-changes Period change records
Additional deductions /payroll/additional-deductions Loans and other recurring deductions
Dynamic rules /payroll/dynamic-rules Pay additions and deductions rules
Employee groups /payroll/employee-groups Grouping for rules/targeting
Formula variables /payroll/formula-variables Named formula inputs
Calculation parameters /payroll/calculation-parameters Named calculation knobs

3. Calculation parameters

Reusable named values that formulas and rules can reference.

Field Meaning
Parameter name Key used by the system
Calculation type Fixed, Formula, or Employee-based
Fixed value / formula / employee field How the value is obtained
Default value Fallback (often 0)
Active Included when resolving values

Dynamic rules can reference parameters via parameter references. At runtime the engine resolves the current value for the employee/period context.


4. Formula variables

Named variables that connect payroll screens and SQL-backed calculations.

Field Examples / notes
Variable name / code Display name and code such as FIXED_SALARY
Category Employee, Salary, Compensation, Deduction, Attendance, Other
Calculation type Direct, Function, or Formula
Data source / field / function / formula Binding to data
Default / active Fallback and on/off

Common built-in uses during payslip calculation include tax-related variables and totals such as:

  • Grant / bracket / income tax variables
  • Total advance installments for the month
  • Total additional deductions for the month

You can evaluate a variable or a formula from the admin APIs/UI when configuring rules.


5. Employee groups

Groups collect employees for organization and (intended) rule targeting.

5.1 Group

Field Notes
Code / names Unique group code; Arabic/English names
Group type Department, Category, Activity, Custom, All
Description / active Metadata

5.2 Members

Manual membership: employee, active flag, optional expiry, notes. Bulk add can attach many employees and skip duplicates.

5.3 Criteria

Criteria rows describe filters (department, location, specialization, status, custom) with operators such as =, IN, LIKE, comparisons, and null checks.

Practical note: Membership used in day-to-day pay is the manual member list. Criteria are maintained as configuration metadata. For payslip calculation, dynamic rules that apply reliably today are those targeted to All or Individual employees; group-targeted rules may not be applied by the calculation engine until group expansion is fully wired.

flowchart TD A[Create Employee Group] --> B[Add members manually] B --> C[Optional criteria metadata] C --> D[Reference group from rules or other screens]

6. Dynamic rules

Dynamic rules add compensations, grants, or deductions to a payslip when they match an employee and effective dates.

6.1 Rule types

Type Role in calculation
Compensation Added when calculating compensations
Grant Added when calculating grants
Deduction Applied in the deductions phase
Addition Stored in configuration; not processed by the current calc engine

6.2 How the amount is calculated

Calc type Behavior
Fixed Uses the rule amount
Percentage Percentage of a calculation source
Formula Evaluates a formula using parameters/variables

Calculation sources include Gross, Net, Fixed, Other, Compensation, Grant. Percentage resolution currently anchors to fixed salary for several of these sources.

6.3 Targeting and schedule

Field Meaning
Apply to Individual (+ employee), Group (+ group), or All
Priority Lower values applied first
Effective from / to Validity window
Months limit / permanent Duration controls
Monthly or daily mode Calculation mode flags
Active / suspended On/off and temporary stop
Show in payslip Visibility on the slip

Suspend / Resume actions temporarily stop a rule without deleting it.

6.4 When rules run in a payslip

flowchart TD A[Active salary loaded] --> B[Apply Compensation rules] B --> C[Apply Grant rules] C --> D[Refresh Gross] D --> E[Calculate taxes via formula variables] E --> F[Apply Deduction rules] F --> G[Add advance installments and additional deductions] G --> H[Compute net salary]

Each applied rule can be recorded as a rule application for audit on that payslip month.


7. Salaries

Every payslip requires an active salary for the employee.

Field Meaning
Employee Who the salary belongs to
Fixed salary Base monthly fixed amount
Previous salary Optional prior amount
Insurance wage Optional insurance base
Effective date When this record starts
Active Exactly one active salary per employee

Rules

  • Creating or activating a salary deactivates the previous active one.
  • Payslip generation fails if no active salary exists.
  • History is available via salary history APIs/UI.

There is no direct job-grade link inside Payroll; grade changes in HR do not automatically rewrite salary — maintain salary records explicitly (or via your operational process).


8. Advance types, advances, and installments

8.1 Advance types

Simple named categories (for example housing, salary advance). Manage under Advance Types.

8.2 Advances

Field Meaning
Employee Recipient
Advance type / name Category and label
Total amount Full advance
Installment amount Monthly repayment amount
Remaining amount Still to be repaid
Decision number/date Optional admin decision
Deducted If true, installments can be taken on payslips
Suspended Temporarily excluded
Status Pending, Approved, Rejected, or empty

Create paths:

Who Typical status
Payroll staff with Create Advance created for any employee (status often empty / treated as operational)
Employee without Create Self-request for own person → Pending

Suspend / Resume control whether the advance participates in installment generation. You cannot delete an advance that already has paid installments (unpaid installments may be cleared first per rules).

8.3 Installments

Installments are the monthly repayment rows linked to an advance.

Field Meaning
Advance / employee Parent advance
Amount Deduction for the month
For month / year Period
Paid Whether marked paid
Paid date / calculation date Tracking

Auto-creation happens when generating/calculating a payslip month (or via calculate-installments-for-month), if:

  • Advance is deducted, not suspended, remaining amount greater than 0
  • No installment yet for that advance/employee/month/year
  • Installment amount is positive and remaining covers it

Then remaining amount is recalculated from total minus all installment amounts.

In the payslip: unpaid installments for the period feed total advance installments into total deductions. Mark as paid excludes them from future unpaid totals.

flowchart TD A[Create Advance with installment amount] --> B[Generate payslip for month] B --> C{Eligible for installment} C -->|Yes| D[Create unpaid Installment] D --> E[Include in payslip deductions] E --> F[Optional Mark as paid] C -->|No| G[Skip]

9. Additional deductions

Recurring deductions such as loans or other withholdings.

Field Meaning
Deduction type Loan, Advance, or Other
Name / totals Total, monthly, paid, remaining amounts
Months Total and remaining months
Start / end dates Validity
Apply to Individual, Group, or All
Active / suspended Participation flags
Decision / notes Admin metadata

Month flow

flowchart TD A[Active deduction in date range] --> B[Payslip month calculation] B --> C[Ensure unpaid payment row for month] C --> D[Add to TOTAL additional deductions] D --> E[Payslip total deductions]

You cannot delete a deduction that already has paid amount greater than zero. Suspend / Resume stop or resume monthly pickup.


10. Monthly changes

Monthly changes record period adjustments for an employee (reason text, from/to dates, decision fields).

State Meaning
Not executed Editable
Executed Locked with executed date

Execute locks the record. In the current product, monthly changes are primarily documentary / reportable; they do not automatically rewrite salary or payslip totals. Use them for controlled period notes and reporting, and adjust salaries or dynamic rules when amounts must change.


11. Payslips

11.1 Lifecycle

There is no separate Draft status enum. Practically:

State Flag
Open for edit / recalculate IsExecuted = false
Locked IsExecuted = true (+ executed date)
flowchart TD A[Ensure active salary and rules] --> B[Generate or Create payslip] B --> C[IsExecuted false] C --> D[Review on Payslip Detail] D --> E{Need changes} E -->|Yes| F[Recalculate or edit] F --> D E -->|No| G[Execute] G --> H[Locked - IsExecuted true]
Action Behavior
Create / Generate Builds payslip for employee + period; requires active salary; unique employee+period and payslip number
Recalculate Only if not executed; rebuilds from current salary/rules/installments
Execute Locks the payslip
Delete Blocked when executed
Unlock Updating executed flag back to false when permitted

11.2 Calculation outline

  1. Validate employee, period uniqueness, payslip number, active salary.
  2. Ensure advance installments and additional deduction payments for the month.
  3. Work days from the calendar span of From–To; daily rate typically fixed salary / 30.
  4. Apply compensation and grant rules → refresh gross.
  5. Calculate taxes via formula variables; round income tax as configured.
  6. Apply deduction rules.
  7. Add advance installment and additional deduction totals.
  8. Compute total deductions, salary before tax, net, and rounded net.

11.3 Payslip content

Header totals typically include: payslip number, period, assigned/actual work days, daily salary, gross, compensations, grants, deductions, tax fields, net, decision metadata, executed flag.

Payslip detail screen loads the slip plus related salary/advances/installments for review and save-all editing when not locked.


12. Reports and related HR data

Payroll exposes report APIs for complete payslip details, compensations/grants, dynamic deductions, additional deductions, monthly changes, and rewards/penalties sourced from HR data via reporting queries.

HR module reports (monthly payslips, payslip full details) also surface payroll outputs for HR users with the matching HR report permissions.

There is no dedicated Payroll dashboard menu; use Payslips and report consumers for operational oversight.


13. Employee portal

Under the HR employee portal, employees can open:

Screen Ability
Advances View own / request advance when permitted
Additional deductions View own deductions

Portal access is gated by HR portal policies plus Payroll advance permissions such as Request and ViewOwn.

flowchart LR Portal[Employee portal] --> Adv[My Advances] Portal --> Ded[My Additional Deductions] Adv --> Pay[Payroll data] Ded --> Pay

14. Permissions summary

Permission group: Payroll.

Resource Permissions
Salaries Default, Create, Update, Delete
Advance types Default, Create, Update, Delete
Advances Default, Create, Update, Delete, Request, ViewOwn
Payslips Default, Create, Update, Delete
Monthly changes Default, Create, Update, Delete
Additional deductions Default, Create, Update, Delete
Dynamic rules Default, Create, Update, Delete
Employee groups Default, Create, Update, Delete
Installments Default, Create, Update, Delete
Formula variables Default, Create, Update, Delete
Calculation parameters Default, Create, Update, Delete
Employee lookup Payroll.EmployeeLookup for employee pickers without full HR rights

Grant Create/Execute-path payslip rights only to payroll operators; grant Request/ViewOwn to employee roles for portal self-service.


15. Integration with HR and Attendance

flowchart TB subgraph HR Emp[Employees / Persons] Career[Grades / rewards / penalties] end subgraph Payroll Sal[Salaries] Rules[Dynamic rules] PS[Payslips] end subgraph Attendance Att[Attendance records] end Emp --> Sal Emp --> PS Rules --> PS Sal --> PS Career -.->|Reports| PS Att -.->|Future work-day source| PS
Module Relationship
HR Employees (and persons) are the subjects of salaries, advances, and payslips. Career events are not auto-applied into salary amounts; rewards/penalties appear in reporting. Employee groups used by circulars/other features may overlap conceptually.
Attendance Not fully wired into payslip day counts today. Work days currently follow the payslip date span and a fixed /30 daily rate pattern. Plan operationally until attendance-driven days are enabled.
HR portal Embeds Advances and Additional Deductions screens.

Appendix A — Quick procedures

A.1 Prepare payroll for a new employee

  1. Ensure the person/employee exists in HR.
  2. Create an active salary.
  3. Attach any individual dynamic rules if needed.
  4. Optionally register advances or additional deductions.
  5. Generate the first payslip for the period.

A.2 Close a payroll month for one employee

  1. Confirm salary, rules, advances, and deductions are up to date.
  2. Generate or open the payslip.
  3. Review totals on Payslip detail; Recalculate if configuration changed.
  4. Execute to lock.
  5. Use reports for distribution/audit.

A.3 Run an advance through payroll

  1. Create advance type if needed.
  2. Create advance with total and installment amount; keep Deducted on.
  3. Generate payslip for the month → installment auto-created if eligible.
  4. After collection, Mark installment paid when appropriate.

A.4 Configure a new allowance

  1. Optionally add calculation parameters / formula variables.
  2. Create a Dynamic rule of type Compensation or Grant.
  3. Target All or Individual, set priority and effective dates.
  4. Generate a test payslip and verify rule applications.
  5. Execute production payslips when verified.

Appendix B — Operating notes

Topic Guidance
Group-targeted rules Prefer All/Individual for reliable calc until group membership is applied in the engine
Rule type Addition Config only; use Compensation/Grant/Deduction for amounts
Monthly changes Documentary/locking record; change salary or rules to affect amounts
Advance Pending Self-requests start Pending; staff process per your internal approval practice
Attendance days Calendar-based until attendance integration is completed

Appendix C — Document control

Item Value
Title Payroll Module User Guide
Source of truth modules/payroll and frontend/src/app/modules/payroll
Format Markdown + Mermaid (PDF edition embeds rendered figures)
Screenshots Not included (by design)

This guide describes functional capabilities of the Payroll module as implemented in the Vertex ERP codebase. UI labels may appear in English or Arabic depending on language settings.