Merge pull request #24505 from deepeshgarg007/loan_exposure_report_fix

fix: Error handling in loan reports and precision fixes
This commit is contained in:
Deepesh Garg 2021-02-20 17:57:09 +05:30 committed by GitHub
commit a6d0610730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -246,7 +246,5 @@ def get_per_day_interest(principal_amount, rate_of_interest, posting_date=None):
if not posting_date:
posting_date = getdate()
precision = cint(frappe.db.get_default("currency_precision")) or 2
return flt((principal_amount * rate_of_interest) / (days_in_year(get_datetime(posting_date).year) * 100), precision)
return flt((principal_amount * rate_of_interest) / (days_in_year(get_datetime(posting_date).year) * 100))

View File

@ -76,7 +76,7 @@ def get_company_wise_loan_security_details(filters, loan_security_details):
if qty:
security_wise_map[key[1]]['applicant_count'] += 1
total_portfolio_value += flt(qty * loan_security_details.get(key[1])['latest_price'])
total_portfolio_value += flt(qty * loan_security_details.get(key[1], {}).get('latest_price', 0))
return security_wise_map, total_portfolio_value