.. include:: /Includes.rst.txt .. _feature-1791533307: =============================== Feature: Penalties deduct leave =============================== Description =========== Where a leave policy allows it (``penaltyDeductionAllowed``, off by default) and the company uses leave deductions as penalties, a penalty of the core penalty account deducts leave: optionally from the carried-over leave first, never beyond the balance, and for statutory vacation never into the statutory minimum. A refused deduction is answered with 422 and its reason (``penaltyNotAllowed``, ``insufficientBalance``, ``statutoryMinimum``, ``ineligible``, ``unitMismatch``), and no penalty is stored. The deduction is a ledger entry of the new type ``penalty``; withdrawing the penalty gives exactly what it took back. The penalty dialog of the profile offers the leave deduction, and the policy form the new switch. Impact ====== The migration adds ``leave_policy.penalty_deduction_allowed`` and the table ``leave_penalty_booking``. Ledger lists and filters know the entry and source type ``penalty``. Penalties imported by the migration book nothing. .. index:: API, Database, Frontend, package:adsum-leave