Skip to content

Leave: go-live, holidays and year end

What HR and the administrator do to run leave: before the first application, each year, at the leave year end, and when the nightly job did not run.

Rules: 22 · Leave and the employee agreement. Screens: Leave, Employee agreement. Most steps are in Leave admin (/leave/admin, hr.leave.admin); the holiday calendar is at /leave/holidays (hr.holidays.manage). Every change is audited.

Nobody adjusts, credits comp-off to or changes the leave record of their own login (LV-051). HR's own record is set by another member of HR or by the super admin.

Before go-live

Do these once, in this order, before staff are told to apply.

  1. Joining dates. Every employee needs a joining date on their employee record (People → Employees → the record → Edit profile). HR sets it with hr.profiles.edit (ACC-084); an IT Admin's or Super Admin's is set by an admin. Without it nothing is credited and an application is refused (LV-001). In Leave admin → Employees, the column on the leave policy shows who is missing.
  2. Reporting managers. Set "reports to" on each employee record. It is needed for anyone in HR (their leave goes to their manager — LV-031); without it their application is refused. It also decides who sees whom in the team view and who is told about an absence, and who gets the leave e-mails as reporting officer (LV-036). Check that every employee's login has their real company e-mail: a placeholder address or a paused login gets no leave e-mail. The e-mails are on by default; Leave admin → Settings → Send leave e-mails switches them off (LV-039).
  3. Confirmation dates. In Leave admin → Employees, set the date of each confirmed employee's written confirmation letter. Anyone without one is treated as on probation: EL is locked and CL / SL is limited (LV-011).
  4. Notice periods. For anyone serving notice, set the start and end (LV-040).
  5. Signatory. In Leave admin → Settings, fill in the authorised signatory's name and designation, and check the company's legal name and address. An agreement cannot be issued while the signatory is empty (EA-010, open).
  6. Run the accruals once. Leave admin → Accruals & year end → Run accruals now (up to today). This credits the current year's CL / SL and the earned leave of every completed month back to the start of the previous leave year (LV-062).
  7. Opening balances. For each employee, compare the balances with the paper records. Enter what the system cannot know as an Opening balance adjustment with a reason — for example EL carried forward from before the previous leave year, or leave already taken this year ("CL/SL taken before go-live, per the attendance register" as a negative adjustment). Enter maternity leave, when it applies, as a Grant (LV-015). Adjustments are in half days and cannot be deleted; a mistake is corrected by another adjustment (LV-050).
  8. Check the nightly job exists. In the Supabase SQL editor:
select jobid, jobname, schedule, active from cron.job where jobname = 'alhuda-leave-nightly';

Expect one row, schedule 0 19 * * * (19:00 UTC, 00:30 India time), active. If there is no row, the database had no pg_cron when the migration ran: HR runs the accruals by hand at least once a month (step 6), or the administrator schedules it:

select cron.schedule('alhuda-leave-nightly', '0 19 * * *', 'SELECT public.leave_nightly()');
  1. Holidays and peak seasons for the current year — below.

Each year

Holidays. In January, or as soon as the Company fixes them, check the calendar for the year (/leave/holidays). 2026 and 2027 are seeded with the eight Jammu & Kashmir holidays, twelve paid days a year:

Holiday 2026 2027 Days
Republic Day 26/01 26/01 1
Shab-e-Qadr 16/03 (tentative) 05/03 (tentative) 1
Eid-ul-Fitr 20/03 – 21/03 (tentative) 10/03 – 11/03 (tentative) 2
Nowruz 21/03 21/03 1
Eid-ul-Adha 27/05 – 29/05 (tentative) 17/05 – 19/05 (tentative) 3
Muharram (9th and 10th) 25/06 – 26/06 (tentative) 14/06 – 15/06 (tentative) 2
Independence Day 15/08 15/08 1
Gandhi Jayanti 02/10 02/10 1

The lunar dates are the expected ones and are seeded as tentative (LV-021), 2026's included: HR confirms each against the dates the office actually observed, corrects any that differ, and clears Tentative. In 2026 Nowruz falls on the second day of Eid-ul-Fitr (21/03). Both entries are kept, and the calendar counts days per entry, so it still shows 12. The system does not add a day in lieu for the overlap. From 2028 on, HR enters all of them. For each lunar holiday (Shab-e-Qadr, Eid-ul-Fitr, Eid-ul-Adha, Muharram 9 and 10):

  • enter it as tentative with the expected dates when the calendar is published;
  • when the moon is sighted, change the dates if needed and clear Tentative.

Kinds: public and festival are paid holidays and are not counted as leave; restricted is listed only. The calendar shows the year's paid holiday days; the policy gives 12 (LV-020). A holiday added or moved after an application was made does not change that application's days — correct it with an adjustment if needed.

Peak seasons. In Leave admin → Peak seasons, declare each peak season as a date range with a name (for example the Hajj season, Ramadan). Leave touching one needs management approval and 30 days' notice (LV-032). Which months are peak is not decided (open); only what HR declares counts. Declare them early — an application made before a season is declared was not checked against it.

Comp-offs. Record each weekly off or holiday worked on instruction soon after it, in Leave admin → Comp-off. A credit expires 90 days after the day worked and the nightly job lapses what is unused (LV-060, LV-061).

Year end (on or after 01/04)

The leave year ends on 31 March. Closing it is an explicit HR action, once per year (LV-052).

  1. Clear what is pending. The preview shows how many applications of the year are pending or have a cancellation asked for. Decide them first; days approved after the close are not in the carry-forward.
  2. Preview. Leave admin → Accruals & year end (one tab: the Accruals card, then the Year end card). In the Year end card choose the leave year that ended (for 01/04/2027–31/03/2028, choose 2027–28). The preview lists each person and leave type: balance, carried forward, lapsed and — only if year-end encashment is switched on (LV-053, open) — encashed days. EL carries forward up to 30 days; CL / SL and other yearly leave lapse.
  3. Close this year. The button shows only once the year has ended. It asks you to type the leave year to confirm — "2027–28" as shown, or with a keyboard hyphen "2027-28" (a slash or a space works too). The close first runs the accruals up to 31 March, then writes a carry-out and carry-forward pair, a lapse and any encashment per person to the ledger, and records the close. It cannot run before 01/04 and runs only once; a second click answers "already closed" and changes nothing.
  4. Check. The Year end card lists the closed years with who closed them. Open a few registers (Leave admin → Employees → Register on the person's row) for the new year: EL should start with the carried-forward days, and CL / SL with the new year's credit (the nightly job writes it on 01/04; run the accruals by hand if it has not).

The close cannot be undone. A wrong figure is corrected with an adjustment on the person's register.

Absences and corrections during the year

An absence older than the reporting window. An employee reports their own absence up to 3 days back (a setting). For an older one — found on the attendance register, say — use Leave admin → Record an absence: choose the employee, record it as CL / SL, comp-off or LWP, the first and last day, and a reason. It is filed already approved and taken from the balance; any days beyond the balance become leave without pay. The employee and their reporting manager are told. You cannot record your own; another member of HR or the super admin does (LV-042). A closed leave year takes no new record: use an adjustment on the register instead (LV-051).

Cancelling someone's leave. Open the application — Leave approvals → Timeline on its card, or Leave admin → Employees → Register — and choose Cancel this leave. Give the reason; the applicant sees it. The days go back to the balance. This works for pending and approved leave, before or after it starts (LV-033). Nothing is deleted: the application stays in the register as Cancelled.

If the nightly job did not run

The job credits yearly leave, accrues EL for months that ended and expires comp-offs (LV-062). It is safe to run any number of times: nothing is credited twice.

  1. Check the schedule (step 8 above) and its last runs:
select status, return_message, start_time
  from cron.job_run_details
 where jobid = (select jobid from cron.job where jobname = 'alhuda-leave-nightly')
 order by start_time desc limit 10;

Each run also writes an audit row leave_accruals_run. The job catches its own error and answers it instead of failing, so read return_message as well as status. 2. Catch up: Leave admin → Accruals & year end → Run accruals now (up to today), or as the administrator select public.leave_nightly();. 3. Re-create the schedule if it is missing (step 8).

A missed night costs nothing once the catch-up runs. EL is filled in only back to the start of the previous leave year; anything older is an opening balance.

What this runbook does not cover

  • Payroll: leave without pay and encashment are days in the ledger, not money (LV-041). Give payroll the register export.
  • Issuing agreements: see Employee agreement.