Skip to main content

Function: generateThirteenthMonth()

generateThirteenthMonth(batchId): Promise<ThirteenthMonthState>

Defined in: src/server/actions/thirteenthMonth.ts:31

Owner-only: generate the 13th-month pay tranche for a draft pay run, but only for the two disbursement periods (16–30 Nov, 1–15 Dec) and only for thirteenth_month_eligible contractors.

Statutory entitlement (PD 851) = year-to-date basic ÷ 12; each contractor's tranche tops up to that entitlement (so November pays what's earned through November, December pays the remainder). It is written as a payment_adjustment (kind allowance) so the existing, tested net-pay recompute + payment-lock + payslip plumbing applies unchanged. Idempotent per run. The owner reviews amounts before funding.

Parameters

batchId

string

Returns

Promise<ThirteenthMonthState>