Skip to main content

Function: thirteenthMonthRemainingCentavos()

thirteenthMonthRemainingCentavos(periodBasicCentavos, alreadyPaidCentavos): number

Defined in: src/lib/pay/thirteenthMonth.ts:48

Entitlement still owed after what's already been disbursed this year (never negative).

Computes the full-year entitlement via thirteenthMonthCentavos and subtracts what has already been paid out, clamping the result at zero so an over-disbursement reports 0 remaining rather than a negative balance. alreadyPaidCentavos is truncated toward zero before subtracting. Does not decide WHEN or HOW the remainder is disbursed (December lump sum vs. split across periods); that policy is configured elsewhere. Pure; no I/O or side effects.

Parameters

periodBasicCentavos

readonly number[]

Each pay period's basic pay for the year, in integer centavos (see thirteenthMonthCentavos for what counts as "basic").

alreadyPaidCentavos

number

13th-month already disbursed this year, in integer centavos.

Returns

number

The remaining 13th-month entitlement still owed, in integer centavos (>= 0 for finite inputs).