payroll-rules-india 2.10.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -3
  3. package/dist/index.js +0 -6
  4. package/dist/rules/fy2024_2025/acChargesRules.d.ts +0 -2
  5. package/dist/rules/fy2024_2025/acChargesRules.js +0 -10
  6. package/dist/rules/fy2024_2025/additionalAllowanceRules.d.ts +0 -2
  7. package/dist/rules/fy2024_2025/additionalAllowanceRules.js +0 -12
  8. package/dist/rules/fy2024_2025/basicRules.d.ts +0 -5
  9. package/dist/rules/fy2024_2025/basicRules.js +0 -65
  10. package/dist/rules/fy2024_2025/bonusRules.d.ts +0 -3
  11. package/dist/rules/fy2024_2025/bonusRules.js +0 -23
  12. package/dist/rules/fy2024_2025/conveyanceAllowanceRules.d.ts +0 -6
  13. package/dist/rules/fy2024_2025/conveyanceAllowanceRules.js +0 -59
  14. package/dist/rules/fy2024_2025/dearnessAllowanceRules.d.ts +0 -2
  15. package/dist/rules/fy2024_2025/dearnessAllowanceRules.js +0 -11
  16. package/dist/rules/fy2024_2025/earnedleaveRules.d.ts +0 -3
  17. package/dist/rules/fy2024_2025/earnedleaveRules.js +0 -23
  18. package/dist/rules/fy2024_2025/emergencyAllowanceRules.d.ts +0 -2
  19. package/dist/rules/fy2024_2025/emergencyAllowanceRules.js +0 -12
  20. package/dist/rules/fy2024_2025/esiRules.d.ts +0 -6
  21. package/dist/rules/fy2024_2025/esiRules.js +0 -54
  22. package/dist/rules/fy2024_2025/extraBasicRules.d.ts +0 -2
  23. package/dist/rules/fy2024_2025/extraBasicRules.js +0 -11
  24. package/dist/rules/fy2024_2025/fuelAllowanceRules.d.ts +0 -2
  25. package/dist/rules/fy2024_2025/fuelAllowanceRules.js +0 -12
  26. package/dist/rules/fy2024_2025/generalAllowanceRules.d.ts +0 -2
  27. package/dist/rules/fy2024_2025/generalAllowanceRules.js +0 -12
  28. package/dist/rules/fy2024_2025/geyserAllowanceRules.d.ts +0 -2
  29. package/dist/rules/fy2024_2025/geyserAllowanceRules.js +0 -11
  30. package/dist/rules/fy2024_2025/hraRules.d.ts +0 -8
  31. package/dist/rules/fy2024_2025/hraRules.js +0 -82
  32. package/dist/rules/fy2024_2025/incomeTaxRules.d.ts +0 -2
  33. package/dist/rules/fy2024_2025/incomeTaxRules.js +0 -15
  34. package/dist/rules/fy2024_2025/index.d.ts +0 -37
  35. package/dist/rules/fy2024_2025/index.js +0 -37
  36. package/dist/rules/fy2024_2025/leaveAllowanceRules.d.ts +0 -3
  37. package/dist/rules/fy2024_2025/leaveAllowanceRules.js +0 -24
  38. package/dist/rules/fy2024_2025/localAllowanceRules.d.ts +0 -2
  39. package/dist/rules/fy2024_2025/localAllowanceRules.js +0 -11
  40. package/dist/rules/fy2024_2025/medicalAllowanceRules.d.ts +0 -3
  41. package/dist/rules/fy2024_2025/medicalAllowanceRules.js +0 -24
  42. package/dist/rules/fy2024_2025/mobileAllowanceRules.d.ts +0 -7
  43. package/dist/rules/fy2024_2025/mobileAllowanceRules.js +0 -68
  44. package/dist/rules/fy2024_2025/nationalHolidayRules.d.ts +0 -6
  45. package/dist/rules/fy2024_2025/nationalHolidayRules.js +0 -60
  46. package/dist/rules/fy2024_2025/optionalHolidayRules.d.ts +0 -2
  47. package/dist/rules/fy2024_2025/optionalHolidayRules.js +0 -12
  48. package/dist/rules/fy2024_2025/otherAllowanceRules.d.ts +0 -4
  49. package/dist/rules/fy2024_2025/otherAllowanceRules.js +0 -35
  50. package/dist/rules/fy2024_2025/otherDeductionsRule.d.ts +0 -2
  51. package/dist/rules/fy2024_2025/otherDeductionsRule.js +0 -11
  52. package/dist/rules/fy2024_2025/otherPaidHolidayRules.d.ts +0 -2
  53. package/dist/rules/fy2024_2025/otherPaidHolidayRules.js +0 -12
  54. package/dist/rules/fy2024_2025/overTimesRules.d.ts +0 -3
  55. package/dist/rules/fy2024_2025/overTimesRules.js +0 -20
  56. package/dist/rules/fy2024_2025/pfRules.d.ts +0 -3
  57. package/dist/rules/fy2024_2025/pfRules.js +0 -23
  58. package/dist/rules/fy2024_2025/profTaxRules.d.ts +0 -2
  59. package/dist/rules/fy2024_2025/profTaxRules.js +0 -11
  60. package/dist/rules/fy2024_2025/professionTaxrules.d.ts +0 -2
  61. package/dist/rules/fy2024_2025/professionTaxrules.js +0 -10
  62. package/dist/rules/fy2024_2025/quarterRentRules.d.ts +0 -2
  63. package/dist/rules/fy2024_2025/quarterRentRules.js +0 -10
  64. package/dist/rules/fy2024_2025/retentionBonusRules.d.ts +0 -7
  65. package/dist/rules/fy2024_2025/retentionBonusRules.js +0 -69
  66. package/dist/rules/fy2024_2025/retrenchmentRules.d.ts +0 -2
  67. package/dist/rules/fy2024_2025/retrenchmentRules.js +0 -12
  68. package/dist/rules/fy2024_2025/rfbRules.d.ts +0 -2
  69. package/dist/rules/fy2024_2025/rfbRules.js +0 -11
  70. package/dist/rules/fy2024_2025/safetyAllowanceRules.d.ts +0 -4
  71. package/dist/rules/fy2024_2025/safetyAllowanceRules.js +0 -32
  72. package/dist/rules/fy2024_2025/shiftAllowanceRules.d.ts +0 -5
  73. package/dist/rules/fy2024_2025/shiftAllowanceRules.js +0 -44
  74. package/dist/rules/fy2024_2025/specialAllowanceRules.d.ts +0 -3
  75. package/dist/rules/fy2024_2025/specialAllowanceRules.js +0 -22
  76. package/dist/rules/fy2024_2025/teaAllowanceRules.d.ts +0 -2
  77. package/dist/rules/fy2024_2025/teaAllowanceRules.js +0 -12
  78. package/dist/rules/fy2024_2025/uniformAllowanceRules.d.ts +0 -6
  79. package/dist/rules/fy2024_2025/uniformAllowanceRules.js +0 -58
  80. package/dist/rules/fy2024_2025/washingAllowanceRules.d.ts +0 -11
  81. package/dist/rules/fy2024_2025/washingAllowanceRules.js +0 -105
  82. package/dist/rules/index.d.ts +0 -5
  83. package/dist/rules/index.js +0 -4
  84. package/dist/utils/ruleEvaluator.d.ts +0 -2
  85. package/dist/utils/ruleEvaluator.js +0 -32
  86. package/dist/utils/types.d.ts +0 -44
  87. package/dist/utils/types.js +0 -1
@@ -1,6 +0,0 @@
1
- import { Rule } from "../../utils/types";
2
- export declare const uniformAllowanceHSWRule: Rule;
3
- export declare const uniformAllowanceRule: Rule;
4
- export declare const uniformAllowanceSWRule: Rule;
5
- export declare const uniformAllowanceSSWRule: Rule;
6
- export declare const uniformAllowanceRuleForAll: Rule;
@@ -1,58 +0,0 @@
1
- // Uniform Allowance - HSW: Rs. 60.63/- * payable days
2
- export const uniformAllowanceHSWRule = {
3
- ruleCode: "UNIFORM_ALLOWANCE_HSW",
4
- name: "Uniform Allowance - HSW",
5
- category: "Earning",
6
- type: "Custom",
7
- version: "FY2024-2025",
8
- description: "Uniform Allowance (HSW) = Rs. 60.63/- * payable days (worked days)",
9
- condition: "payableDays > 0 && employeeCategory === 'HSW'",
10
- monthlyFormula: "round(60.63 * payableDays, 2)",
11
- annualFormula: "round(60.63 * payableDays * 12, 2)",
12
- };
13
- export const uniformAllowanceRule = {
14
- ruleCode: "UNIFORM_ALLOWANCE_CUSTOM",
15
- name: "Uniform Allowance - custom(HSW)",
16
- category: "Earning",
17
- type: "Custom",
18
- version: "FY2024-2025",
19
- description: "ONLY FOR HSW Uniform Allowance = Rs. 65.00/- * payable days (worked days)",
20
- condition: "payableDays > 0 && employeeCategory === 'HSW'",
21
- monthlyFormula: "round(65 * payableDays, 2)",
22
- annualFormula: "round(65 * payableDays * 12, 2)",
23
- };
24
- // Uniform Allowance - SW: Rs. 45.76/- * payable days
25
- export const uniformAllowanceSWRule = {
26
- ruleCode: "UNIFORM_ALLOWANCE_SW",
27
- name: "Uniform Allowance - SW",
28
- category: "Earning",
29
- type: "Custom",
30
- version: "FY2024-2025",
31
- description: "Uniform Allowance (SW) = Rs. 45.76/- * payable days (worked days)",
32
- condition: "payableDays > 0 && employeeCategory === 'SW'",
33
- monthlyFormula: "round(45.76 * payableDays, 2)",
34
- annualFormula: "round(45.76 * payableDays * 12, 2)",
35
- };
36
- // Uniform Allowance - SSW: Rs. 38.90/- * payable days
37
- export const uniformAllowanceSSWRule = {
38
- ruleCode: "UNIFORM_ALLOWANCE_SSW",
39
- name: "Uniform Allowance - SSW",
40
- category: "Earning",
41
- type: "Custom",
42
- version: "FY2024-2025",
43
- description: "Uniform Allowance (SSW) = Rs. 38.90/- * payable days (worked days)",
44
- condition: "payableDays > 0 && employeeCategory === 'SSW'",
45
- monthlyFormula: "round(38.90 * payableDays, 2)",
46
- annualFormula: "round(38.90 * payableDays * 12, 2)",
47
- };
48
- export const uniformAllowanceRuleForAll = {
49
- ruleCode: "UNIFORM_ALLOWANCE_CUSTOM_ALL",
50
- name: "Uniform Allowance - custom",
51
- category: "Earning",
52
- type: "Custom",
53
- version: "FY2024-2025",
54
- description: "General Uniform Allowance = Rs. 65.00/- * payable days (worked days)",
55
- condition: "payableDays > 0",
56
- monthlyFormula: "round(65 * payableDays, 2)",
57
- annualFormula: "round(65 * payableDays * 12, 2)",
58
- };
@@ -1,11 +0,0 @@
1
- import { Rule } from "../../utils/types";
2
- export declare const washingAllowanceTierA: Rule;
3
- export declare const washingAllowanceTierB: Rule;
4
- export declare const washingAllowanceTierC: Rule;
5
- export declare const washingAllowanceTierCRevised: Rule;
6
- export declare const washingAllowanceUSWRuleTierD: Rule;
7
- export declare const washingAllowanceUSWRuleTierE: Rule;
8
- export declare const washingAllowanceUSWRuleTierF: Rule;
9
- export declare const washingAllowanceUSWRuleTierG: Rule;
10
- export declare const washingAllowanceTierH: Rule;
11
- export declare const washingAllowanceDailyRule: Rule;
@@ -1,105 +0,0 @@
1
- export const washingAllowanceTierA = {
2
- ruleCode: "WASHING_ALLOWANCE_TIER_A",
3
- name: "Washing Allowance – Tier A",
4
- category: "Earning",
5
- type: "Custom",
6
- version: "FY2024-2025",
7
- description: "Washing Allowance = Rs. 16.02 * payable days",
8
- condition: "payableDays > 0",
9
- monthlyFormula: "round(16.02 * payableDays, 2)",
10
- annualFormula: "round(16.02 * payableDays * 12, 2)",
11
- };
12
- export const washingAllowanceTierB = {
13
- ruleCode: "WASHING_ALLOWANCE_TIER_B",
14
- name: "Washing Allowance – Tier B",
15
- category: "Earning",
16
- type: "Custom",
17
- version: "FY2024-2025",
18
- description: "Washing Allowance = Rs. 12.58 * payable days",
19
- condition: "payableDays > 0",
20
- monthlyFormula: "round(12.58 * payableDays, 2)",
21
- annualFormula: "round(12.58 * payableDays * 12, 2)",
22
- };
23
- export const washingAllowanceTierC = {
24
- ruleCode: "WASHING_ALLOWANCE_TIER_C",
25
- name: "Washing Allowance – Tier C",
26
- category: "Earning",
27
- type: "Custom",
28
- version: "FY2024-2025",
29
- description: "Washing Allowance = Rs. 10.30 * payable days",
30
- condition: "payableDays > 0",
31
- monthlyFormula: "round(10.30 * payableDays, 2)",
32
- annualFormula: "round(10.30 * payableDays * 12, 2)",
33
- };
34
- export const washingAllowanceTierCRevised = {
35
- ruleCode: "WASHING_ALLOWANCE_TIER_C_REVISED",
36
- name: "Washing Allowance – Tier C (Revised Rate)",
37
- category: "Earning",
38
- type: "Custom",
39
- version: "FY2024-2025",
40
- description: "Washing Allowance = Rs. 11.50 * payable days",
41
- condition: "payableDays > 0",
42
- monthlyFormula: "round(11.50 * payableDays, 2)",
43
- annualFormula: "round(11.50 * payableDays * 12, 2)",
44
- };
45
- export const washingAllowanceUSWRuleTierD = {
46
- ruleCode: "WASHING_ALLOWANCE_USW",
47
- name: "Washing Allowance (USW)",
48
- category: "Earning",
49
- type: "Custom",
50
- version: "FY2024-2025",
51
- description: "Washing allowance for USW category at Rs.25 per present day.",
52
- condition: "payableDays > 0",
53
- monthlyFormula: "round(payableDays * 25, 2)",
54
- };
55
- export const washingAllowanceUSWRuleTierE = {
56
- ruleCode: "WASHING_ALLOWANCE_SW",
57
- name: "Washing Allowance (SW)",
58
- category: "Earning",
59
- type: "Custom",
60
- version: "FY2024-2025",
61
- description: "Washing allowance for SW category at Rs.35 per present day.",
62
- condition: "payableDays > 0",
63
- monthlyFormula: "round(payableDays * 35, 2)",
64
- };
65
- export const washingAllowanceUSWRuleTierF = {
66
- ruleCode: "WASHING_ALLOWANCE",
67
- name: "Washing Allowance At ₹44",
68
- category: "Earning",
69
- type: "Custom",
70
- version: "FY2024-2025",
71
- description: "Washing allowance for SW category at Rs.44 per present day.",
72
- condition: "payableDays > 0",
73
- monthlyFormula: "round(payableDays * 44, 2)",
74
- };
75
- export const washingAllowanceUSWRuleTierG = {
76
- ruleCode: "WASHING_ALLOWANCE_TIER_G",
77
- name: "Washing Allowance At ₹5.44",
78
- category: "Earning",
79
- type: "Custom",
80
- version: "FY2024-2025",
81
- description: "Washing allowance for category at Rs.5.44 per present day.",
82
- condition: "payableDays > 0",
83
- monthlyFormula: "round(payableDays * 5.44, 2)",
84
- };
85
- export const washingAllowanceTierH = {
86
- ruleCode: "WASHING_ALLOWANCE_TIER_H",
87
- name: "Washing Allowance – Tier H",
88
- category: "Earning",
89
- type: "Custom",
90
- version: "FY2024-2025",
91
- description: "Washing Allowance = Rs. 10 * payable days",
92
- condition: "payableDays > 0",
93
- monthlyFormula: "round(10 * payableDays, 2)",
94
- annualFormula: "round(10 * payableDays * 12, 2)",
95
- };
96
- export const washingAllowanceDailyRule = {
97
- ruleCode: "WASHING_ALLOWANCE_DAILY",
98
- name: "Washing Allowance",
99
- category: "Earning",
100
- type: "Custom",
101
- version: "FY2024-2025",
102
- description: "Washing allowance calculated at Rs.41 per payable day.",
103
- condition: "payableDays > 0",
104
- monthlyFormula: "round(payableDays * 41, 0)",
105
- };
@@ -1,5 +0,0 @@
1
- import * as rules2024_2025 from "./fy2024_2025";
2
- export declare const payrollRules: {
3
- "2024-2025": typeof rules2024_2025;
4
- };
5
- export type PayrollRuleSet = typeof payrollRules;
@@ -1,4 +0,0 @@
1
- import * as rules2024_2025 from "./fy2024_2025";
2
- export const payrollRules = {
3
- "2024-2025": rules2024_2025,
4
- };
@@ -1,2 +0,0 @@
1
- import { Rule, EvaluationContext, EvaluationResult } from "./types";
2
- export declare function evaluateRule(rule: Rule, context: EvaluationContext, mode?: "monthly" | "annual"): EvaluationResult;
@@ -1,32 +0,0 @@
1
- import { Parser } from "expr-eval";
2
- const parser = new Parser();
3
- const safeFunctions = {
4
- round: (v, d = 2) => Math.round(v * Math.pow(10, d)) / Math.pow(10, d),
5
- min: Math.min,
6
- max: Math.max,
7
- abs: Math.abs,
8
- };
9
- export function evaluateRule(rule, context, mode = "monthly") {
10
- const formula = mode === "annual" ? rule.annualFormula : rule.monthlyFormula;
11
- if (!formula) {
12
- return {
13
- applies: false,
14
- value: null,
15
- ruleCode: rule.ruleCode,
16
- name: rule.name,
17
- category: rule.category,
18
- };
19
- }
20
- const conditionAst = rule.condition ? parser.parse(rule.condition) : null;
21
- const formulaAst = parser.parse(formula);
22
- const ctx = { ...context, ...safeFunctions };
23
- const applies = conditionAst ? Boolean(conditionAst.evaluate(ctx)) : true;
24
- const value = applies ? Number(formulaAst.evaluate(ctx)) : null;
25
- return {
26
- applies,
27
- value,
28
- ruleCode: rule.ruleCode,
29
- name: rule.name,
30
- category: rule.category,
31
- };
32
- }
@@ -1,44 +0,0 @@
1
- export type Rule = {
2
- ruleCode: string;
3
- name: string;
4
- category: "Earning" | "Deduction" | "Adjustment";
5
- type?: "Statutory" | "Custom" | "Fixed";
6
- description?: string;
7
- version?: string;
8
- condition?: string;
9
- monthlyFormula?: string;
10
- annualFormula?: string;
11
- };
12
- export type EvaluationContext = {
13
- basic?: number;
14
- hra?: number;
15
- da?: number;
16
- specialAllowance?: number;
17
- conveyance?: number;
18
- gross?: number;
19
- grossEarnings?: number;
20
- ctc?: number;
21
- lopDays?: number;
22
- workedDays?: number;
23
- payableDays?: number;
24
- dailyWages?: number;
25
- totalDaysInMonth?: number;
26
- workingDaysInMonth?: number;
27
- noOfHolidays?: number;
28
- employeeCategory?: "HSW" | "SW" | "SSW";
29
- isPfApplicable?: boolean;
30
- isEsiApplicable?: boolean;
31
- isMetro?: boolean;
32
- pfWageLimit?: number;
33
- esiWageLimit?: number;
34
- state?: string;
35
- taxRegime?: "old" | "new";
36
- [key: string]: any;
37
- };
38
- export type EvaluationResult = {
39
- applies: boolean;
40
- value: number | null;
41
- ruleCode: string;
42
- name: string;
43
- category: string;
44
- };
@@ -1 +0,0 @@
1
- export {};