fix(LoanApplication): Repayment amount check (#18376)

* fix: Clickable Asset link

* fix(LoanApplication): Repayment amount check
This commit is contained in:
Faris Ansari 2019-07-22 11:30:05 +05:30 committed by Nabin Hait
parent 88620d6cbb
commit 7ed5919d5b
2 changed files with 3 additions and 2 deletions

View File

@ -636,7 +636,8 @@ class BuyingController(StockController):
asset.set_missing_values()
asset.insert()
frappe.msgprint(_("Asset {0} created").format(asset.name))
asset_link = frappe.utils.get_link_to_form('Asset', asset.name)
frappe.msgprint(_("Asset {0} created").format(asset_link))
return asset.name
def make_asset_movement(self, row):

View File

@ -30,7 +30,7 @@ class LoanApplication(Document):
monthly_interest_rate = flt(self.rate_of_interest) / (12 *100)
if monthly_interest_rate:
min_repayment_amount = self.loan_amount*monthly_interest_rate
if self.repayment_amount - min_repayment_amount < 0:
if self.repayment_amount - min_repayment_amount <= 0:
frappe.throw(_("Repayment Amount must be greater than " \
+ str(flt(min_repayment_amount, 2))))
self.repayment_periods = math.ceil((math.log(self.repayment_amount) -