> ## Documentation Index
> Fetch the complete documentation index at: https://human-resource-docs.ha-consultancy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Leave Deduction Rules

> Configure per-leave-plan salary deduction rules that reduce specific salary components — basic, transport, housing — when an employee takes unpaid leave.

Leave Deduction Rules let you say "when an employee is on this type of leave, deduct *N%* from this specific salary component for every day of leave taken." A common use is: when on **Unpaid Leave**, deduct 100% of **Basic Salary** and 100% of **Transportation Allowance**, but leave **Housing Allowance** intact.

Rules are configured per **Leave Config** (per leave plan, not per leave type) — so the same leave type can have different deduction profiles for different employee tiers.

## When the rules are evaluated

During the monthly salary calculation (`Calculate Monthly Salary HAC`, Codeunit `70003107`), the leave-management codeunit (`Leave Mng HAC`, Codeunit `70003112`) iterates every leave journal entry for the month and applies the matching rules:

```
deduction = Salary Component Amount × (Deduction Percentage / 100) × Number of Days on Leave
```

The deduction is added to the **Salary Employee Breakdown** with `Type = Leave Deduction`. It appears as a negative line on the payslip preview and reduces the employee's net pay.

## Prerequisites

A deduction rule will only ever apply if the leave plan permits it. Two layers gate the behaviour:

1. **Leave Type Config → `Has Deduction Rules`** — turn this on for the leave type that should be deductible (e.g. Unpaid Leave). Until this is checked, the **Leave Deduction Rules** subform on Leave Config is hidden.
2. **Leave Config → `Ability to non-deduct`** — when ticked, the engine **skips** the rule entirely for that plan, even if rules are configured. Use this on plans where you want to disable deduction without deleting the rows.

## Walkthrough

### 1. Enable deduction on the leave type

1. Open **Tell Me** → **Leave Type Config List**.
2. Open the leave type (e.g. `UNPAID`).
3. Tick **Has Deduction Rules**.
4. Close.

### 2. Add rules to the leave plan

1. Open **Tell Me** → **Leave Config List**.
2. Open the leave plan whose deduction profile you want to define.
3. Scroll to the **Leave Deduction Rules** part — it now appears because step 1 enabled it.
4. Add one line per salary component to deduct:

| Field                | Notes                                                                                                                 |
| -------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Salary Type          | A value from your Salary Type list (e.g. `Basic Salary`, `Transportation Allowances`). Must exist or insertion fails. |
| Deduction Percentage | A decimal between 0 and 100. `100` means deduct the full daily share of that component for each day on leave.         |
| From Day / To Day    | Optional banded percentages — see below.                                                                              |

The engine enforces **one rule per (Leave Config, Salary Type)** pair. Trying to add a duplicate raises *"A deduction rule for this salary type is already configured for this leave type."*

### 3. Verify

Run a payslip preview for an employee who has time on the matching leave plan during the period. You should see negative `Leave Deduction` lines in the breakdown, one per Salary Type rule.

## Banded deductions (From Day / To Day)

The `From Day` / `To Day` columns let you scale the percentage by leave duration. Typical setup:

| From Day | To Day | Deduction Percentage |
| -------- | ------ | -------------------- |
| 1        | 5      | 0                    |
| 6        | 15     | 50                   |
| 16       | 999    | 100                  |

This reads as: "first five days of leave free, days 6–15 deduct 50%, beyond that deduct fully." Leave both columns at zero if you don't need banding — the percentage then applies uniformly to every day.

## Common pitfalls

| Symptom                                                            | Cause                                                                                                                         |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| The **Leave Deduction Rules** section is invisible on Leave Config | `Has Deduction Rules` is off on the parent Leave Type Config                                                                  |
| Rules exist but no deduction appears on the payslip                | `Ability to non-deduct` is ticked on the Leave Config, or the salary package has no item matching the Salary Type in the rule |
| *"The selected salary type does not exist."*                       | The Salary Type entered isn't in **Salary Type List** — open Salary Type List and add it first                                |
| Deduction is twice what you expect                                 | A rule exists for both the leave plan and the leave type independently — review the subform for the active plan               |

## Object reference

| Object                                  | ID       | Notes                                                                     |
| --------------------------------------- | -------- | ------------------------------------------------------------------------- |
| Table `Leave Deduction Rule HAC`        | 70003148 | Stores the rules; PK = `Leave Config Code` + `No.`                        |
| Table `Leave Type Config HAC`           | 70003123 | Field 4 — `Has Deduction Rules` — is the master switch                    |
| Table `Leave Config HAC`                | 70003124 | Owns the rules via the subform; `Ability to non-deduct` overrides them    |
| Page `Leave Ded. Rule Subform HAC`      | 70003141 | The subform shown inside Leave Config                                     |
| Codeunit `Leave Mng HAC`                | 70003112 | Validates rules on insert and evaluates them in `CalculateLeaveDeduction` |
| Codeunit `Calculate Monthly Salary HAC` | 70003107 | Calls into `Leave Mng HAC` during payslip generation                      |

<Note>
  The standalone `Deduction Setup HAC` table (Tab `70003131`) is a legacy structure with no page and no consumer in the current codebase. It is reserved for future use and does **not** affect payroll. The active deduction surface is `Leave Deduction Rule HAC` as described above.
</Note>

## Related pages

* [Leave management](/features/leave-management) — leave types, plans, and request flow
* [Payroll setup](/features/payroll-setup) — salary types and the components rules can target
* [First-Time Configuration](/getting-started/configure) — high-level setup overview
