Introducing a new way to review your PRs.

Read the announcement

frappe / hrms

Open Source HR and Payroll Software

View on GitHub

20 documents · Updated Nov 23, 2026

docs / regional-payroll

Regional payroll implementations

Regional payroll implementations adapt the shared payroll flow to country rules without creating a separate payroll product. India adds local tax, housing, provident fund, professional tax, banking, and gratuity behavior. The United Arab Emirates (UAE) adds contract-based gratuity rules. The company country selects which regional behavior and setup apply.

For the shared payroll lifecycle, see Payroll management. For salary calculation context, see Salary processing and Compensation, benefits, and tax.

Regional extension model

The regional model uses the company country as the boundary for local payroll behavior. Shared payroll documents call regional extension points, so a country can change a calculation or add deductions while the main salary process still produces the salary slip and its totals.

Regional selection

The system resolves a region from the company linked to the payroll action. If no company is supplied, it uses the current company or the site country. This means that the same site can support companies with different country behavior when each payroll action points to the correct company.

References: hrms/__init__.py• L18-30 hrms/__init__.py• L33-52

Country setup

Country setup runs when a company changes country. It can add local fields, seed salary components, create the Income Tax Deductions report role, and create default gratuity rules. A country with no regional setup keeps the shared payroll behavior and defaults.

The setup also contributes local fields when the application builds its active customizations. Local setup is therefore part of the payroll contract: calculations depend on the fields and master data that the country setup makes available.

References: hrms/…/company.py• L12-18 hrms/…/company.py• L41-51 hrms/…/company.py• L67-89 hrms/setup.py• L47-76

India payroll module

The India module covers payroll needs that depend on Indian salary and tax concepts. It extends employee and company data, supplies local salary components, and replaces shared tax and housing calculations when the company region is India.

India salary and payroll data

India setup adds data that supports local payroll input and output. Employees can carry PAN, provident fund account, IFSC, and MICR data. Companies identify the Basic, HRA, and arrear salary components. Salary components can be classified for provident fund, additional provident fund, provident fund loan, or professional tax.

The module also creates common earning and deduction components. These components give salary structures and local reports a shared vocabulary for Indian payroll records.

References: hrms/…/setup.py• L27-116 hrms/…/setup.py• L233-260 hrms/…/salary_components.json• L1-43

India housing exemption

House Rent Allowance (HRA) exemption is an India-specific tax benefit based on the employee's Basic pay, HRA, rent, and metro-city status. The declaration path estimates annual eligibility. The proof path applies rent paid for a period and checks that rent dates do not overlap.

The exemption uses the lowest of the employer HRA, rent reduced by 10% of Basic pay, and the applicable share of Basic pay. The income tax computation uses the resulting declaration or proof amount as part of the employee's annual exemption data. The declaration path can calculate this data while an employee saves a declaration for the payroll period.

flowchart LR
    A[Company Basic and HRA links] --> B[Employee tax declaration]
    C[Rent proof and dates] --> D[Period HRA calculation]
    B --> E[Eligible HRA exemption]
    D --> E
    E --> F[Income tax computation]

References: hrms/…/utils.py• L11-76 hrms/…/utils.py• L125-142 hrms/…/utils.py• L159-203 hrms/…/employee_tax_exemption_declaration.py• L44-81 hrms/…/employee_tax_exemption_proof_submission.py• L44-80 hrms/…/income_tax_computation.py• L368-394

India income tax

India replaces the shared marginal-relief calculation with an India rule. When taxable income is above the tax relief limit but below the configured marginal relief limit, tax can be reduced so that the tax does not exceed the income above the relief limit.

The marginal relief limit is an India field on an INR income tax slab. The normal income tax flow calls the regional calculation before it applies other tax charges, so the result affects the tax shown on salary processing.

References: hrms/hooks.py• L308-314 hrms/…/setup.py• L233-241 hrms/…/utils.py• L206-221 hrms/…/income_tax_slab.py• L47-68

India statutory deductions

Indian statutory deductions are represented as salary components and are included in salary slips as deductions. The Professional Tax and Provident Fund reports read the local component classifications rather than inferring them from component names.

The shared salary-slip flow calls its regional deduction extension after normal deductions and loan repayment are prepared. Any region-provided deductions can therefore affect total deductions and net pay before tax break-up values are finalized.

References: hrms/…/salary_slip.py• L938-961 hrms/…/provident_fund_deductions.py• L12-24 hrms/…/professional_tax_deductions.py• L39-76

India salary payments

The India salary payment report includes IFSC and MICR values in addition to common bank details. This supports Indian bank payment data without changing the common salary payment view for other regions.

References: hrms/…/salary_payments_via_ecs.py• L60-66 hrms/…/salary_payments_via_ecs.py• L87-108 hrms/…/salary_payments_via_ecs.py• L124-140

UAE payroll module

The UAE module focuses on end-of-service gratuity. It supplies rules for limited contracts and for unlimited contracts that end through termination or resignation. It does not add an India-style tax or deduction layer in the regional payroll code.

UAE gratuity rules

UAE gratuity uses completed years of service and applies a rule that matches the employee's contract and exit case. The default rules require one completed year before gratuity applies. Limited contracts and unlimited-contract termination use the same service bands. Unlimited-contract resignation reduces the applicable amount across the one-to-three-year and three-to-five-year bands.

The gratuity calculation can use the current service band or add the amounts from earlier bands. This distinction lets the seeded UAE rules represent different contract outcomes while the shared gratuity process calculates the amount and records its settlement.

UAE caseHigh-level rule shape
Limited contractNo amount before one year, then a 21/30 daily-earnings rate through five years, then a full daily-earnings rate. Earlier bands are accumulated.
Unlimited contract terminationUses the same service bands as the limited-contract rule.
Unlimited contract resignationUses reduced fractions through five years, then the 21/30 rate after five years.

References: hrms/…/setup.py• L7-57 hrms/…/gratuity.py• L168-194 hrms/…/gratuity.py• L234-288

Gratuity settlement

Gratuity is a separate payroll-related payment that uses the selected rule and the employee's completed service. On submission, it can enter a later salary slip as an Additional Salary or post directly to the accounts. This connects a regional end-of-service calculation to the shared payroll and accounting flows.

References: hrms/…/gratuity.py• L43-47 hrms/…/gratuity.py• L81-95 hrms/…/gratuity.py• L135-146

Regional payroll flow

The regional path starts with company country setup and ends in shared payroll outputs. India adds calculation and reporting inputs during salary processing. UAE mainly changes the gratuity rule selected for an end-of-service payment.

This diagram shows how local configuration enters the shared payroll lifecycle.

flowchart TD
    A[Company country] --> B{Regional setup}
    B --> C[Local fields and master data]
    B --> D[Local salary components or gratuity rules]
    C --> E[Salary structure and employee records]
    D --> E
    E --> F[Salary slip or gratuity calculation]
    F --> G[Tax, deduction, payment, or accounting output]

Regional output boundaries

India local data can change salary-slip deductions, income tax exemptions, tax relief, deduction reports, and bank payment columns. UAE local data changes the gratuity amount and its settlement route. Both modules retain the shared payroll records and downstream accounting behavior.

References: hrms/hooks.py• L308-314 hrms/…/salary_slip.py• L948-970 hrms/…/income_tax_slab.py• L47-68 hrms/…/gratuity.py• L81-95

Change checklist

When these files or sections are changed, remember to consider these:

  • Country setup changes must stay aligned with the custom fields, local salary components, the Income Tax Deductions report role, and default gratuity rules that the company-country flow creates.
  • India salary-component classifications must stay aligned with salary-slip deductions and the Provident Fund and Professional Tax reports.
  • India HRA fields and declaration calculation must stay aligned across Company links, tax declarations, proof submissions, and income tax computation.
  • India tax relief changes must stay aligned between the INR slab field, the regional calculation, and the shared tax-slab flow.
  • UAE gratuity rule changes must stay aligned with contract and exit-case selection and with both salary-slip and direct-account settlement paths.
  • Region-specific payment fields must stay aligned between Employee data and the salary payment report columns.

Important failure modes

TriggerConsequenceGuard
An Indian company has no Basic or HRA component link.HRA exemption calculation cannot produce an eligible amount and raises an error.Set both component links on the Company before processing HRA exemptions.
Indian salary components lack the local component type.Provident Fund or Professional Tax reports show no matching data.Classify each local deduction component before submitting salary slips.
An INR income tax slab has no marginal relief threshold.India-specific marginal relief is not applied.Configure the threshold on the applicable income tax slab.
A UAE gratuity record uses the wrong contract or exit rule.The service-band amount can differ from the intended UAE settlement.Select the rule that matches the contract and the reason for exit.
Rent proof dates are missing or overlap another submitted proof.The India HRA proof cannot be validated.Submit complete non-overlapping rent periods.

Key files

FileWhy to read it
hrms/__init__.pyDefines how the company country selects regional behavior.
hrms/…/company.pyShows when country setup creates local defaults and salary components.
hrms/…/setup.pyDescribes the India fields, report access, and default gratuity setup.
hrms/…/utils.pyDescribes India HRA and marginal-relief outcomes.
hrms/…/salary_components.jsonShows the local salary component vocabulary seeded for India.
hrms/…/setup.pyDefines the default UAE gratuity cases and service bands.
hrms/…/salary_slip.pyShows where regional deductions enter shared salary totals.
hrms/…/income_tax_slab.pyShows how regional tax relief affects the common tax flow.
hrms/…/gratuity.pyShows how a regional gratuity rule becomes a payment or accounting entry.
hrms/…/provident_fund_deductions.pyIllustrates how India deduction classifications become a report.
hrms/…/salary_payments_via_ecs.pyIllustrates India-specific bank fields in salary payment output.