Skip to content

Commit

Permalink
fix(Income Tax Computation): computation of total tax exemption (back…
Browse files Browse the repository at this point in the history
…port #1902) (#1906)

(cherry picked from commit b00a87a)

Co-authored-by: Akash  Tom <61287991+krantheman@users.noreply.github.com>
  • Loading branch information
mergify[bot] and krantheman committed Jun 19, 2024
1 parent 81d2ccf commit 0f6d470
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def get_tax_exempted_earnings_and_deductions(self):
self.employees[employee].update(exemptions)

total_exemptions = sum(list(exemptions.values()))
self.add_to_total_exemption(employee, total_exemptions)
self.employees[employee]["total_exemption"] = 0
self.employees[employee]["total_exemption"] += total_exemptions

def add_exemptions_from_future_salary_slips(self, employee, exemptions):
for ss in self.future_salary_slips.get(employee, []):
Expand Down Expand Up @@ -272,10 +273,6 @@ def get_tax_exempted_components(self):

return tax_exempted_components

def add_to_total_exemption(self, employee, amount):
self.employees[employee].setdefault("total_exemption", 0)
self.employees[employee]["total_exemption"] += amount

def get_employee_tax_exemptions(self):
# add columns
exemption_categories = frappe.get_all("Employee Tax Exemption Category", {"is_active": 1})
Expand Down Expand Up @@ -323,7 +320,7 @@ def get_tax_exemptions(self, source):
amount = max_eligible_amount

self.employees[d.employee].setdefault(scrub(d.exemption_category), amount)
self.add_to_total_exemption(d.employee, amount)
self.employees[d.employee]["total_exemption"] += amount

if (
source == "Employee Tax Exemption Proof Submission"
Expand Down Expand Up @@ -375,7 +372,8 @@ def get_eligible_hra(self, source):

if d[0] not in self.employees_with_proofs:
self.employees[d[0]].setdefault("hra", d[1])
self.add_to_total_exemption(d[0], d[1])

self.employees[d[0]]["total_exemption"] += d[1]
self.employees_with_proofs.append(d[0])

def get_standard_tax_exemption(self):
Expand All @@ -397,7 +395,7 @@ def get_standard_tax_exemption(self):
income_tax_slab = emp_details.get("income_tax_slab")
standard_exemption = standard_exemptions_per_slab.get(income_tax_slab, 0)
emp_details["standard_tax_exemption"] = standard_exemption
self.add_to_total_exemption(emp, standard_exemption)
self.employees[emp]["total_exemption"] += standard_exemption

self.add_column("Total Exemption")

Expand Down

0 comments on commit 0f6d470

Please sign in to comment.