EASalaryNormalizeDeductions
This document was generated using Claude.ai
Overview
Adjusts salary components when total additions exceed deductions, ensuring balanced salary calculations. Modifies the target component's base value when there is a positive surplus in the salary calculation.
When This Action Runs
Manual execution during salary processing when additions outweigh deductions, typically used to normalize salary components and maintain calculated balance by adjusting elements like overtime or bonus components.
How It Works
- Calculates net total - Computes the sum of (additions - deductions) for specified component types
- Checks for positive balance - Determines if additions exceed deductions (positive total)
- Finds target component - Locates the salary line with the specified target component type
- Adjusts base value - Sets the target component's base value to the minimum of the surplus amount and original value
- Updates calculations - Recalculates addition/deduction amounts and salary totals
- Refreshes totals - Updates overall salary document totals after normalization
Parameters
Parameter 1: Target Component Type (Required) - Code of the salary component to adjust (e.g., "overtime", "bonus")
Parameter 2: Components To Normalize (Required) - Comma-separated list of component type codes to include in balance calculation
Database Tables Affected
- SalaryDocumentLine - Updates base value and recalculates addition/deduction amounts for target component
- SalaryDocument - Updates total amounts after component normalization
Important Warnings
⚠️ Positive Balance Trigger
- Action only executes when total calculated amount is positive (additions > deductions)
- Negative or zero balances do not trigger any component adjustments
- Normalization specifically targets surplus situations
⚠️ Target Component Requirements
- Target component must exist in the salary document lines
- Component must have valid component type configuration
- Missing or invalid target components prevent normalization
⚠️ Base Value Modification
- Permanently modifies the target component's base value
- New base value is limited to the lesser of surplus amount or original value
- Original component values are preserved before modification
⚠️ Component Type Filtering
- Only components listed in Parameter 2 are included in balance calculation
- Component type codes must match exactly (case-sensitive)
- Invalid component codes are ignored in calculations
⚠️ Calculation Impact
- Changes affect the entire salary calculation chain
- Modified base values trigger recalculation of addition/deduction amounts
- Salary totals are updated to reflect normalized component values
⚠️ Business Logic Dependencies
- Assumes specific salary component structure and calculation rules
- Component modification may affect other dependent calculations
- Consider impact on tax calculations and benefit computations
⚠️ Parameter Validation
- Both parameters are required for action execution
- Missing parameters cause action failure
- CSV format must be properly structured for component list
⚠️ Surplus Management
- Helps control excessive positive balances in salary calculations
- May be used to cap certain variable components
- Consider business rules for handling salary component limits
⚠️ Opposite Logic to Additions Normalizer
- This action triggers on positive balances (surplus)
- EASalaryNormalizeAdditions triggers on negative balances (deficit)
- Choose appropriate action based on the balance situation being addressed
Module: hr
Full Class Name: com.namasoft.modules.humanresource.utils.clientscripts.EASalaryNormalizeDeductions
Related Actions:
- EASalaryNormalizeAdditions - Normalizes salary components for negative balance situations