Merge pull request #24490 from deepeshgarg007/report_ltv_ratio_fix
fix: LTV ratio in interest report
diff --git a/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py b/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py
index 2bfe6d3..a3e69bb 100644
--- a/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py
+++ b/erpnext/loan_management/report/loan_interest_report/loan_interest_report.py
@@ -81,7 +81,7 @@
+ loan['penalty']
if loan_wise_security_value.get(loan.loan):
- loan['loan_to_value'] = (loan['principal_outstanding'] * 100) / loan_wise_security_value.get(loan.loan)
+ loan['loan_to_value'] = flt((loan['principal_outstanding'] * 100) / loan_wise_security_value.get(loan.loan))
return loan_details
@@ -148,7 +148,7 @@
WHERE u.parent = up.name
AND up.status = 'Approved'
{conditions}
- GROUP BY up.loan
+ GROUP BY up.loan, u.loan_security
""".format(conditions=conditions), filters, as_dict=1)
for unpledge in unpledges:
@@ -160,7 +160,7 @@
WHERE p.parent = lp.name
AND lp.status = 'Pledged'
{conditions}
- GROUP BY lp.loan
+ GROUP BY lp.loan, p.loan_security
""".format(conditions=conditions), filters, as_dict=1)
for security in pledges: