How the Romania pfa calculator is verified

Inputs

InputFieldType
Annual net income after expenses (RON)annualNetIncomenumber

The formula

Each derived value below is computed by the Valem engine from the expression shown, in this order. Nothing else runs — there is no hidden code path.

Derived valueFieldFormula (JSONata)
Cas BasecasBaseannualNetIncome >= $const.casUpperStep ? $const.casUpperStep : (annualNetIncome >= $const.casFloor ? $const.casFloor : 0)
CAS (pension)cas$round(casBase * $const.casRate, 2)
Cass BasecassBase$round($min([$max([annualNetIncome, $const.cassFloor]), $const.cassCeiling]), 2)
CASS (health)cass$round(cassBase * $const.cassRate, 2)
Income tax (10%)incomeTax$round($const.incomeTaxRate * $max([0, annualNetIncome - cas - cass]), 2)
Net income / yearnetIncome$round($max([0, annualNetIncome - cas - cass - incomeTax]), 2)

Rates and thresholds

The expressions above read these as $const. They are the figures the annual refresh replaces, so they live as data rather than being written into the formulas — which is what makes a year-on-year change a one-line diff instead of an edit to arithmetic.

ConstantValue
casFloor48600
casUpperStep97200
cassFloor24300
cassCeiling291600
casRate0.25
cassRate0.1
incomeTaxRate0.1

Test vectors (3)

Every case is executed against this model on each build, by the Java engine and independently by a JavaScript one. A mismatch of a single cent fails the build, so the page cannot ship advertising a figure the model no longer produces.

Case 1 — 60,000 RON net income — above the CAS floor, below the upper step

given annualNetIncome60000
expect casBase48600
expect cas12150
expect cassBase60000
expect cass6000
expect incomeTax4185
expect netIncome37665

Case 2 — 30,000 RON net income — below the CAS floor, so no pension contribution at all

given annualNetIncome30000
expect casBase0
expect cas0
expect cassBase30000
expect cass3000
expect incomeTax2700
expect netIncome24300

Case 3 — 350,000 RON net income — CAS at its upper step, CASS at the 72-minimum-wage ceiling

given annualNetIncome350000
expect casBase97200
expect cas24300
expect cassBase291600
expect cass29160
expect incomeTax29654
expect netIncome266886

Sources

Check it yourself — and reuse it

The whole model as JSON — inputs, outputs, formulas, vectors and sources in one re-runnable document.

This model is published under CC BY 4.0: use it, adapt it, build on it, with attribution. The licence covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds are law, and nobody licenses those; the sources above are where they come from.

← Back to the Romania pfa calculator

Built with Valem — a live, verifiable calculator you can fork and embed.