Skip to content

Commit 180fdb1

Browse files
committed
fix(Income Tax Computation): eval locals for Income Tax Slab
1 parent 0906abb commit 180fdb1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hrms/payroll/report/income_tax_computation/income_tax_computation.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,16 @@ def get_applicable_tax(self):
421421
tax_slab = emp_details.get("income_tax_slab")
422422
if tax_slab:
423423
tax_slab = frappe.get_cached_doc("Income Tax Slab", tax_slab)
424-
employee_dict = frappe.get_doc("Employee", emp).as_dict()
424+
salary_slip = frappe.new_doc("Salary Slip")
425+
salary_slip.employee = emp
426+
salary_slip.salary_structure = emp_details.salary_structure
427+
salary_slip.process_salary_structure()
428+
eval_locals, __ = salary_slip.get_data_for_eval()
425429
tax_amount = calculate_tax_by_tax_slab(
426430
emp_details["total_taxable_amount"],
427431
tax_slab,
428432
eval_globals=None,
429-
eval_locals=employee_dict,
433+
eval_locals=eval_locals,
430434
)
431435
else:
432436
tax_amount = 0.0

0 commit comments

Comments
 (0)