1. Home
  2. HRM
  3. Leaves
  4. Leaves Calculation

Leaves Calculation

🧮 How the System Calculates Your Leaves

This article explains how the Leaves engine arrives at your paid / unpaid split, your day count and your closing balance. It does not expose the internal formulas — only the inputs you control and the rules the engine follows. For who-can-do-what and the form fields, see the Leaves Overview.

📌 The four inputs that decide everything:

  • Leave Type — selected on the leave form (Casual / Sick / Earned / Compensatory / Unpaid …).
  • From Date — End Date (and the Half Leave tick).
  • Available Paid Balance for that leave type, at the time of application.
  • Company Policy — Accrual frequency, Sandwich rule, Probation rule, Notice rule, Encashment rule (all configured in Settings > Leaves and Settings > Salary).

1. Leave Accrual

  • Leaves accrue Monthly or Yearly depending on the company policy chosen in Settings > Leaves.
  • Monthly accrual fires automatically every time salary is generated for an employee — you do not need to push a button.
  • For new joiners, the starting / opening balance is allocated when the user is saved with Is Employee = Yes (and again on any later No → Yes transition).
  • Carry-Forward Limit — extra unused balance carries to the next financial year up to the per-type cap defined in Leave Settings.
  • Encashment — unused balance is converted to money at year-end or exit. The encashment uses a 30-day-month divisor against the basic-salary input (changed from the older /26 rule).

📍 Screen: Settings > Leaves > Accrual Frequency, Carry Forward Limit, Encashment On (Year-End / Exit), Encashment Month.

2. Day-Counting Rules

The engine counts the days between From Date and End Date — but a few rules can add to or fractionalise that raw number.

RuleWhat it doesWhen it applies
Half LeaveThe whole application counts as 0.5 day (one of First Half / Second Half).When Half Leave tick is on. Sandwich rule is automatically skipped for half-day applications.
Same-Day From / EndCounts as 1 day.When From Date == End Date and Half Leave is off.
RangeCounts the calendar days between From and End (inclusive of both ends).Default behaviour for any multi-day application.
Sandwich LeaveHolidays / weekends sandwiched between two leave records (or inside one) are pulled into the leave count.Only when Sandwich Rule = On in Settings > Leaves and Salary Calculation Type is set in a way that recognises non-working days. Both adjoining leaves must be full-day for sandwich to fire.
Cannot Start / End on Off-DayThe engine rejects an application that starts or ends on a weekend / declared holiday — you must trim the dates.Always.

💡 Tip — Sandwich behaviour at salary time: If your company computes salary on a Working Days basis and Sandwich rule is on, a warning popup appears at salary generation. Review the calculation before confirming — the two rules together can change the deduction count.

3. Paid vs Unpaid Split

Once the day-count is known, the system splits it into Total Paid Leaves + Total Unpaid Leaves. The split is driven by these inputs — in this order of precedence:

  1. Probation period — if the employee is still inside their probation window and the company has Paid Leave During Probation = Off, the leave is forced to Unpaid.
  2. Notice period — if the employee has resigned and the leave falls inside the notice window and the company has Paid Leave During Notice = Off, the leave is again forced to Unpaid.
  3. Available Paid Balance for that leave type — consumed first.
  4. Any remaining days that exceed the available paid balance → counted as Unpaid automatically.
  5. Leaves of a type that is unpaid by definition (e.g. Loss of Pay / LOP) are always Unpaid regardless of balance.
  6. Leaves marked Unnotified are always Unpaid — this is the equivalent of “absent without applying”.

⚠️ Important: If you apply for leave but do not get it approved before salary generation for that month, the system treats it as Unpaid for that payroll. Approving it later does not retroactively undo the deduction in a closed payroll period.

4. Estimated Balance vs Final Balance

BalanceWhat it means
Estimated BalanceShown live as you fill the leave form. Reflects current Allocated − Used − Pending. Can change as more leaves are applied or approved before salary generation.
Final BalanceLocked once salary for that month is generated. The engine reads the leave state at salary-run time and freezes Used / Carry-Forward / Encash for that period.

📍 Screen: User Management > Users > pick a user > Statements tab > Leave Statement sub-tab — running view of Opening, Accrued, Used, Encashed and Closing per leave type.

5. Cancellation & Restoration

  • Cancelled Leave (was Approved): The paid days are restored to the balance; unpaid days simply drop out of the count.
  • Cancelled Leave (was Pending): No effect — nothing was deducted yet.
  • Edit after Approval: Only users with Leave Override permission can do this. The engine recomputes the day-count on save, and any change is recorded in the leave’s Change Log.
  • If the cancellation crosses a closed salary month, the Restored balance shows up as a Closing Balance adjustment in the next salary cycle — the previously paid salary stays as is.

📐 Worked Example — Mixed Paid & Unpaid

  • You have 2 Paid Days balance for Casual Leave.
  • You apply for 4 Days Leave (Mon – Thu).
  • Manager approves all 4 days as Paid.
  • System still splits the application: 2 days Paid (consume balance) + 2 days Unpaid (over-balance).
  • Salary deducts the 2 unpaid days at the per-day rate — the approver’s “all paid” intent does not over-rule the balance check.

📐 Worked Example — Sandwich Rule

  • Company has Sandwich Rule = On; Saturday & Sunday are weekly off.
  • Employee applies for leave on Friday and again on the next Monday (two separate full-day records).
  • Saturday & Sunday have no leave applied for them.
  • The engine sees only off-days between the two leaves → the 4-day stretch is treated as a continuous leave; Sat + Sun are pulled into the deduction count.
  • If either side is a half-day, the sandwich check is skipped — only Fri + Mon are deducted.

📐 Worked Example — Probation / Notice

  • Employee joined 1 Jan, probation = 90 days; Settings > Leaves has Paid Leave During Probation = Off.
  • Employee applies for 2-day Casual Leave on 15 Feb.
  • 15 Feb is inside the probation window → engine forces both days to Unpaid, regardless of available balance.
  • Same logic applies after a resignation is filed and the leave falls inside the configured notice window.

💡 Tip: You can view your leave balance any time in the HRM > Leaves > Balance view, or open the per-employee Leave Statement from the user / employee aside.

⚠️ Warning: Once any leave value is filled against an employee, the Leave Settings page is locked from editing — plan your leave types, opening balances and accrual rules before going live.

🔗 Related Articles:

How can we help?