Skip to content

Commit

Permalink
chore: 1-99 validations for loan partner percentages
Browse files Browse the repository at this point in the history
  • Loading branch information
anandbaburajan committed Nov 2, 2023
1 parent f9041c5 commit 46f1944
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lending/loan_management/doctype/loan_partner/loan_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def validate_percentage_and_interest_fields(self):
]

for field in fields:
if self.get(field) and (self.get(field) < 0 or self.get(field) > 100):
frappe.throw(_("{0} should be between 0 and 100").format(frappe.bold(frappe.unscrub(field))))
if self.get(field) and (self.get(field) < 1 or self.get(field) > 99):
frappe.throw(_("{0} should be between 1 and 99").format(frappe.bold(frappe.unscrub(field))))

shareables_fields = [
"partner_collection_percentage",
Expand All @@ -39,9 +39,9 @@ def validate_percentage_and_interest_fields(self):

for shareable in self.shareables:
for field in shareables_fields:
if shareable.get(field) and (shareable.get(field) < 0 or shareable.get(field) > 100):
if shareable.get(field) and (shareable.get(field) < 1 or shareable.get(field) > 99):
frappe.throw(
_("Row {0}: {1} should be between 0 and 100").format(
_("Row {0}: {1} should be between 1 and 99").format(
shareable.idx, frappe.bold(frappe.unscrub(field))
)
)

0 comments on commit 46f1944

Please sign in to comment.