Try five live demosdemo.gravixar.com

Module library

FBR and EOBI tax engine

Salary maths for Pakistan's FBR tax slabs and EOBI rates. It works from gross pay to net and back from net to gross, uses exact decimal maths throughout, and passes 17 of 17 automated property tests.

Payroll in Pakistan follows FBR tax slabs that change every fiscal year, with EOBI rates on top, and a bonus entered late changes the maths again. All of it lives in one place, and for the hardest calculation I chose the slower method, because the faster one went wrong by about 10,000 rupees in one known case.

Under the hood

As far as I can tell, this is the only Pakistan-tax payroll engine shipped cleanly anywhere. FBR slabs change per fiscal year and per regime; EOBI rates are separate; consolidated-versus-component salary structures route through different math; bonuses entered late roll forward two months per §17.6. All of that lives in one pure module, with seventeen vitest property tests covering the invariants (1000-iteration round-trip, EXEMPT regime, bonusTaxedAsSalary=false, GROSS_AGREED bonus invariance).

The Net→Gross solver uses bisection rather than Newton damping, after a discovered counterexample where a CONSOLIDATED-structure salary with a bonus-induced slab transition broke Newton's derivative continuity assumption and diverged by ~10k PKR. Bisection is slower; bisection is correct. The doc-comment in the engine records the counterexample so the next person doesn't "optimize" it back.

Related modules

Also in Finance

Bring me a real operations problem. I will show you the system running before you sign anything.

The Ops Leak Audit is the fixed-price first step: I count the hours your tools cost your team, then price the fix. Rather talk first? Book a 30-minute call. If it is not a fit, you still leave with notes you can use.