PHPackages                             crmleaf/pf-calculator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. crmleaf/pf-calculator

ActiveLibrary

crmleaf/pf-calculator
=====================

EPF employee, employer and EPS shares with the wage ceiling applied.

v1.0.0(today)01↑2900%[1 PRs](https://github.com/CrmLeaf/pf-calculator/pulls)MITPHPPHP ^8.2CI passing

Since Aug 14Pushed todayCompare

[ Source](https://github.com/CrmLeaf/pf-calculator)[ Packagist](https://packagist.org/packages/crmleaf/pf-calculator)[ Docs](https://www.indpayroll.com/free-tools/pf-calculator)[ RSS](/packages/crmleaf-pf-calculator/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (5)Versions (3)Used By (0)

PF Calculator
=============

[](#pf-calculator)

EPF employee, employer and EPS shares with the wage ceiling applied.

Splits the 12% employer share into EPS and EPF the way EPFO does it, applies the wage ceiling only where the statute applies it, and adds EDLI and administration charges.

One of the [CRMLeaf payroll tools](https://github.com/crmleaf). The arithmetic and the dated statutory rate tables live in [`crmleaf/payroll-core`](https://github.com/crmleaf/payroll-core); this package is the thin skin that makes one calculator installable, mountable and embeddable on its own.

Note

A wrong figure or an out-of-date rate is almost always a [`payroll-core`](https://github.com/crmleaf/payroll-core/issues) matter, since that is where the tables live. Anything about this tool's routes, views or browser asset belongs here.

Install
-------

[](#install)

**Composer** - Laravel auto-discovers the service provider, so this is the whole setup:

```
composer require crmleaf/pf-calculator
```

**npm** - the same calculation, re-exported from `@crmleaf/payroll-js` so you can install this one tool and nothing else:

```
npm install @crmleaf/pf-calculator
```

Note

Not on npm yet. The script-tag route below needs no registry and works today. Installing this package straight from git will not resolve `@crmleaf/payroll-js`, which is not published yet either.

**A plain script tag** - no build step, no bundler, no server. Build the browser bundle once and serve the file yourself:

```

const result = CrmleafPayroll.pf({ basicSalary: 30000, employerRestrictsToCeiling: true });
console.log(result.explain);

```

`payroll.min.js` is the single-file browser build. Get it by running `npm run build` in [`@crmleaf/payroll-js`](https://github.com/crmleaf/payroll-js) and copying `dist/payroll.min.js`into whatever your site serves as static assets.

> A hosted CDN build is coming soon, which will reduce this to a single URL. Serving the file yourself works today and keeps working afterwards - it is the only option that needs no third-party request, so plenty of projects will want to stay on it.

### See it working first

[](#see-it-working-first)

`demo/index.html` in this repository is a working copy of PF Calculator in one file: the form, the calculation and the working, with no build step and no server. Drop `payroll.min.js` beside it and open it from disk.

```
cp /path/to/payroll-js/dist/payroll.min.js demo/
open demo/index.html
```

Nothing on that page reaches the network, which is the point: it is a calculator people paste salary figures into.

Use it
------

[](#use-it)

**Plain PHP**, no framework and no container:

```
use Crmleaf\Payroll\Calculators\PfCalculator;
use Crmleaf\Payroll\Money;

$result = (new PfCalculator())->calculate(
    basicSalary: Money::fromRupees(30_000),
    employerRestrictsToCeiling: true,
);

echo $result->explain();      // the formula with the real operands in it
echo $result->workings();     // every step, one per line, with its citation
print_r($result->toArray());  // snake_case, ready for JSON
```

**Laravel** - resolve it from the container, or type-hint it anywhere:

```
use Crmleaf\Payroll\Calculators\PfCalculator;

public function show(PfCalculator $calculator)
{
    return $calculator->calculate(
        basicSalary: Money::fromRupees(30_000),
        employerRestrictsToCeiling: true,
    )->toArray();
}
```

**Blade** - one component, no controller:

```

```

**HTTP** - off by default. Publish the config and turn the route on:

```
php artisan vendor:publish --tag=pf-calculator-config
```

```
// config/pf-calculator.php
'route' => ['enabled' => true, 'prefix' => 'tools'],
```

```
curl -X POST https://example.test/tools/pf-calculator \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{"basic_salary":30000,"employer_restricts_to_ceiling":true}'
```

The JSON response carries the figures, the working and the statutory citations:

```
{
  "tool": "pf-calculator",
  "data": { "…": "every figure, snake_case, with a *_formatted twin" },
  "explain": "the formula with the real operands substituted",
  "working": [{ "label": "…", "amount": 0, "formula": "…", "citation": "…" }],
  "citations": ["…"]
}
```

**JavaScript**:

```
import { pf } from '@crmleaf/pf-calculator';

const result = pf({ basicSalary: 30000, employerRestrictsToCeiling: true });
```

No server needed
----------------

[](#no-server-needed)

The maths here is arithmetic over versioned rate tables, so it runs anywhere. The published asset binds the markup and computes in the browser:

```
php artisan vendor:publish --tag=pf-calculator-assets
```

```

   …

```

If the browser build is absent the script does nothing and the form posts to the server instead, so the page works either way.

Inputs
------

[](#inputs)

FieldTypeRequiredDefaultNotes`basic_salary`money (₹)Yes`30000``employer_restricts_to_ceiling`booleanNo`true``eps_eligible`booleanNo`true`A member who joined after 1 September 2014 above the ceiling is not.`age`integerNo-Past 58, the EPS share stops and the whole employer contribution goes to EPF.`reduced_rate`booleanNo`false``include_admin_charges`booleanNo`true``as_of`date (YYYY-MM-DD)No-Optional fields you leave out are omitted from the call entirely, so the calculator's own documented defaults apply.

Every figure here rests on a statutory rate, so the call takes `as_of`. Set it and the calculation runs on the rates in force on that date, which is what makes a prior year recomputable rather than merely rememberable.

Statutory basis
---------------

[](#statutory-basis)

Employees' Provident Funds and Miscellaneous Provisions Act 1952, with the EPS share capped at the ₹15,000 wage ceiling under paragraph 11(3) of the Employees' Pension Scheme 1995 even where EPF is contributed on the full basic.

Rates are data, not code: they live in dated tables with a cited source in `crmleaf/payroll-core`, so a rate change is a new dated entry rather than an edit to a constant.

Important

This package implements our reading of the applicable statutes and is provided without warranty. It is a calculation library, not tax advice. Verify against your own compliance obligations before relying on the output for statutory filing.

Publishing
----------

[](#publishing)

TagPublishes`pf-calculator-config``config/pf-calculator.php``pf-calculator-views``resources/views/vendor/pf-calculator``pf-calculator-assets``public/vendor/pf-calculator`Licence
-------

[](#licence)

[MIT](LICENSE) © CRMLeaf. Use it commercially, embed it, fork it.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/315788704?v=4)[crmleaf](/maintainers/crmleaf)[@CrmLeaf](https://github.com/CrmLeaf)

---

Top Contributors

[![andolasoftuser196](https://avatars.githubusercontent.com/u/145565449?v=4)](https://github.com/andolasoftuser196 "andolasoftuser196 (8 commits)")

---

Tags

epfepfoepsindiapayrollprovident-fundindiaepspayrollEPFepfoprovident-fund

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/crmleaf-pf-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/crmleaf-pf-calculator/health.svg)](https://phpackages.com/packages/crmleaf-pf-calculator)
```

###  Alternatives

[razorpay/magento

Razorpay Magento 2.0 plugin for accepting payments.

3080.1k1](/packages/razorpay-magento)[hakito/php-stuzza-eps-banktransfer

Stuzza e-payment standard implementation for PHP

1673.1k2](/packages/hakito-php-stuzza-eps-banktransfer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
