Feature: Calculate leave entitlements from policies
Description
HR manages leave policies under Administration > Leave policies: the days per year for a reference week, the unit days or hours, yearly or monthly granting, rounding, carry-over and whom a policy applies to. The most specific policy applies; two policies with the same type and scope cannot overlap, and the statutory minimum of four weeks cannot be undercut.
The entitlement of a year is pro-rated by full months of employment and the working days of each month (or the
weekly contract time under hours), rounded once, and never below the statutory minimum. In an exit year after June
and the waiting period, the statutory part stays whole. Employees, their managers and HR see the calculation on the
leave balance; the API offers it as get.
Policies decide the unit of a ledger, add their planned grants and accruals to the forecast, and let monthly days be used before they are granted where the policy allows it. A change of unit is booked as a pair of conversion entries.
Impact
Two new tables and a new entry in the navigation. Entitlement in the API is a number,
since a rotation can average a fraction of a day. Leave types with policies or ledger entries can no longer be
deleted. The demo company of ddev demo has a vacation policy of 30 days.