# Payroll Settings

<p class="doc-lead">Payroll Settings control how salaries are calculated in every pay run — the per-day rate method, pro-rata vs deduction style, attendance linkage, holiday treatment during unpaid leave, and payslip display. Configure these once; every <a href="#/payroll/pay-run">Pay Run</a> uses them when computing earnings and LOP deductions.</p>

<div class="doc-toc">
<p class="doc-toc-title">On this page</p>
<div class="doc-toc-section">
<span class="doc-toc-group-title">Settings</span>
<div class="doc-toc-links">
<a href="#/payroll/payroll-settings-config?id=overview">Overview</a>
<a href="#/payroll/payroll-settings-config?id=general">General Settings</a>
<a href="#/payroll/payroll-settings-config?id=net-pay-formula">Net Pay Formula</a>
<a href="#/payroll/payroll-settings-config?id=salary-calculation">Salary Calculation</a>
<a href="#/payroll/payroll-settings-config?id=per-day-method">Per-Day Calculation Method</a>
<a href="#/payroll/payroll-settings-config?id=calculation-style">Salary Calculation Style</a>
<a href="#/payroll/payroll-settings-config?id=calendar-days-mode">Calendar Days Mode</a>
<a href="#/payroll/payroll-settings-config?id=holidays-during-lop">Holidays During Unpaid Leave</a>
<a href="#/payroll/payroll-settings-config?id=day-count-fields">Day-Count Fields</a>
<a href="#/payroll/payroll-settings-config?id=combination-matrix">Combination Matrix</a>
<a href="#/payroll/payroll-settings-config?id=special-scenarios">Special Scenarios</a>
<a href="#/payroll/payroll-settings-config?id=payrun-view">Pay Run View</a>
<a href="#/payroll/payroll-settings-config?id=commission">Sale Invoice Commission</a>
</div>
</div>
<div class="doc-toc-section">
<span class="doc-toc-group-title">More</span>
<div class="doc-toc-links">
<a href="#/payroll/payroll-settings-config?id=settings-reference">Settings Quick Reference</a>
<a href="#/payroll/payroll-settings-config?id=best-practices">Best Practices</a>
<a href="#/payroll/payroll-settings-config?id=faq">FAQ</a>
<a href="#/payroll/payroll-settings-config?id=related">Related</a>
</div>
</div>
</div>

<hr class="doc-section-divider">

<h2 id="overview">Overview</h2>

Go to <b>Payroll → Settings → Payroll Settings</b>.

<img src="payroll/images/payrollsettings.webp" alt="Payroll Settings" loading="lazy">

These settings apply workspace-wide. When you create or recalculate a pay run, the engine reads them to determine:

- How many days to divide monthly salary by (the <b>divisor</b>)
- Whether LOP reduces earnings directly (pro-rata) or appears as separate deduction lines
- Whether attendance auto-fills present days, LOP, holidays, and OT
- How holidays inside an unpaid-leave stretch are treated

For production wages and piece-rate settings, see <a href="#/payroll/payroll-settings">Payroll Settings (overview)</a>.

<hr class="doc-section-divider">

<h2 id="general">General Settings</h2>

| **Setting** | **Description** |
|-------------|-----------------|
| Consider Attendance in Salary Calculation | When enabled (default), the pay run pulls <a href="#/hr/daily-attendance">Daily Attendance</a> and <a href="#/hr/leave-allowance">Leave Allowance</a> to auto-compute present days, LOP, paid leave, holidays, and OT. When disabled, you enter day counts manually and holidays come from the <a href="#/hr/holiday">Holiday</a> master and weekend configuration. |
| Enable Piece-Rate/Hourly-Rate Wages in Production | Turns on wage tracking on Production BOMs and Vouchers. Required before <a href="#/payroll/production-wage">Production Wage</a> lines appear in pay runs. |
| Show Leave Salary Days in Pay Run | Shows the <b>Leave Salary Days</b> field on the pay-run form for encashing unused leave (payment category Leave Salary). |
| Show Extra Payable Days in Pay Run | Shows the <b>Extra Payable Days</b> field for incentive or special payable days linked to the default extra-pay category. |
| Default Category for Extra Pay | Payment category used when extra payable days are entered. Only categories with <b>Applies to Extra Payable</b> enabled are valid. |

<hr class="doc-section-divider">

<h2 id="net-pay-formula">Net Pay Formula</h2>

<p>After all earning, deduction, and reimbursement lines are built, net pay for each employee is:</p>

<pre class="doc-formula">Net pay = Payment total − Deduction total + Expense total (+ round-off)</pre>

| **Component** | **Typical sources** |
|---------------|---------------------|
| Payment total | Basic, HRA, allowances, OT (category 7), production wages (6), leave salary (8), extra pay |
| Deduction total | Cash advance (1), deduction on expense (2), LOP (3) |
| Expense total | Approved <a href="#/payroll/expense-claim">Expense Claims</a> (category 5) |
| Round-off | Client rounding on the final net amount |

<p>On pay-run approve, the journal posts salary payable (account 57), reimbursement payable (62), and employee receivable (14) per line. Amounts round to 2 decimals in most regions; Oman and Bahrain journal postings use 3 decimals.</p>

<hr class="doc-section-divider">

<h2 id="salary-calculation">Salary Calculation</h2>

Three settings work together to compute monthly salary components (Basic, HRA, allowances):

1. <b>Per-Day Salary Calculation Method</b> — chooses the divisor (denominator)
2. <b>Salary Calculation Style</b> — chooses how LOP reduces pay
3. Supporting options — fixed days count, calendar mode, mid-month join, holiday-in-LOP rule

<p><b>Core formula (pro-rata, full month):</b></p>
<pre class="doc-formula">Per-day rate  = Monthly amount ÷ divisorDays
Earned amount = Per-day rate × effectivePaidDays</pre>

<p><b>Core formula (deduction mode, full month):</b></p>
<pre class="doc-formula">Full amount     = Monthly amount (for LOP-affected lines)
LOP deduction   = Monthly amount ÷ divisorDays × unpaidDays
Net for line    = Full amount − LOP deduction</pre>

<p>All line amounts are rounded to 2 decimal places.</p>

<hr class="doc-section-divider">

<h2 id="per-day-method">Per-Day Salary Calculation Method</h2>

<p>This setting (<code>salaryCalculationBasis</code>) defines <b>divisorDays</b> — how many days the monthly salary is spread over.</p>

<h3>Working Days (default)</h3>
<pre class="doc-formula">noOfDays          = pay period end − start + 1
noOfHolidays      = holidays in period (from attendance or Holiday master)
noOfWorkingDays   = noOfDays − noOfHolidays − holidayOvertimeDays
divisorDays       = noOfWorkingDays
noOfPaidDays      = noOfPresentDays = noOfWorkingDays − noOfLOPDays</pre>

<p><b>Example:</b> June has 30 calendar days, 5 holidays → working days = 25. Basic ₹30,000 → per-day rate = 30,000 ÷ 25 = ₹1,200/day. Employee present 23 days (2 LOP) → Basic earned = 23 × 1,200 = ₹27,600.</p>

<h3>Fixed Days</h3>
<pre class="doc-formula">divisorDays  = fixedSalaryDays   (e.g. 30 — set in Fixed Days for Salary Calculation)
noOfPaidDays = fixedSalaryDays − noOfLOPDays</pre>

<p><b>Example:</b> Basic ₹30,000, fixed days = 30, LOP = 2 → paid days = 28 → Basic = 28 × (30,000 ÷ 30) = ₹28,000. Holidays do not change the divisor; only LOP reduces paid days.</p>

<h3>Calendar Days (Range)</h3>
<pre class="doc-formula">divisorDays  = noOfCalendarDays (= length of pay period in days)
noOfPaidDays = noOfCalendarDays − noOfLOPDays</pre>

<p><b>Example:</b> Pay period 1 Jun–30 Jun (30 days), LOP = 2 → paid days = 28 → Basic ₹30,000 earned = 28 × (30,000 ÷ 30) = ₹28,000.</p>

<h3>Mid-Month Joiner Proration Divisor</h3>

<p>When an employee joins mid-period, salary is prorated:</p>
<pre class="doc-formula">Proration factor = noOfDaysInPeriod ÷ noOfDaysInMonth</pre>

| **Mid-Month Joiner Proration Divisor** | **noOfDaysInMonth** |
|----------------------------------------|---------------------|
| Calendar Days in Month (default) | Actual days in the calendar month (e.g. 31 for May) |
| Fixed Salary Days | <code>fixedSalaryDays</code> (e.g. 30) — only when basis is Fixed Days |

<p><b>Example:</b> Employee joins 16 Jun (15 days in period). Basic ₹30,000. Proration = 15 ÷ 30 = 0.5 → base for period = ₹15,000 before LOP adjustment.</p>

<hr class="doc-section-divider">

<h2 id="calculation-style">Salary Calculation Style</h2>

<h3>Pro-Rata (Based on Present Days)</h3>

<p>LOP-affected payment lines are <b>reduced directly</b> in the earnings section. The payslip shows a lower Basic/HRA amount.</p>

<p>For each LOP-affected monthly component:</p>
<pre class="doc-formula">effectivePaidDays = noOfPaidDays                    (if isPaidLeaveAffected = true)
                  = noOfPaidDays − noOfPaidLeaves   (if isPaidLeaveAffected = false)

Earned = round((noOfDays ÷ noOfDaysInMonth) × (effectivePaidDays ÷ divisorDays) × monthlyAmount, 2)</pre>

<p>Full-month shortcut:</p>
<pre class="doc-formula">Earned = round((effectivePaidDays ÷ divisorDays) × monthlyAmount, 2)</pre>

<h3>Deduction Mode (Show Leave as Deduction)</h3>

<p>LOP-affected lines show the <b>full (prorated) salary</b> in earnings, then add separate <b>Loss of Pay</b> deduction lines (deduction category 3) for unpaid days.</p>

<pre class="doc-formula">unpaidDays = noOfLOPDays                              (if isPaidLeaveAffected = true)
           = noOfLOPDays + noOfPaidLeaves            (if isPaidLeaveAffected = false)

LOP deduction = round((noOfDays ÷ noOfDaysInMonth) × (unpaidDays ÷ divisorDays) × monthlyAmount, 2)</pre>

<h3>Pro-Rata vs Deduction — Payslip Display</h3>

<p>For a full month, both styles produce the <b>same net pay</b>. The difference is how the payslip reads:</p>

| **Aspect** | **Pro-Rata** | **Deduction Mode** |
|------------|--------------|-------------------|
| Earnings section | Shows reduced Basic/HRA (e.g. ₹27,600) | Shows full Basic/HRA (e.g. ₹30,000) |
| Deductions section | No LOP line for salary components | Explicit LOP line (e.g. ₹2,400, category Loss of Pay) |
| Net pay | Same | Same |
| Best for | Compact payslips | Audit trails and employee clarity on unpaid days |

<h3>Payment category flags</h3>

<p>Each component in <a href="#/payroll/salary-configuration">Salary Configuration</a> links to a <a href="#/payroll/payment-categories">Payment Category</a> with flags:</p>

| **Flag** | **Effect** |
|----------|------------|
| LOP Affected | Reduced when employee has LOP days |
| Paid Leave Affected | Paid leave days count toward effective paid days; if off, paid leave is treated like unpaid |
| Applies to Extra Payable | Included in extra-payable daily rate |
| Applies to Leave Salary | Included in leave-salary daily rate |

<p>Default Basic (id 1): all flags on. Default HRA (id 2): LOP affected, paid leave <b>not</b> affected — paid leave days reduce HRA in pro-rata mode.</p>

<hr class="doc-section-divider">

<h2 id="calendar-days-mode">Calendar Days Mode</h2>

<p>Shown when <b>Per-Day Salary Calculation Method</b> is <b>Calendar Days (Range)</b>.</p>

| **Option** | **Intended use** |
|------------|------------------|
| Range-Based (use payroll cycle length) | Divisor = actual days in the pay period (from–to dates) |
| Month-Based (use month of start date) | Divisor = days in the pay period when within one month |

<p>Both modes currently use the pay-period length (<code>to − from + 1</code>) as the calendar-day divisor. Cross-month pay runs (e.g. 25 Jun–5 Jul) always use the full range length — 11 days in that example, not 30.</p>

<hr class="doc-section-divider">

<h2 id="holidays-during-lop">Count Holidays as Paid During Unpaid Leave</h2>

<p>Controls whether public holidays falling inside a continuous unpaid-leave stretch are paid or treated as LOP (<code>countHolidaysDuringLOP</code>, default <b>enabled</b>).</p>

<h3>Enabled (default)</h3>

<p>All holidays in the period count as paid. Holidays sandwiched between absent days in an LOP stretch <b>remain paid</b> — they do not increase LOP.</p>

<h3>Disabled</h3>

<p>Holidays inside a continuous LOP range are added to LOP days. The payslip note lists how many holiday days were counted as unpaid.</p>

<p><b>Example:</b> Employee on unpaid leave Mon–Fri. Wednesday is a public holiday.</p>
<ul>
<li><b>Enabled:</b> LOP = 4 days (Mon, Tue, Thu, Fri). Wednesday stays paid.</li>
<li><b>Disabled:</b> LOP = 5 days (includes Wednesday).</li>
</ul>

<hr class="doc-section-divider">

<h2 id="day-count-fields">Day-Count Fields in Pay Run</h2>

<p>These header fields on the pay run feed the calculation engine:</p>

| **Field** | **Source when attendance enabled** | **Role** |
|-----------|-----------------------------------|----------|
| Working Days | <code>period days − holidays − holiday OT days</code> | Divisor (working-days basis); base for present days |
| Holidays | Attendance status Holiday | Reduces working days |
| OT Days / Holiday OT | Attendance status Holiday OT + OT hours | OT payment (category 7); holiday OT reduces working-day count |
| LOP Days | Absent + unpaid leave + (optional) holidays in LOP | Reduces paid days or triggers LOP deductions |
| Paid Leave | <a href="#/hr/leave-allowance">Leave Allowance</a> used dates in period | Reduces LOP; excluded from actual working days when category flag is off |
| Extra Payable Days | Manual entry | <code>days × daily rate</code> for extra-pay category |
| Leave Salary Days | Manual entry (validated against allowance balance) | <code>days × leave-salary daily rate</code> |

<p><b>Attendance statuses used in LOP math:</b></p>

| **Status** | **Meaning** | **LOP impact** |
|------------|-------------|----------------|
| Present | Full day present | — |
| Leave (half/full) | Paid or unpaid leave | LOP if unpaid leave |
| Absent | Full day absent | Full LOP |
| Holiday | Public or company holiday | Paid (unless inside LOP stretch and setting off) |
| Holiday OT | Holiday with overtime | OT day; reduces working-day count |
| Partial absent | Quarter, half, or three-quarter absent | 0.5 / 0.25 / 0.75 LOP |

<hr class="doc-section-divider">

<h2 id="combination-matrix">Combination Matrix — Worked Examples</h2>

<p>Same employee for every example: <b>Basic ₹30,000/month</b>, pay period <b>1–30 Jun</b> (30 days), <b>5 holidays</b>, <b>2 LOP days</b>, <b>1 paid leave day</b> (from leave allowance). Only Basic is LOP-affected and paid-leave-affected.</p>

<h3>At a glance</h3>

<table class="doc-calc-summary">
<thead>
<tr>
<th>Basis</th>
<th>Style</th>
<th>Divisor</th>
<th>Per-day rate</th>
<th>Net Basic</th>
</tr>
</thead>
<tbody>
<tr><td>Working Days</td><td>Pro-Rata</td><td>25</td><td>₹1,200</td><td><b>₹27,600</b></td></tr>
<tr><td>Working Days</td><td>Deduction</td><td>25</td><td>₹1,200</td><td><b>₹27,600</b></td></tr>
<tr><td>Fixed (30)</td><td>Pro-Rata</td><td>30</td><td>₹1,000</td><td><b>₹28,000</b></td></tr>
<tr><td>Fixed (30)</td><td>Deduction</td><td>30</td><td>₹1,000</td><td><b>₹28,000</b></td></tr>
<tr><td>Calendar (30)</td><td>Pro-Rata</td><td>30</td><td>₹1,000</td><td><b>₹28,000</b></td></tr>
<tr><td>Calendar (30)</td><td>Deduction</td><td>30</td><td>₹1,000</td><td><b>₹28,000</b></td></tr>
</tbody>
</table>

<p><b>Why Working Days gives a lower net than Fixed/Calendar:</b> holidays reduce the divisor (25 vs 30), so each present day earns more — but with 2 LOP days the net is lower because fewer days are counted as paid (23 vs 28).</p>

<h3>Step-by-step breakdown</h3>

<div class="doc-calc-grid">

<div class="doc-calc-card">
<h4>Working Days + Pro-Rata</h4>
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Working days = 30 − 5 holidays</td><td>25</td></tr>
<tr><td>Present days = 25 − 2 LOP</td><td>23</td></tr>
<tr><td>Per-day rate = 30,000 ÷ 25</td><td>₹1,200</td></tr>
<tr><td>Basic earned = 23 × 1,200</td><td><b>₹27,600</b></td></tr>
</table>
</div>

<div class="doc-calc-card">
<h4>Working Days + Deduction Mode</h4>
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Basic shown (full month)</td><td>₹30,000</td></tr>
<tr><td>Per-day rate = 30,000 ÷ 25</td><td>₹1,200</td></tr>
<tr><td>LOP deduction = 2 × 1,200</td><td>₹2,400</td></tr>
<tr><td>Net Basic = 30,000 − 2,400</td><td><b>₹27,600</b></td></tr>
</table>
<p class="doc-calc-note">LOP posts under deduction category <b>Loss of Pay</b> (id 3).</p>
</div>

<div class="doc-calc-card">
<h4>Fixed Days (30) + Pro-Rata</h4>
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Paid days = 30 − 2 LOP</td><td>28</td></tr>
<tr><td>Per-day rate = 30,000 ÷ 30</td><td>₹1,000</td></tr>
<tr><td>Basic earned = 28 × 1,000</td><td><b>₹28,000</b></td></tr>
</table>
<p class="doc-calc-note">Holidays do not reduce paid days under fixed-days basis.</p>
</div>

<div class="doc-calc-card">
<h4>Fixed Days (30) + Deduction Mode</h4>
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Basic shown (full month)</td><td>₹30,000</td></tr>
<tr><td>LOP deduction = 2 × 1,000</td><td>₹2,000</td></tr>
<tr><td>Net Basic = 30,000 − 2,000</td><td><b>₹28,000</b></td></tr>
</table>
</div>

<div class="doc-calc-card">
<h4>Calendar Days (30) + Pro-Rata</h4>
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Paid days = 30 − 2 LOP</td><td>28</td></tr>
<tr><td>Per-day rate = 30,000 ÷ 30</td><td>₹1,000</td></tr>
<tr><td>Basic earned = 28 × 1,000</td><td><b>₹28,000</b></td></tr>
</table>
</div>

<div class="doc-calc-card">
<h4>Calendar Days (30) + Deduction Mode</h4>
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Basic shown (full month)</td><td>₹30,000</td></tr>
<tr><td>LOP deduction = 2 × 1,000</td><td>₹2,000</td></tr>
<tr><td>Net Basic = 30,000 − 2,000</td><td><b>₹28,000</b></td></tr>
</table>
</div>

</div>

<h3>Effect of Paid Leave on HRA (paid-leave-affected = false)</h3>

<p>HRA ₹10,000, same period, working-days basis, pro-rata:</p>

<div class="doc-calc-card" style="max-width: 28rem;">
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Present days</td><td>23</td></tr>
<tr><td>Effective paid days = 23 − 1 paid leave</td><td>22</td></tr>
<tr><td>Per-day rate = 10,000 ÷ 25</td><td>₹400</td></tr>
<tr><td>HRA earned = 22 × 400</td><td><b>₹8,800</b></td></tr>
</table>
<p class="doc-calc-note">Paid leave counts for Basic but not for HRA when the category flag is off.</p>
</div>

<hr class="doc-section-divider">

<h2 id="special-scenarios">Special Scenarios</h2>

<h3>Mid-month joiner (full walkthrough)</h3>

<p>Employee joins <b>16 Jun 2026</b>. Pay period 1–30 Jun. Basic ₹30,000. Fixed days = 30, working-days basis, pro-rata. No LOP.</p>

<div class="doc-calc-card" style="max-width: 32rem;">
<table>
<tr><th>Step</th><th>Result</th></tr>
<tr><td>Days in period for employee</td><td>15 (16–30 Jun)</td></tr>
<tr><td>Proration factor = 15 ÷ 30</td><td>0.5</td></tr>
<tr><td>Prorated Basic base = 30,000 × 0.5</td><td>₹15,000</td></tr>
<tr><td>Working days in period (assume 3 holidays in 15 days)</td><td>12</td></tr>
<tr><td>Present all 12 working days</td><td>12</td></tr>
<tr><td>Per-day rate = 15,000 ÷ 12</td><td>₹1,250</td></tr>
<tr><td>Basic earned = 12 × 1,250</td><td><b>₹15,000</b></td></tr>
</table>
</div>

<h3>Leave salary days</h3>

<p>When <b>Show Leave Salary Days in Pay Run</b> is enabled, enter days to encash unused leave. Amount uses components marked <b>Applies to Leave Salary</b> (payment category 8).</p>

<pre class="doc-formula">Leave salary amount = Leave salary days × Σ (monthly amount ÷ divisorDays)
                      for each leave-salary-affected component</pre>

<p><b>Example:</b> Basic ₹30,000 + HRA ₹10,000 (both leave-salary affected), fixed days 30, 5 leave salary days → daily rate = (30,000 + 10,000) ÷ 30 = ₹1,333.33 → leave salary line = 5 × 1,333.33 = <b>₹6,666.65</b>.</p>

<h3>Extra payable days</h3>

<p>When <b>Show Extra Payable Days in Pay Run</b> is enabled, enter incentive or special days. Amount uses the <b>Default Category for Extra Pay</b> and components marked <b>Applies to Extra Payable</b>.</p>

<pre class="doc-formula">Extra pay amount = Extra payable days × Σ (monthly amount ÷ divisorDays)
                   for each extra-pay-affected component in that category</pre>

<p><b>Example:</b> Basic ₹30,000 (extra-pay affected), fixed days 30, 3 extra payable days → 3 × (30,000 ÷ 30) = <b>₹3,000</b> added to the default extra-pay category line.</p>

<h3>Payroll without attendance</h3>

<p>Disable <b>Consider Attendance in Salary Calculation</b> when you want to run payroll from manual day counts:</p>

<ul>
<li>Enter <b>Working Days</b>, <b>LOP Days</b>, and <b>Paid Leave Days</b> directly on each pay-run row.</li>
<li>Holidays come from the <a href="#/hr/holiday">Holiday</a> master and weekend setup — not from daily attendance records.</li>
<li>OT and partial-absent fractions are not auto-derived; enter OT amounts via <a href="#/payroll/overtime-entry">Overtime Entry</a> or manual lines.</li>
</ul>

<p>Use this for legacy imports, off-site staff without attendance hardware, or the first pay run before attendance go-live.</p>

<h3>Cross-month pay period</h3>

<p>Pay period <b>25 Jun – 5 Jul</b> spans 11 calendar days. Under calendar-days basis, divisor = 11 (not 30). Monthly Basic ₹30,000 is prorated by <code>11 ÷ 30</code> before LOP adjustment. Plan pay-period boundaries carefully when using calendar-days or working-days basis across month ends.</p>

<hr class="doc-section-divider">

<h2 id="payrun-view">Pay Run View</h2>

| **Setting** | **Description** |
|-------------|-----------------|
| Select Pay Run View fields | Optional extra fields on the payslip: Standard Work Days, Holiday Worked Days, Loss of Pay Days, Paid Leave Days, Present Days, Salary Days, Holidays in Period. |
| Show (Present + Paid Leaves) Splitup in Bracket in Earning Section Notes | Adds a breakdown note on each earning line showing present days and paid leave days in brackets. |

<hr class="doc-section-divider">

<h2 id="commission">Sale Invoice Commission</h2>

<p>Set maximum commission and bonus percentages per branch. When you approve a <a href="#/payroll/commission-on-transaction">Commission / Bonus on Transaction</a>, the system validates totals against these limits before creating <a href="#/payroll/additional-payment">Additional Payment</a> lines for the pay run.</p>

| **Column** | **Description** |
|------------|-----------------|
| Maximum Commission % | Upper limit for commission on a sale invoice |
| Commission Bonus % | Upper limit for bonus on a sale invoice |
| Applicable Branch | Branch this limit applies to |

<hr class="doc-section-divider">

<h2 id="settings-reference">Settings Quick Reference</h2>

<p>UI labels mapped to backend fields used in pay-run calculation:</p>

| **UI label** | **Backend field** | **Values** |
|--------------|-------------------|------------|
| Per-Day Salary Calculation Method | <code>salaryCalculationBasis</code> | <code>workingDays</code>, <code>fixedDays</code>, <code>calendarDays</code> |
| Salary Calculation Style | <code>salaryCalculationStyle</code> | <code>proRata</code>, <code>deduction</code> |
| Fixed Days for Salary Calculation | <code>fixedSalaryDays</code> | e.g. 30 |
| Calendar Days Mode | <code>calendarDayMode</code> | <code>rangeBased</code>, <code>monthBased</code> |
| Mid-Month Joiner Proration Divisor | <code>midMonthJoinerProrationDivisor</code> | calendar days in month, fixed salary days |
| Count Holidays as Paid During Unpaid Leave | <code>countHolidaysDuringLOP</code> | true (default), false |
| Consider Attendance in Salary Calculation | attendance flag on settings | enabled / disabled |

<hr class="doc-section-divider">

<h2 id="best-practices">Best Practices</h2>

<ul>
<li>Choose <b>Working Days</b> when your organisation pays for days actually worked (excluding weekly offs and holidays).</li>
<li>Choose <b>Fixed Days</b> (e.g. 30) when salary is always divided by a standard month length regardless of calendar length.</li>
<li>Use <b>Deduction Mode</b> when employees and auditors need to see explicit LOP deduction lines on the payslip.</li>
<li>Keep <b>Consider Attendance in Salary Calculation</b> enabled and maintain daily attendance before running payroll.</li>
<li>Align <a href="#/payroll/payment-categories">Payment Category</a> LOP and paid-leave flags with your leave policy before assigning salary components.</li>
<li>Run the combination matrix examples above with your own Basic amount and holiday count before go-live to confirm expected net pay.</li>
</ul>

<hr class="doc-section-divider">

<h2 id="faq">FAQ</h2>

<h3>Calculation basis and style</h3>

<b>Do pro-rata and deduction mode give different net pay?</b><br>
For a full month they are equivalent. Deduction mode shows full earnings plus separate LOP lines; pro-rata shows reduced earnings directly.

<b>What is the difference between Working Days and Calendar Days?</b><br>
Working Days excludes holidays (and holiday OT days) from the divisor. Calendar Days uses the full pay-period length — every calendar day in the from–to range.

<b>What is the difference between Working Days and Fixed Days?</b><br>
Working Days divides salary by actual working days in the period (calendar days minus holidays). Fixed Days always divides by <code>fixedSalaryDays</code> (e.g. 30), regardless of how many holidays or calendar days the month has.

<b>Why does Working Days basis sometimes pay less than Fixed Days for the same LOP?</b><br>
Working Days uses present days (working days − LOP) as paid days. Fixed Days uses <code>fixedSalaryDays − LOP</code>, ignoring holidays — so more days stay paid even when holidays reduced the working-day divisor.

<b>When there are zero holidays, do Working Days and Calendar Days give the same result?</b><br>
For a full-month pay period with no holidays and no holiday OT, yes — the divisor equals the period length and paid days = period − LOP. They diverge as soon as holidays or holiday OT days appear (Working Days only).

<b>Do holidays count as paid under Fixed Days basis?</b><br>
Holidays do not add to paid days. Paid days = <code>fixedSalaryDays − LOP</code>. An employee can be on holiday during the period and still receive full fixed-days pay as long as there is no LOP.

<b>What is the difference between Range-Based and Month-Based calendar mode?</b><br>
Both currently resolve to the actual number of days in the pay-period range. Cross-month periods (e.g. 25 Jun–5 Jul) always use the full span length (11 days in that example), not 30.

<h3>Day counts and attendance</h3>

<b>What is the difference between Present Days, Actual Working Days, and Salary Days?</b><br>
<b>Present Days</b> = working days − LOP. <b>Actual Working Days</b> = present days − paid leave. <b>Salary Days</b> (on payslip notes) = paid days used for earnings — equals present days on working-days basis, or <code>fixed/calendar days − LOP</code> on other bases. Enable the payslip split-up setting to show Present + Paid Leave in brackets.

<b>How are half-day and partial absent days counted for LOP?</b><br>
Attendance statuses map to fractional LOP: half-day leave/absent = 0.5, quarter = 0.25, three-quarter = 0.75. These fractions sum into <code>noOfLOPDays</code> before salary calculation.

<b>Does paid leave reduce LOP days?</b><br>
Yes. LOP = absent + unpaid leave. Days covered by <a href="#/hr/leave-allowance">Leave Allowance</a> in the period count as paid leave and are subtracted from the unpaid-leave portion — they do not add to LOP.

<b>How does Holiday OT affect working days?</b><br>
Each holiday OT day is subtracted from working days (like a holiday) but the employee still earns holiday OT pay at the hourly rate set on <a href="#/payroll/salary-configuration">Salary Configuration</a> (category 7). Net effect: fewer working days in the divisor, plus a separate OT earning line.

<b>How does Count Holidays as Paid During Unpaid Leave work in practice?</b><br>
When enabled (default), a public holiday inside a continuous unpaid-leave stretch stays paid and does not increase LOP. When disabled, holidays sandwiched between absent days in the same LOP range are added to LOP. Work days between two LOP stretches break the continuity — holidays in that gap stay paid.

<b>Can I run payroll without attendance?</b><br>
Yes — disable <b>Consider Attendance in Salary Calculation</b> and enter Working Days, LOP, and Paid Leave manually on each pay-run row. Holidays come from the <a href="#/hr/holiday">Holiday</a> master and weekend setup. OT and partial fractions are not auto-derived.

<h3>Components, LOP, and categories</h3>

<b>What does LOP Affected mean on a payment category?</b><br>
When enabled, that salary component is reduced for LOP days (pro-rata) or gets a separate LOP deduction line (deduction mode). Components with LOP Affected off receive the full prorated monthly amount for the period — only mid-month join/exit proration applies, not day-level LOP.

<b>What does Paid Leave Affected mean?</b><br>
When enabled, paid leave days count toward effective paid days for that component. When off (default HRA), paid leave is excluded — the component earns only for actual working days, and in deduction mode paid leave can trigger an additional LOP deduction line.

<b>Which deduction category is used for salary LOP?</b><br>
Loss of Pay (deduction category id 3). In deduction mode, one LOP line is created per LOP-affected earning component. Cash advance (1) and deduction on expense (2) are separate transaction-driven deductions.

<b>How is overtime calculated?</b><br>
Regular OT: <code>overtime hours × hourly OT rate</code> from salary configuration (category 7). Holiday OT: <code>holiday OT hours × holiday OT hourly rate</code>. Attendance OT hours already apply <a href="#/hr/hrms-settings">HR Settings → Minimum overtime minutes</a> — days below that threshold contribute 0 regular OT hours to the pay run. Holiday OT and manual <a href="#/payroll/overtime-entry">Overtime Entry</a> vouchers are not filtered. OT is not reduced by LOP day counts. Recalculate the pay run after changing the threshold; already posted payslips keep the saved amounts.

<b>How are extra payable days calculated?</b><br>
Extra Payable Days × combined daily rate of components marked <b>Applies to Extra Payable</b> in the <b>Default Category for Extra Pay</b>. Daily rate uses the same divisor as the employee's salary basis.

<b>How are leave salary days calculated?</b><br>
Leave Salary Days × combined daily rate of all components marked <b>Applies to Leave Salary</b> (category 8). The system validates entered days against remaining leave allowance (in shift-hour equivalents) before accepting the pay run.

<h3>Mid-month and period edge cases</h3>

<b>How is a mid-month joiner prorated?</b><br>
Monthly amounts are scaled by <code>days in period ÷ days in month</code>. The month divisor is calendar days in the month (default) or <code>fixedSalaryDays</code> when basis is Fixed Days and that proration option is selected. LOP is then applied on top of the prorated base.

<b>How is a mid-month exit handled?</b><br>
Same proration logic — only days from join/period start through last working day in the pay period count. Use the employee's effective date range on the pay-run row; recalculate after updating attendance for the exit date.

<b>What happens in February when fixed days is set to 30?</b><br>
The divisor stays 30 even though the calendar month has 28 or 29 days. Per-day rate = monthly amount ÷ 30. For a full February with no LOP, paid days = 30 under fixed-days basis (not 28).

<b>How does a cross-month pay period affect salary?</b><br>
The period is prorated by <code>period days ÷ days in month</code> first, then LOP is applied. Under calendar-days basis the divisor is the actual span (e.g. 11 days for 25 Jun–5 Jul), not the full month length.

<h3>Settings changes and operations</h3>

<b>Do payroll settings apply to already-created pay runs?</b><br>
Draft pay runs: use <b>Refetch</b> or recalculate to pick up new settings. Approved pay runs keep the calculation from approval — change settings for the next period, or cancel and recreate the draft if not yet posted.

<b>Changing from pro-rata to deduction mode — what should I expect?</b><br>
Net pay stays the same for the same day counts. Payslips will show higher earning lines with explicit LOP deductions underneath. Historical approved runs are unchanged until recalculated.

<b>Where can I see the step-by-step math for an employee?</b><br>
After calculation, open the pay-run row notes — the engine appends <b>Detailed Calculations</b> showing divisor, paid days, per-component amounts, and LOP deduction breakdowns when deduction mode is on.

<b>Which settings matter most before first pay run?</b><br>
Per-Day Calculation Method, Salary Calculation Style, fixed days (if applicable), Consider Attendance, Count Holidays During LOP, and payment-category LOP/Paid Leave flags on every <a href="#/payroll/salary-configuration">Salary Configuration</a> component. Run the <a href="#/payroll/payroll-settings-config?id=combination-matrix">combination matrix</a> with your actual Basic and holiday count to verify.

<hr class="doc-section-divider">

<h2 id="related">Related</h2>

<ul>
<li><a href="#/payroll/pay-run">Pay Run</a> — where settings are applied</li>
<li><a href="#/payroll/salary-configuration">Salary Configuration</a> — employee salary structure</li>
<li><a href="#/payroll/payment-categories">Payment Categories</a> — LOP and paid-leave flags</li>
<li><a href="#/payroll/payroll-settings">Payroll Settings (overview)</a> — production wages</li>
<li><a href="#/hr/daily-attendance">Daily Attendance</a> — feeds present/LOP when attendance is enabled</li>
<li><a href="#/hr/leave-allowance">Leave Allowance</a> — paid leave credits</li>
<li><a href="#/hr/holiday">Holiday</a> — holiday master</li>
</ul>
