fix: amount precision for Tax Exemption Proof Submission

This commit is contained in:
Rucha Mahabal 2022-05-23 16:17:39 +05:30 committed by Nabin Hait
parent 2e98e9e0b9
commit cfe2f8cac1

View File

@ -31,7 +31,9 @@ class EmployeeTaxExemptionProofSubmission(Document):
self.total_actual_amount += flt(d.amount)
def set_total_exemption_amount(self):
self.exemption_amount = get_total_exemption_amount(self.tax_exemption_proofs)
self.exemption_amount = flt(
get_total_exemption_amount(self.tax_exemption_proofs), self.precision("exemption_amount")
)
def calculate_hra_exemption(self):
self.monthly_hra_exemption, self.monthly_house_rent, self.total_eligible_hra_exemption = 0, 0, 0
@ -39,6 +41,13 @@ class EmployeeTaxExemptionProofSubmission(Document):
hra_exemption = calculate_hra_exemption_for_period(self)
if hra_exemption:
self.exemption_amount += hra_exemption["total_eligible_hra_exemption"]
self.monthly_hra_exemption = hra_exemption["monthly_exemption"]
self.monthly_house_rent = hra_exemption["monthly_house_rent"]
self.total_eligible_hra_exemption = hra_exemption["total_eligible_hra_exemption"]
self.exemption_amount = flt(self.exemption_amount, self.precision("exemption_amount"))
self.monthly_hra_exemption = flt(
hra_exemption["monthly_exemption"], self.precision("monthly_hra_exemption")
)
self.monthly_house_rent = flt(
hra_exemption["monthly_house_rent"], self.precision("monthly_house_rent")
)
self.total_eligible_hra_exemption = flt(
hra_exemption["total_eligible_hra_exemption"], self.precision("total_eligible_hra_exemption")
)