How the Bulgaria свободна професия calculator is verified

Inputs

InputFieldType
Annual revenue (EUR)annualRevenuenumber

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)
Deemed expenses (25%)deemedExpenses$round(annualRevenue * $const.deemedExpenseRate, 2)
Income After ExpensesincomeAfterExpenses$round(annualRevenue - deemedExpenses, 2)
Insurable baseinsurableBase$round($min([$max([incomeAfterExpenses, $const.minAnnualBase]), $const.maxAnnualBase]), 2)
Social + health contributionscontributions$round(insurableBase * $const.contributionRate, 2)
Income tax (10%)incomeTax$round($const.taxRate * $max([0, incomeAfterExpenses - contributions]), 2)
Net income / yearnetIncome$round($max([0, annualRevenue - contributions - 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
deemedExpenseRate0.25
contributionRate0.278
minAnnualBase7442.4
maxAnnualBase27600
taxRate0.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 — 30,000 EUR revenue — inside both insurable-base limits

given annualRevenue30000
expect deemedExpenses7500
expect incomeAfterExpenses22500
expect insurableBase22500
expect contributions6255
expect incomeTax1624.5
expect netIncome22120.5

Case 2 — 50,000 EUR revenue — contributions stop at the maximum insurable income

given annualRevenue50000
expect deemedExpenses12500
expect incomeAfterExpenses37500
expect insurableBase27600
expect contributions7672.8
expect incomeTax2982.72
expect netIncome39344.48

Case 3 — 6,000 EUR revenue — the base is lifted to the statutory minimum

given annualRevenue6000
expect incomeAfterExpenses4500
expect insurableBase7442.4
expect contributions2068.99

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 Bulgaria свободна професия calculator

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