From 590bf4ce3a999a9533a07b485e55c9a16f06dc51 Mon Sep 17 00:00:00 2001 From: Ranjith Date: Thu, 31 May 2018 12:08:14 +0530 Subject: [PATCH] codacy fixes --- .../employee_tax_exemption_declaration.js | 6 ++++-- .../employee_tax_exemption_declaration.py | 1 - .../employee_tax_exemption_proof_submission.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js index 130d202c4f1..72ce7a5b807 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js +++ b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js @@ -71,13 +71,15 @@ frappe.ui.form.on('Employee Tax Exemption Declaration', { method: "calculate_hra_exemption", doc: frm.doc, callback: function(r) { - frm.refresh_fields(); + if (!r.exc){ + frm.refresh_fields(); + } } }); }, set_null_value(frm){ let fields = ['salary_structure_hra', 'monthly_house_rent','annual_hra', 'monthly_hra', - 'total_exemption_amount', 'payroll_period']; + 'total_exemption_amount', 'payroll_period']; fields.forEach(function(field) { frm.set_value(field, ''); }); diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py index 9bdba4a6d51..a9b1e33af51 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py +++ b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py @@ -6,7 +6,6 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ -from frappe.utils import getdate from erpnext.hr.utils import validate_tax_declaration, calculate_eligible_hra_exemption class EmployeeTaxExemptionDeclaration(Document): diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py b/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py index 2be09ae9b9d..503cfe051eb 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py +++ b/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ -from frappe.utils import date_diff, flt, getdate, get_first_day, get_last_day +from frappe.utils import date_diff, flt from erpnext.hr.utils import validate_tax_declaration, calculate_eligible_hra_exemption class EmployeeTaxExemptionProofSubmission(Document):