Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Income Tax Computation): computation of total tax exemption (backport #1902) #1907

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading