diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.py b/lending/loan_management/doctype/loan_repayment/loan_repayment.py index 9929e9a2..40e36865 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.py @@ -295,9 +295,17 @@ def validate_amount(self, payable_amount): if self.repayment_type == "Loan Closure" and flt(self.amount_paid) < flt(payable_amount): frappe.throw(_("Amount paid cannot be less than payable amount for loan closure")) - if self.repayment_type in ("Interest Waiver", "Penalty Waiver", "Charges Waiver"): + if self.repayment_type == "Interest Waiver": if flt(self.amount_paid) > flt(payable_amount): - frappe.throw(_("Waived amount cannot be greater than overdue amount")) + frappe.throw(_("Interest Waived amount cannot be greater than overdue amount")) + + if self.repayment_type == "Penalty Waiver": + if flt(self.amount_paid) > flt(payable_amount): + frappe.throw(_("Penalty Waived amount cannot be greater than overdue amount")) + + if self.repayment_type == "Charges Waiver": + if flt(self.amount_paid) > flt(payable_amount): + frappe.throw(_("Charges Waived amount cannot be greater than overdue amount")) def update_paid_amounts(self): if self.repayment_type in (