Skip to content

Commit

Permalink
fix: LTV ratio comparison (frappe#27207)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 authored Aug 28, 2021
1 parent 327071c commit f5cdbf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ def book_unaccrued_interest(self):
lia = frappe.db.get_value('Loan Interest Accrual', {'process_loan_interest_accrual':
process}, ['name', 'interest_amount', 'payable_principal_amount'], as_dict=1)

self.append('repayment_details', {
'loan_interest_accrual': lia.name,
'paid_interest_amount': flt(self.total_interest_paid - self.interest_payable, precision),
'paid_principal_amount': 0.0,
'accrual_type': 'Repayment'
})
if lia:
self.append('repayment_details', {
'loan_interest_accrual': lia.name,
'paid_interest_amount': flt(self.total_interest_paid - self.interest_payable, precision),
'paid_principal_amount': 0.0,
'accrual_type': 'Repayment'
})

def update_paid_amount(self):
loan = frappe.get_doc("Loan", self.against_loan)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def check_for_ltv_shortfall(process_loan_security_shortfall):
- flt(loan.total_principal_paid)

pledged_securities = get_pledged_security_qty(loan.name)
ltv_ratio = ''
ltv_ratio = 0.0
security_value = 0.0

for security, qty in pledged_securities.items():
Expand Down

0 comments on commit f5cdbf1

Please sign in to comment.