Skip to content

Commit

Permalink
Merge pull request #207 from Nihantra-Patel/fix_loan_security_exposure
Browse files Browse the repository at this point in the history
fix: Loan Security Exposure report
  • Loading branch information
deepeshgarg007 authored Oct 23, 2024
2 parents 3c140fd + a589f1b commit 84ce6e9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ def get_data(filters):
value.get("qty", 0) * loan_security_details.get(security, {}).get("latest_price", 0)
)
valid_upto = loan_security_details.get(security, {}).get("valid_upto")
portfolio_percent = (
flt(current_value * 100 / total_portfolio_value, 2) if total_portfolio_value != 0 else 0.0
)

row.update(loan_security_details.get(security))
row.update(
{
"total_qty": value.get("qty"),
"current_value": current_value,
"price_valid_upto": valid_upto,
"portfolio_percent": flt(current_value * 100 / total_portfolio_value, 2),
"portfolio_percent": portfolio_percent,
"pledged_applicant_count": value.get("applicant_count"),
"currency": currency,
}
Expand Down

0 comments on commit 84ce6e9

Please sign in to comment.