mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 02:14:48 +00:00
fix: Get exemptions from declaration only if proof not submitted
This commit is contained in:
@@ -283,17 +283,21 @@ class IncomeTaxComputationReport(object):
|
|||||||
if not self.employees[d.employee]["allow_tax_exemption"]:
|
if not self.employees[d.employee]["allow_tax_exemption"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if d.employee not in self.employees_with_proofs:
|
if (source=="Employee Tax Exemption Declaration"
|
||||||
amount = flt(d.amount)
|
and d.employee in self.employees_with_proofs):
|
||||||
max_eligible_amount = flt(max_exemptions.get(d.exemption_category))
|
continue
|
||||||
if max_eligible_amount and amount > max_eligible_amount:
|
|
||||||
amount = max_eligible_amount
|
|
||||||
|
|
||||||
self.employees[d.employee].setdefault(scrub(d.exemption_category), amount)
|
amount = flt(d.amount)
|
||||||
self.add_to_total_exemption(d.employee, amount)
|
max_eligible_amount = flt(max_exemptions.get(d.exemption_category))
|
||||||
|
if max_eligible_amount and amount > max_eligible_amount:
|
||||||
|
amount = max_eligible_amount
|
||||||
|
|
||||||
if source == "Employee Tax Exemption Proof Submission":
|
self.employees[d.employee].setdefault(scrub(d.exemption_category), amount)
|
||||||
self.employees_with_proofs.append(d.employee)
|
self.add_to_total_exemption(d.employee, amount)
|
||||||
|
|
||||||
|
if (source == "Employee Tax Exemption Proof Submission"
|
||||||
|
and d.employee not in self.employees_with_proofs):
|
||||||
|
self.employees_with_proofs.append(d.employee)
|
||||||
|
|
||||||
def get_max_exemptions_based_on_category(self):
|
def get_max_exemptions_based_on_category(self):
|
||||||
return dict(frappe.get_all("Employee Tax Exemption Category",
|
return dict(frappe.get_all("Employee Tax Exemption Category",
|
||||||
@@ -331,8 +335,6 @@ class IncomeTaxComputationReport(object):
|
|||||||
if d[0] not in self.employees_with_proofs:
|
if d[0] not in self.employees_with_proofs:
|
||||||
self.employees[d[0]].setdefault("hra", d[1])
|
self.employees[d[0]].setdefault("hra", d[1])
|
||||||
self.add_to_total_exemption(d[0], d[1])
|
self.add_to_total_exemption(d[0], d[1])
|
||||||
|
|
||||||
if source == "Employee Tax Exemption Proof Submission":
|
|
||||||
self.employees_with_proofs.append(d[0])
|
self.employees_with_proofs.append(d[0])
|
||||||
|
|
||||||
def get_standard_tax_exemption(self):
|
def get_standard_tax_exemption(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user