From e3a53590dea2be6ec655ccf75e938c1b587b3d9a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Feb 2022 16:01:50 +0530 Subject: [PATCH] fix: Added filter to consider Tax Exemption Declaration if proof not submitted --- .../report/income_tax_computation/income_tax_computation.js | 6 ++++++ .../report/income_tax_computation/income_tax_computation.py | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/payroll/report/income_tax_computation/income_tax_computation.js b/erpnext/payroll/report/income_tax_computation/income_tax_computation.js index 26b09bd2db..26e463f268 100644 --- a/erpnext/payroll/report/income_tax_computation/income_tax_computation.js +++ b/erpnext/payroll/report/income_tax_computation/income_tax_computation.js @@ -34,6 +34,12 @@ frappe.query_reports["Income Tax Computation"] = { "fieldtype": "Link", "options": "Department", "width": "100px", + }, + { + "fieldname":"consider_tax_exemption_declaration", + "label": __("Consider Tax Exemption Declaration"), + "fieldtype": "Check", + "width": "180px" } ] }; diff --git a/erpnext/payroll/report/income_tax_computation/income_tax_computation.py b/erpnext/payroll/report/income_tax_computation/income_tax_computation.py index 1aa22a1a58..cbde3a6095 100644 --- a/erpnext/payroll/report/income_tax_computation/income_tax_computation.py +++ b/erpnext/payroll/report/income_tax_computation/income_tax_computation.py @@ -256,7 +256,8 @@ class IncomeTaxComputationReport(object): self.employees_with_proofs = [] self.get_tax_exemptions("Employee Tax Exemption Proof Submission") - self.get_tax_exemptions("Employee Tax Exemption Declaration") + if self.filters.consider_tax_exemption_declaration: + self.get_tax_exemptions("Employee Tax Exemption Declaration") def get_tax_exemptions(self, source): # Get category-wise exmeptions based on submitted proofs or declarations @@ -311,7 +312,8 @@ class IncomeTaxComputationReport(object): self.employees_with_proofs = [] self.get_eligible_hra("Employee Tax Exemption Proof Submission") - self.get_eligible_hra("Employee Tax Exemption Declaration") + if self.filters.consider_tax_exemption_declaration: + self.get_eligible_hra("Employee Tax Exemption Declaration") def get_eligible_hra(self, source): if source == "Employee Tax Exemption Proof Submission":