How the Belgium vacances annuelles calculator is verified
Inputs
| Input | Field | Type |
|---|---|---|
| Days worked or assimilated LAST year (full-time five-day equivalent) | workDaysReferenceYear | number |
| Working days in your week this year | daysPerWeek | number |
| Days already taken | daysTaken | number |
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 value | Field | Formula (JSONata) |
|---|---|---|
| Five Day Equivalent Days | fiveDayEquivalentDays | ($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 Entitled | daysEntitled | $round(fiveDayEquivalentDays * $n(daysPerWeek) / $const.fullTimeDaysPerWeek, 1) |
| Days Remaining | daysRemaining | ($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.
| Constant | Value |
|---|---|
bandFloor1 | 10 |
bandFloor2 | 20 |
bandFloor3 | 39 |
bandFloor4 | 48 |
bandFloor5 | 64 |
bandFloor6 | 77 |
bandFloor7 | 87 |
bandFloor8 | 97 |
bandFloor9 | 106 |
bandFloor10 | 125 |
bandFloor11 | 135 |
bandFloor12 | 144 |
bandFloor13 | 154 |
bandFloor14 | 163 |
bandFloor15 | 182 |
bandFloor16 | 192 |
bandFloor17 | 202 |
bandFloor18 | 212 |
bandFloor19 | 221 |
bandFloor20 | 231 |
fullTimeDaysPerWeek | 5 |
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 workDaysReferenceYear | 260 |
|---|---|
given daysPerWeek | 5 |
given daysTaken | 0 |
expect fiveDayEquivalentDays | 20 |
expect daysEntitled | 20 |
Case 2 — BE2 231 days is still the full 20
given workDaysReferenceYear | 231 |
|---|---|
given daysPerWeek | 5 |
given daysTaken | 0 |
expect daysEntitled | 20 |
Case 3 — BE3 230 days drops to 19
given workDaysReferenceYear | 230 |
|---|---|
given daysPerWeek | 5 |
given daysTaken | 0 |
expect daysEntitled | 19 |
Case 4 — BE4 half a year (130 days): 10
given workDaysReferenceYear | 130 |
|---|---|
given daysPerWeek | 5 |
given daysTaken | 0 |
expect daysEntitled | 10 |
Case 5 — BE5 nine days earns nothing
given workDaysReferenceYear | 9 |
|---|---|
given daysPerWeek | 5 |
given daysTaken | 0 |
expect daysEntitled | 0 |
Case 6 — BE6 a six-day week: 24 days
given workDaysReferenceYear | 260 |
|---|---|
given daysPerWeek | 6 |
given daysTaken | 0 |
expect daysEntitled | 24 |
Case 7 — BE7 a four-day week: 16
given workDaysReferenceYear | 260 |
|---|---|
given daysPerWeek | 4 |
given daysTaken | 0 |
expect daysEntitled | 16 |
Case 8 — BE8 never negative
given workDaysReferenceYear | 260 |
|---|---|
given daysPerWeek | 5 |
given daysTaken | 40 |
expect daysRemaining | 0 |
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.