Preserved 2025 implementation
Calculation logic
This reference describes the behavior preserved from the approved calculator. Automated tests establish regression compatibility with that implementation; they do not independently certify regulatory correctness.
Shared rates
Hourly rate = round(daily rate / 8)
Half-period basic pay = round(monthly rate / 2)
Earnings components
| Component | Implemented calculation |
|---|---|
| Basic pay | monthly / 2 |
| Ordinary day night differential | hourly x hours x 0.10 |
| Ordinary day overtime | hourly x hours x 0.25 |
| Rest-day work | hourly x hours x 1.30 |
| Rest-day night differential | hourly x hours x 0.13 |
| Rest-day overtime | hourly x hours x 1.69 |
| Regular-holiday work | hourly x hours x 1.00 |
| Regular-holiday night differential | hourly x hours x 0.26 |
| Special-holiday work | hourly x hours x 0.30 |
| Special-holiday night differential | hourly x hours x 0.13 |
H1 statutory deductions
SSS: PHP 250 through the first salary band, increasing by PHP 25 for each PHP 500 band, up to the preserved PHP 1,750 maximum within the supported range.
PhilHealth = 2,500 within the preserved capped range
Pag-IBIG = 200
H1 net = H1 gross taxable income - optional deductions - statutory deductions
H2 withholding-tax implementation
| Total monthly gross taxable income (T) | Implemented withholding tax |
|---|---|
T <= 20,833 | 0 |
T <= 33,332 | T x 0.15 |
T <= 66,666 | (T x 0.20) + 1,875.00 |
T <= 166,666 | (T x 0.25) + 8,541.80 |
T <= 666,666 | (T x 0.30) + 33,541.80 |
T <= 999,999 | (T x 0.35) + 183,541.80 |
T > 999,999 | (T x 0.35) + 300,041.80 |
H2 net = H2 gross taxable income - H2 optional deductions - withholding tax
Monthly net = H1 net + H2 net
Maintainability
Architecture
Configuration, pure calculation functions, browser rendering and styling are separated so reviewers can inspect payroll logic without reading the entire interface.
config/payroll-rates.js | Thresholds, rates, labels and multipliers. |
|---|---|
core/earnings.js | Shared rates, premium components and optional deductions. |
core/statutory.js | SSS, PhilHealth and Pag-IBIG. |
core/withholding-tax.js | Preserved H2 bracket implementation. |
core/calculate-h1.js | H1 orchestration and H2 carry basis. |
core/calculate-h2.js | H2 orchestration and monthly taxable total. |
ui/render.js | Repeated inputs and result components. |
app.js | Form state, validation, automatic carry and summary updates. |
Release discipline
Validation process
- Review every configurable threshold and effective-period label.
- Run tests immediately below, at and above every contribution or tax boundary.
- Compare synthetic scenarios with the approved payroll reference.
- Obtain Finance or Payroll review for formula changes.
- Update the calculation specification and changelog.
- Tag the reviewed release.
The repository includes automated tests covering rounding, multipliers, SSS boundaries, PhilHealth ranges, withholding-tax brackets, H1/H2 reconciliation and the full-month total.