.. include:: /Includes.rst.txt .. _feature-1791004917: ============================================ Feature: Keep leave in an append-only ledger ============================================ Description =========== Every change of a leave balance is a booking in a ledger that is never changed: grants, days taken, refunds, expiries and corrections. The balance on a date is the sum of the bookings up to it; days with an end date count only until then. Leave taken uses the days that expire first, and a refund gives the days back to exactly the bookings they came from. Two bookings of one employee at the same moment cannot both take the last day. The console command ``app:leave:opening-balance`` takes over the balance an employee had in a previous system for the period it covers. Running it again for the same period books nothing. Impact ====== Two new tables. The working-time and leave ledgers are checked by the same architecture test, which now also finds DQL deletes without ``FROM``. .. index:: Database, CLI, package:adsum-leave