DEV Community

Cover image for ERPNext Payroll for India: Configuring PF, ESI, and TDS Without the Guesswork
AO PLUS
AO PLUS

Posted on

ERPNext Payroll for India: Configuring PF, ESI, and TDS Without the Guesswork

The compliance headache nobody warns you about

When a new client onboards with us at AO+ Solutions for ERPNext payroll, the first question is always: "Will it handle PF, ESI, and TDS automatically?"

The honest answer: yes — but only if you configure it correctly. ERPNext doesn't ship with India-specific salary components pre-built. You set them up once, correctly, and they run every month without drama. Get them wrong, and every salary slip will be wrong until someone notices.

This is a precise walk-through of how we configure Indian statutory deductions in ERPNext.


The three statutory deductions, briefly

Before touching any screens, the rules:

EPF (Employees' Provident Fund): Employee contributes 12% of Basic + DA. Employer also contributes 12% — but 8.33% of that goes to EPS (pension, capped at ₹1,250/month) and the rest to EPF. The statutory wage ceiling is ₹15,000/month of Basic + DA. If Basic exceeds ₹15,000, the minimum statutory deduction is still 12% × ₹15,000 = ₹1,800. Many companies deduct on actual Basic. Both are valid — but document the policy before you configure it, because changing it mid-year causes reconciliation pain.

ESI (Employee State Insurance): Only applies when gross salary is ≤ ₹21,000/month (₹25,000 for persons with disability). Employee pays 0.75% of gross. Employer pays 3.25% of gross. Once gross exceeds ₹21,000, the employee exits ESI coverage.

TDS: Income tax deducted monthly, based on projected annual taxable income. ERPNext calculates this from an Income Tax Slab document you configure — it recalculates every payroll run as exemptions are submitted and remaining months shrink.


This diagram shows how the key doctypes connect:

Architecture diagram 1


Step 1: Create the salary components

Go to HR > Payroll > Salary Component. Build each component before assembling the structure.

Basic Salary

  • Type: Earning
  • Abbreviation: B
  • Is Tax Applicable: checked
  • Depends on Payment Days: checked

HRA (House Rent Allowance)

  • Type: Earning
  • Abbreviation: HRA
  • Is Tax Applicable: checked
  • Depends on Payment Days: checked
  • Leave Exempted from Income Tax unchecked — the HRA exemption is claimed via Employee Tax Exemption Declaration, not here.

EPF Employee

  • Type: Deduction
  • Abbreviation: EPF
  • Amount based on formula: checked
  • Formula: B * 0.12 if B <= 15000 else 1800
  • Exempted from Income Tax: checked (EPF contributions are tax-exempt under Section 80C)
  • Depends on Payment Days: unchecked — deduct the full statutory amount regardless of loss-of-pay days

ESI Employee

  • Type: Deduction
  • Abbreviation: ESIE
  • Amount based on formula: checked
  • Condition: gross_pay <= 21000
  • Formula: gross_pay * 0.0075

ERPNext evaluates the Condition first. If gross pay exceeds ₹21,000, the component resolves to zero — the employee is outside ESI coverage for that month.

TDS / Income Tax

  • Type: Deduction
  • Abbreviation: TDS
  • Variable Based On Taxable Salary: checked — this is the critical flag. It tells ERPNext to compute this component from the Income Tax Slab, not a static formula.
  • Round to the Nearest Integer: checked

EPF Employer

  • Type: Employer Contribution
  • Abbreviation: EPFR
  • Formula: B * 0.12 if B <= 15000 else 1800

This component goes in the Salary Structure's Employer Contributions table, not Deductions. It counts toward CTC but doesn't affect net pay and doesn't appear on the salary slip.


Here is how deductions flow from gross to net pay:

Architecture diagram 2


Step 2: Set up the Income Tax Slab

Go to HR > Payroll > Income Tax Slab.

Create separate slabs for the Old Regime and New Regime. Since FY 2023-24, the new regime is the default for most employees. Here is an indicative New Regime slab structure (verify the exact rates for the current financial year against the Finance Act):

From (₹) To (₹) Rate
0 4,00,000 0%
4,00,001 8,00,000 5%
8,00,001 12,00,000 10%
12,00,001 16,00,000 15%
16,00,001 20,00,000 20%
20,00,001 24,00,000 25%
24,00,001 — 30%

In the Other Taxes and Charges table, add Health and Education Cess at 4% — ERPNext applies this on top of the computed slab tax.

Set Effective From to 1 April of the financial year. Set Allow Tax Exemption to checked if you want declarations (80C, HRA, NPS) to reduce taxable income before slab computation.

For employees on the old regime, create a second slab with old regime rates. You'll assign the right one per employee in Step 4.


This sequence shows how TDS is calculated each payroll run:

Architecture diagram 3

The monthly TDS is not a fixed 1/12 of annual tax. ERPNext recalculates at each payroll run based on income earned so far, approved exemptions, and the number of months remaining in the financial year. This means TDS adjusts dynamically through the year.


Step 3: Build the Salary Structure

Go to HR > Payroll > Salary Structure and create one structure — call it something like Standard India CTC.

Earnings:

  • Basic (B) — fixed amount or a formula based on CTC
  • HRA (HRA) — typically 40–50% of Basic: B * 0.4
  • Special Allowance — balance of CTC after other components

Deductions:

  • EPF Employee (EPF)
  • ESI Employee (ESIE)
  • Professional Tax — state-specific; use Condition and Formula fields to implement the applicable slab
  • TDS (TDS)

Employer Contributions:

  • EPF Employer (EPFR)
  • ESI Employer — gross_pay * 0.0325 if gross_pay <= 21000 else 0

Submit the structure once you're satisfied. ERPNext does not allow editing a submitted salary structure — create a new version if compensation policy changes mid-year.


Step 4: Assign the structure to employees

Go to HR > Payroll > Salary Structure Assignment.

Key fields to fill:

  • Employee — the person
  • Salary Structure — the structure you just built
  • From Date — when this assignment takes effect
  • Base — the employee's Basic Salary amount (this is what B resolves to in formulas)
  • Income Tax Slab — select Old Regime or New Regime per employee preference

This is where the regime split happens. Each employee can be on a different slab. If an employee switches regimes mid-year, create a new assignment with a new From Date — do not edit the existing one.


Step 5: Run payroll

Go to HR > Payroll > Payroll Entry.

Set Payroll Frequency, Company, and the payroll period dates. Click Get Employees, review the list, then Create Salary Slips.

ERPNext will:

  1. Calculate earnings, prorating for loss-of-pay days on components where Depends on Payment Days is checked
  2. Compute EPF and ESI using your formulas and conditions
  3. Project full-year income, apply approved exemptions, run the tax slab, and compute monthly TDS

Validate the slips, then submit to post the accounting entries to the ledger.


What catches people out

ESI on prorated salaries. If you prorate a high-salary employee's pay for a partial month and gross dips below ₹21,000, ESI triggers unexpectedly. We add a custom field custom_esi_applicable on the Employee doctype and include it in the condition: gross_pay <= 21000 and doc.custom_esi_applicable == 1. More explicit, fewer surprises.

TDS spikes in February and March. ERPNext redistributes the remaining annual tax liability over fewer months. An employee who didn't submit investment proof in time will see a sharp TDS increase in the last two months. Set a hard deadline — we enforce February 15 — and brief employees in January.

PF on actual vs. statutory wages. If your CTC structure puts Basic above ₹15,000, decide upfront: deduct EPF on actual Basic, or cap at ₹15,000. Both are legally valid. The B * 0.12 if B <= 15000 else 1800 formula caps it at statutory minimum. If you deduct on actual Basic, the formula is simply B * 0.12. Document the policy and apply it uniformly — one structure should not have both approaches.

Professional Tax consistency. PT slabs differ by state and change occasionally. We maintain a separate salary structure per state rather than cramming all PT logic into one complex formula. It's more maintenance but much easier to audit.


Get the components right once and Indian payroll runs cleanly every month. The complexity is upfront; the ongoing effort is near zero.

What part of ERPNext payroll setup has given you the most trouble? PF on variable pay? TDS on supplemental bonuses? Drop a comment below.


Have questions about implementing this? Drop us a line — we're happy to help.

Top comments (0)