fix: test cases
This commit is contained in:
parent
49446ba760
commit
6adfc5618d
@ -21,12 +21,13 @@ class EmployeeTaxExemptionDeclaration(Document):
|
||||
self.calculate_hra_exemption()
|
||||
|
||||
def validate_duplicate(self):
|
||||
duplicate = frappe.db.exists({
|
||||
"doctype": "Employee Tax Exemption Declaration",
|
||||
"employee": self.employee,
|
||||
"payroll_period": self.payroll_period,
|
||||
"name": ["!=", self.name]
|
||||
})
|
||||
duplicate = frappe.db.get_value("Employee Tax Exemption Declaration",
|
||||
filters = {
|
||||
"employee": self.employee,
|
||||
"payroll_period": self.payroll_period,
|
||||
"name": ["!=", self.name]
|
||||
}
|
||||
)
|
||||
if duplicate:
|
||||
frappe.throw(_("Duplicate Tax Declaration of {0} for period {1}")
|
||||
.format(self.employee, self.payroll_period), DuplicateDeclarationError)
|
||||
|
@ -25,7 +25,8 @@ class EmployeeTaxExemptionProofSubmission(Document):
|
||||
self.exemption_amount = get_total_exemption_amount(self.tax_exemption_proofs)
|
||||
|
||||
def calculate_hra_exemption(self):
|
||||
if self.house_rent_payment_amount:
|
||||
self.monthly_hra_exemption, self.monthly_house_rent, self.total_eligible_hra_exemption = 0, 0, 0
|
||||
if self.get("house_rent_payment_amount"):
|
||||
hra_exemption = calculate_hra_exemption_for_period(self)
|
||||
if hra_exemption:
|
||||
self.exemption_amount += hra_exemption["total_eligible_hra_exemption"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user