Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added validation as per particular Waived amount #185

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Loading