.. include:: /Includes.rst.txt .. _feature-1791280891: ====================================== Feature: Pay out leave within its rule ====================================== Description =========== HR pays out leave on the new :guilabel:`Encashment` tab of a person's balance, or through ``createLeaveEncashment`` (``POST /employees/{id}/leave-encashments``). ``getLeaveEncashableQuantity`` tells how much the type's ``encashmentRule`` allows on a date: nothing under ``never``, the remainder at exit under ``onExitOnly``, the part above the statutory minimum during the employment under ``aboveStatutoryMinimum``, and the balance under ``any``. The payout is booked as an ``encashment`` entry that consumes the balance in the usual order, counts as deducted in the leave figures and publishes ``LeaveEncashed`` with the quantity and unit but no amount of money; payroll values it. ``reverseLeaveEncashment`` gives the days back. Impact ====== The new table ``leave_encashment`` is created by a migration. HR never pays out their own leave, and an employee reads only their own encashable quantity. .. index:: API, Database, Frontend, package:adsum-leave