How the Belgium vacances annuelles calculator is verified

Inputs

InputFieldType
Days worked or assimilated LAST year (full-time five-day equivalent)workDaysReferenceYearnumber
Working days in your week this yeardaysPerWeeknumber
Days already takendaysTakennumber

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)
Five Day Equivalent DaysfiveDayEquivalentDays($d := $n(workDaysReferenceYear); $count([$const.bandFloor1, $const.bandFloor2, $const.bandFloor3, $const.bandFloor4, $const.bandFloor5, $const.bandFloor6, $const.bandFloor7, $const.bandFloor8, $const.bandFloor9, $const.bandFloor10, $const.bandFloor11, $const.bandFloor12, $const.bandFloor13, $const.bandFloor14, $const.bandFloor15, $const.bandFloor16, $const.bandFloor17, $const.bandFloor18, $const.bandFloor19, $const.bandFloor20][$ <= $d]))
Days EntitleddaysEntitled$round(fiveDayEquivalentDays * $n(daysPerWeek) / $const.fullTimeDaysPerWeek, 1)
Days RemainingdaysRemaining($r := daysEntitled - $n(daysTaken); $r < 0 ? 0 : $round($r, 1))

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
bandFloor110
bandFloor220
bandFloor339
bandFloor448
bandFloor564
bandFloor677
bandFloor787
bandFloor897
bandFloor9106
bandFloor10125
bandFloor11135
bandFloor12144
bandFloor13154
bandFloor14163
bandFloor15182
bandFloor16192
bandFloor17202
bandFloor18212
bandFloor19221
bandFloor20231
fullTimeDaysPerWeek5

Test vectors (8)

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 — BE1 a full year (260 days): 20 days of leave

given workDaysReferenceYear260
given daysPerWeek5
given daysTaken0
expect fiveDayEquivalentDays20
expect daysEntitled20

Case 2 — BE2 231 days is still the full 20

given workDaysReferenceYear231
given daysPerWeek5
given daysTaken0
expect daysEntitled20

Case 3 — BE3 230 days drops to 19

given workDaysReferenceYear230
given daysPerWeek5
given daysTaken0
expect daysEntitled19

Case 4 — BE4 half a year (130 days): 10

given workDaysReferenceYear130
given daysPerWeek5
given daysTaken0
expect daysEntitled10

Case 5 — BE5 nine days earns nothing

given workDaysReferenceYear9
given daysPerWeek5
given daysTaken0
expect daysEntitled0

Case 6 — BE6 a six-day week: 24 days

given workDaysReferenceYear260
given daysPerWeek6
given daysTaken0
expect daysEntitled24

Case 7 — BE7 a four-day week: 16

given workDaysReferenceYear260
given daysPerWeek4
given daysTaken0
expect daysEntitled16

Case 8 — BE8 never negative

given workDaysReferenceYear260
given daysPerWeek5
given daysTaken40
expect daysRemaining0

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 Belgium vacances annuelles calculator

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