Technical reference

Calculation logic, without the black box.

A readable specification of the preserved formulas, software modules, test coverage and release process behind Pay Register.

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

Daily rate = round(monthly rate / 21.75)
Hourly rate = round(daily rate / 8)
Half-period basic pay = round(monthly rate / 2)

Earnings components

ComponentImplemented calculation
Basic paymonthly / 2
Ordinary day night differentialhourly x hours x 0.10
Ordinary day overtimehourly x hours x 0.25
Rest-day workhourly x hours x 1.30
Rest-day night differentialhourly x hours x 0.13
Rest-day overtimehourly x hours x 1.69
Regular-holiday workhourly x hours x 1.00
Regular-holiday night differentialhourly x hours x 0.26
Special-holiday workhourly x hours x 0.30
Special-holiday night differentialhourly 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 = monthly x 0.05 / 2 within the standard range
PhilHealth = 2,500 within the preserved capped range
Pag-IBIG = 200
H1 basis carried to H2 = H1 gross taxable income - H1 statutory deductions
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,8330
T <= 33,332T 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
T = H1 taxable basis + H2 gross taxable income
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.jsThresholds, rates, labels and multipliers.
core/earnings.jsShared rates, premium components and optional deductions.
core/statutory.jsSSS, PhilHealth and Pag-IBIG.
core/withholding-tax.jsPreserved H2 bracket implementation.
core/calculate-h1.jsH1 orchestration and H2 carry basis.
core/calculate-h2.jsH2 orchestration and monthly taxable total.
ui/render.jsRepeated inputs and result components.
app.jsForm state, validation, automatic carry and summary updates.

Release discipline

Validation process

  1. Review every configurable threshold and effective-period label.
  2. Run tests immediately below, at and above every contribution or tax boundary.
  3. Compare synthetic scenarios with the approved payroll reference.
  4. Obtain Finance or Payroll review for formula changes.
  5. Update the calculation specification and changelog.
  6. 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.