fix: gl entry validation for miniscule loan penalty

(cherry picked from commit aef65e7417)
This commit is contained in:
Abhinav Raut
2022-05-13 17:22:26 +05:30
committed by Mergify
parent c7f4a1595a
commit e958ef26e0

View File

@@ -279,9 +279,9 @@ class LoanRepayment(AccountsController):
if interest_paid > 0:
if self.penalty_amount and interest_paid > self.penalty_amount:
self.total_penalty_paid = self.penalty_amount
self.total_penalty_paid = flt(self.penalty_amount, self.precision("debit"))
elif self.penalty_amount:
self.total_penalty_paid = interest_paid
self.total_penalty_paid = flt(interest_paid, self.precision("debit"))
interest_paid -= self.total_penalty_paid