How the Argentina vacaciones calculator is verified

Inputs

InputFieldType
Years of seniority you will have at 31 DecemberserviceYearsnumber
Days you work per weekdaysPerWeeknumber
Días hábiles on which you rendered servicediasHabilesWorkednumber
Días hábiles in the yeardiasHabilesInYearnumber
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)
Band Days CorridosbandDaysCorridos($s := $n(serviceYears); $s <= $const.bandYears5 ? $const.bandDaysTo5Years : ($s <= $const.bandYears10 ? $const.bandDaysTo10Years : ($s <= $const.bandYears20 ? $const.bandDaysTo20Years : $const.bandDaysOver20Years)))
Days Corridos EntitleddaysCorridosEntitled($gate := $n(diasHabilesWorked) >= ($n(diasHabilesInYear) / $const.qualifyingHalfDivisor); $gate ? bandDaysCorridos : $floor($n(diasHabilesWorked) / $const.workDaysPerRestDay))
Days EntitleddaysEntitled$round(daysCorridosEntitled / $const.daysPerCalendarWeek * $n(daysPerWeek), 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
bandDaysTo5Years14
bandDaysTo10Years21
bandDaysTo20Years28
bandDaysOver20Years35
bandYears55
bandYears1010
bandYears2020
qualifyingHalfDivisor2
workDaysPerRestDay20
daysPerCalendarWeek7

Test vectors (13)

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 — N1 band a is 14 días corridos, which is about ten working days on a five-day week

given serviceYears3
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect bandDaysCorridos14
expect daysCorridosEntitled14
expect daysEntitled10

Case 2 — N2 five years is still band a, because the article says 'no exceda de cinco'

given serviceYears5
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect bandDaysCorridos14

Case 3 — N3 just over five years reaches 21 corridos, about 15 working days

given serviceYears6
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect bandDaysCorridos21
expect daysEntitled15

Case 4 — N4 ten years is still band b

given serviceYears10
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect bandDaysCorridos21

Case 5 — N5 eleven years reaches 28 corridos, about 20 working days

given serviceYears11
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect bandDaysCorridos28
expect daysEntitled20

Case 6 — N6 over twenty years is the top band, 35 corridos or about 25 working days

given serviceYears21
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect bandDaysCorridos35
expect daysEntitled25

Case 7 — N7 exactly twenty years is still band c

given serviceYears20
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect bandDaysCorridos28

Case 8 — N8 below art. 151's half-year gate, art. 153 gives one day per twenty worked

given serviceYears3
given daysPerWeek5
given diasHabilesWorked100
given diasHabilesInYear250
given daysTaken0
expect daysCorridosEntitled5
expect daysEntitled3.6

Case 9 — N9 at exactly half the días hábiles the band applies again

given serviceYears3
given daysPerWeek5
given diasHabilesWorked125
given diasHabilesInYear250
given daysTaken0
expect daysCorridosEntitled14

Case 10 — N10 under twenty worked days art. 153 gives nothing

given serviceYears3
given daysPerWeek5
given diasHabilesWorked19
given diasHabilesInYear250
given daysTaken0
expect daysCorridosEntitled0
expect daysEntitled0

Case 11 — N11 a six-day week gets more working days out of the same 14 corridos

given serviceYears3
given daysPerWeek6
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken0
expect daysEntitled12

Case 12 — N12 days already taken come off the remainder

given serviceYears11
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
given daysTaken8
expect daysRemaining12

Case 13 — N13 taking more than the entitlement never goes negative

given serviceYears3
given daysPerWeek5
given diasHabilesWorked250
given diasHabilesInYear250
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 Argentina vacaciones calculator

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