Compensation, benefits, and tax
This payroll area manages compensation items that need more than a fixed salary value. It defines flexible employee benefits, tracks their accrual and payment, applies income-tax rules, records employee tax claims, calculates gratuity, schedules retention bonuses, and directs payroll costs to the right cost centers. It works with Payroll management, Salary processing and payroll runs, and Regional payroll implementations.
Compensation and benefit model
Payroll separates the rule for a compensation item from the employee’s choice and from the payment record. A salary component describes how an item behaves. A salary structure assignment gives an employee an annual benefit limit and selected benefit amounts. Payroll then turns the item into an earning, an accrual, or a later payout.
Salary component settings
The Salary Component is the main control point for benefit and tax behavior. It can mark an earning as a flexible benefit, set its yearly limit and payout method, or mark a deduction as income-tax related or exempt from tax. These flags let the same salary-processing flow handle normal pay, benefit balances, and tax deductions without treating them as separate kinds of payroll. References: hrms/…/salary_component.json• L68-80, hrms/…/salary_component.json• L121-155, hrms/…/salary_component.json• L216-230, hrms/…/salary_component.json• L264-295
Employee benefit setup
Flexible benefits are configured on the Salary Structure and refined on the employee’s Salary Structure Assignment. Each benefit uses an earning component and an annual amount. The assignment also carries the employee’s maximum annual benefit amount, so later applications and claims can check the employee’s actual allowance. References: hrms/…/salary_structure.json• L130-142, hrms/…/salary_structure.json• L245-258, hrms/…/salary_structure_assignment.json• L236-254
Flexible benefit lifecycle
Flexible benefits move through an entitlement and payment cycle. Payroll records each cycle’s accrual or payout in an employee benefit ledger, and claims use that ledger to protect the remaining balance.
Benefit applications
An Employee Benefit Application lets an employee select amounts from the flexible benefits in the active salary structure assignment for one payroll period. The application records the employee, company, currency, selected benefit rows, yearly maximum, and remaining balance. It rejects amounts above a component limit, an employee’s total limit, or an already submitted application for that period. References: hrms/…/employee_benefit_application.py• L43-85, hrms/…/employee_benefit_application.py• L87-119, hrms/…/employee_benefit_application.json• L32-61, hrms/…/employee_benefit_application.json• L74-137
Benefit claims
An Employee Benefit Claim requests payment for one benefit component on a current or future payroll date. The claim records the amount, company currency, and optional expense proof attachments. The system checks the employee’s yearly entitlement and ledger balance. After submission, it creates an Additional Salary record so the claim enters the normal salary-slip earning flow. Only one submitted claim for the same employee and benefit component is allowed in a payroll month. References: hrms/…/employee_benefit_claim.py• L39-80, hrms/…/employee_benefit_claim.py• L81-114, hrms/…/employee_benefit_claim.py• L116-166, hrms/…/employee_benefit_claim.json• L28-138
Benefit ledger
The Employee Benefit Ledger is the balance record for benefit components. It stores Accrual and Payout transactions against an employee, payroll period, salary component, and salary slip. Flexible-benefit entries can also point back to the application or claim that caused them. Salary-slip submission creates these entries. Claim eligibility then compares the accrued total with the paid total, while full-benefit claims compare the annual allowance with the paid total. References: hrms/…/employee_benefit_ledger.py• L35-43, hrms/…/employee_benefit_ledger.py• L45-97, hrms/…/employee_benefit_ledger.py• L108-152, hrms/…/employee_benefit_ledger.json• L49-136
Benefit payout methods
The payout method decides when an annual benefit becomes pay. Payroll prorates the yearly amount across the employee’s payroll cycles and uses prior ledger activity to choose the current transaction.
| Payout method | Payroll result |
|---|---|
| Accrue and payout at end of payroll period | Accrues during the period and pays the remaining balance in the final cycle. |
| Accrue per cycle, pay only on claim | Accrues each cycle and pays only approved claims. An optional setting pays the unclaimed balance in the final cycle. |
| Allow claim for full benefit amount | Makes the unused yearly allowance available for a claim rather than requiring cycle-by-cycle accrual. |
References: hrms/…/salary_component.json• L282-295 hrms/…/salary_slip.py• L1419-1493 hrms/…/salary_slip.py• L1495-1628
Income-tax configuration and calculation
Income tax uses a company-aware, effective-dated Income Tax Slab linked to each employee’s salary structure assignment. The payroll run combines the slab with taxable pay, prior tax, other income, salary-component tax flags, and approved exemption records to produce the employee’s tax due.
Income-tax slabs
An income-tax slab contains taxable salary bands and rates. A band can have a condition based on employee or salary data. The slab can also define a full-relief threshold, a standard exemption, and other charges that apply within an income range. It can permit tax exemption declarations. The selected slab must use the same currency as the employee’s salary assignment. References: hrms/…/income_tax_slab.json• L29-46, hrms/…/income_tax_slab.json• L48-80, hrms/…/income_tax_slab.json• L83-120, hrms/…/taxable_salary_slab.json• L17-56, hrms/…/income_tax_slab_other_charges.json• L17-64
Taxable earnings
The salary slip builds annual taxable earnings from prior, current, and expected future pay. It adds additional salary and other income, then removes non-taxable earnings, configured deductions, standard exemption, and the employee’s eligible exemption amount. A last payroll cycle can force tax for unsubmitted proof and unclaimed taxable benefits so that the annual calculation does not leave these amounts outside the tax base. References: hrms/…/salary_slip.py• L980-1017, hrms/…/salary_slip.py• L1019-1051, hrms/…/salary_slip.py• L1053-1101
Tax reports
The Income Tax Computation report gives an annual view for employees in a payroll period. It includes existing salary slips and previews for future cycles. It reports gross earnings, other income, exemptions, taxable income, slab tax, other charges, tax already deducted, and the remaining payable tax. The Income Tax Deductions report lists tax deduction components from submitted salary slips. The Professional Tax Deductions report provides the separate deduction view for salary components marked as Professional Tax. References: hrms/…/income_tax_computation.py• L30-49, hrms/…/income_tax_computation.py• L193-222, hrms/…/income_tax_computation.py• L303-365, hrms/…/income_tax_computation.py• L495-596, hrms/…/income_tax_deductions.py• L14-19, hrms/…/income_tax_deductions.py• L95-133, hrms/…/professional_tax_deductions.py• L39-84
Tax exemption declarations and proofs
Tax exemptions use a category model and two employee submission paths. A declaration records what the employee expects to claim. A proof submission records the actual amount and supporting files. The tax calculation can use declarations when enabled, but submitted proofs take priority for the employee.
Exemption categories
An Employee Tax Exemption Category defines an active tax category and its maximum eligible amount. An Employee Tax Exemption Sub Category belongs to one category and can apply a lower limit. Employee declaration and proof rows select a subcategory, while payroll groups the amounts by the parent category and caps the result at the configured limits. References: hrms/…/employee_tax_exemption_category.json• L15-33, hrms/…/employee_tax_exemption_sub_category.py• L26-35, hrms/…/employee_tax_exemption_sub_category.json• L16-45, hrms/…/utils.py• L273-305
Employee declarations
An Employee Tax Exemption Declaration records an employee’s expected exemption for a payroll period. It calculates both the declared total and the capped exemption total. It can also calculate an eligible house-rent exemption when rent data is present. The system allows only one declaration for an employee in a payroll period. The form limits employee choices to active employees, limits payroll periods to the selected company, and offers only active exemption subcategories. After submission, it can start a proof submission from the declaration and takes the employee currency from the salary assignment. References: hrms/…/employee_tax_exemption_declaration.py• L44-81, hrms/…/employee_tax_exemption_declaration.json• L55-118, hrms/…/employee_tax_exemption_declaration.js• L4-75, hrms/…/utils.py• L256-270
Employee proof submissions
An Employee Tax Exemption Proof Submission replaces estimates with actual amounts and proof attachments for a payroll period. Each row records the proof type, actual amount, and file. The document calculates the eligible exemption and house-rent result, then blocks a second proof submission for the same employee and period. A declaration can be mapped into a proof submission as a starting point. References: hrms/…/employee_tax_exemption_proof_submission.py• L44-80, hrms/…/employee_tax_exemption_proof_submission.json• L60-128, hrms/…/employee_tax_exemption_proof_submission.py• L64-80, hrms/…/employee_tax_exemption_declaration.py• L84-102
Exemption precedence
The tax report reads submitted proof amounts first. When the report is configured to consider declarations, it uses a declaration only for an employee without submitted proofs. The income-tax slab must also allow tax exemptions before either source changes taxable income. References: hrms/…/income_tax_computation.py• L303-356, hrms/…/income_tax_computation.py• L368-405, hrms/…/income_tax_slab.json• L40-46
Gratuity rules and payments
Gratuity is a service-based payment calculated from a selected rule and the employee’s service record. The rule defines eligibility, service-year treatment, applicable earnings, and the rate bands. A submitted gratuity record pays through a salary slip or through accounting entries.
Gratuity rule configuration
The Gratuity Rule sets the minimum service period, the working days used for a year, and whether payroll uses rounded, exact, or manually entered work experience. Its slabs can calculate the current service band or sum all prior bands. The rule also names the earning components that form the gratuity base, and it can be disabled when it is no longer in use. References: hrms/…/gratuity_rule.json• L25-45, hrms/…/gratuity_rule.json• L52-83, hrms/…/gratuity_rule_slab.json• L12-38, hrms/…/gratuity_applicable_component.json• L10-20, hrms/…/gratuity_rule.py• L35-50
Gratuity eligibility and amount
The Gratuity record derives service time from the employee’s joining and relieving dates unless the rule uses manual input. It can reduce service time for unpaid leave or absence according to the payroll basis. The amount uses applicable earnings from the employee’s latest submitted salary slip and the matching rule slab. References: hrms/…/gratuity.py• L43-64, hrms/…/gratuity.py• L168-217, hrms/…/gratuity.py• L234-310, hrms/…/gratuity.json• L34-74
Gratuity payment paths
When Pay via Salary Slip is enabled, submission creates an additional salary item for the selected payroll date and salary component. Otherwise, submission creates payable and expense accounting entries using the selected accounts and cost center. The record tracks unpaid and paid states and cancels the related payment path when cancelled. References: hrms/…/gratuity.py• L66-94, hrms/…/gratuity.py• L96-146, hrms/…/gratuity.json• L75-190
Retention bonuses
A Retention Bonus records a one-time future payment for an active employee. On submission it creates or updates an Additional Salary item for the bonus date. Cancellation reverses that item, which keeps the bonus tied to the source record instead of leaving an unowned payroll adjustment.
Bonus payment scheduling
The bonus requires a company, employee, future payment date, salary component, and non-negative amount. A standard notification alerts HR managers 14 days before the due date after the bonus is submitted. References: hrms/…/retention_bonus.py• L34-53, hrms/…/retention_bonus.py• L63-89, hrms/…/retention_bonus.json• L27-57, hrms/…/retention_bonus.json• L3-26
Payroll cost centers
Payroll cost centers assign an employee’s pay cost across accounting dimensions. A salary structure assignment can split the employee’s payroll across several cost centers by percentage. Payroll uses that split when it creates component totals and accounting entries.
Employee cost allocation
The employee’s assignment is the most specific source for payroll cost centers. If it has no split, payroll falls back to the employee’s default cost center, then the department’s default, and finally the payroll entry’s cost center. Each assignment split must use cost centers from the same company and total 100 percent. References: hrms/…/employee_cost_center.json• L11-29, hrms/…/salary_structure_assignment.py• L94-103, hrms/…/salary_structure_assignment.py• L185-219, hrms/…/payroll_entry.py• L545-589
Accounting distribution
During a payroll run, each salary component amount is multiplied by each assigned cost-center percentage. The resulting amounts are grouped by salary component and cost center before payroll accounting entries are built. This keeps the employee’s pay total unchanged while placing its expense in the required cost centers. References: hrms/…/payroll_entry.py• L440-473, hrms/…/payroll_entry.py• L591-594
Related payroll pages
Use Payroll management for the domain map. Read Salary processing and payroll runs for the salary structure, payroll entry, salary slip, and additional salary flow. Read Regional payroll implementations for country-specific tax and statutory behavior that extends the shared payroll model.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep
Salary Componentflags aligned with the salary-slip tax calculation and the income-tax reports. A flag can change both taxable pay and report inclusion. - Keep flexible-benefit payout rules aligned with benefit claims and ledger transaction types. A mismatch can make the claim balance wrong without changing the employee’s salary structure.
- Keep benefit application and claim currency and company links aligned with the employee and salary assignment. A mismatch can make a valid benefit look unrelated to the payroll run.
- Keep exemption category caps consistent with both declaration rows and proof rows. The tax report groups both sources by category.
- Keep declaration form filters and currency lookup aligned with employee status, company payroll periods, active subcategories, and the employee’s salary assignment. A mismatch can expose invalid choices or assign a wrong currency before server validation.
- Keep
Income Tax Slabcurrency and effective-date use aligned withSalary Structure Assignment. An assignment with a missing or mismatched slab can stop tax calculation. - Keep gratuity rule earning components present in the salary structure and in the latest salary slip. The gratuity amount depends on those links.
- Keep cost-center percentages at 100 percent and preserve the employee-to-department fallback order. Accounting distribution depends on both contracts.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A flexible-benefit claim exceeds the ledger balance or annual allowance. | The claim cannot be submitted. | Benefit eligibility compares accruals and payouts, and validates the component and yearly limits. |
| More than one claim uses the same employee, component, and payroll month. | The employee could be paid more than the allowed cycle amount. | Submission blocks a duplicate claim for that month. |
| A tax slab is missing, disabled, or has the wrong currency for a salary assignment. | Tax may be missing or payroll cannot validate the assignment. | Link an active slab with the assignment currency and keep the tax component configuration consistent. |
| A proof or declaration repeats an exemption subcategory or period. | The employee’s exemption total is rejected or duplicated. | Use one row per subcategory and one submitted document per employee and payroll period. |
| A declaration uses an inactive employee, company-mismatched period, or inactive subcategory. | The form can offer an invalid tax record choice or fail later validation. | Use the declaration form filters and select the employee currency from the salary assignment. |
| A gratuity rule is disabled, or its employee has no relieving date or matching earning component. | Work experience or the gratuity amount cannot be calculated. | Use an active rule, complete the employee exit data, and select earnings present in the latest submitted salary slip. |
| Assignment cost-center percentages do not total 100 percent. | Payroll accounting cannot distribute the component amount correctly. | Validate company ownership and make the split total 100 percent. |
Key files
| File | Why to read it |
|---|---|
| hrms/…/salary_component.json | Defines the flags that give a salary item benefit, accrual, or tax behavior. |
| hrms/…/salary_structure_assignment.json | Connects an employee to the salary structure, tax slab, annual benefits, opening tax values, and cost centers. |
| hrms/…/employee_benefit_application.py | Shows how an employee selects flexible benefits within annual limits. |
| hrms/…/employee_benefit_claim.py | Shows how an approved claim enters payroll as additional salary. |
| hrms/…/employee_benefit_ledger.py | Defines the accrual and payout balance used for claim eligibility. |
| hrms/…/salary_slip.py | Connects benefit payouts, ledger entries, taxable earnings, exemptions, and income-tax totals to a salary slip. |
| hrms/…/income_tax_slab.py | Defines slab-based tax, relief, and additional-charge calculation. |
| hrms/…/income_tax_computation.py | Explains the annual tax view and the relationship between declarations, proofs, deductions, and payable tax. |
| hrms/…/employee_tax_exemption_declaration.py | Shows expected exemption claims and their capped totals. |
| hrms/…/employee_tax_exemption_declaration.js | Shows the declaration form’s active-record filters, company-period filter, proof action, and currency lookup. |
| hrms/…/employee_tax_exemption_proof_submission.py | Shows actual proof amounts, attachments, and house-rent exemption handling. |
| hrms/…/gratuity_rule.json | Defines the service and earnings rules used for gratuity. |
| hrms/…/gratuity.py | Shows gratuity eligibility, amount calculation, and payment paths. |
| hrms/…/retention_bonus.py | Shows how a retention bonus creates and reverses additional salary. |
| hrms/…/salary_structure_assignment.py | Shows cost-center validation and fallback setup for an employee. |
| hrms/…/payroll_entry.py | Shows how payroll component amounts are distributed into accounting cost centers. |