{% extends 'base.html' %} {% load static %} {% block title %}Client Performance Ranking{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
👥

Client Performance Ranking

Detailed analysis of client performance and risk assessment

Total Clients
{{ total_clients }}
👥Active portfolio
👥
Avg Client Score
{{ avg_client_score|floatformat:1 }}
Performance rating
Avg Repayment Rate
{{ avg_repayment_rate|floatformat:1 }}%
Collection efficiency
Total Outstanding
KES {{ total_outstanding|floatformat:0 }}
💵Portfolio value
💵

📊 Performance Distribution

{{ performance_categories.excellent|length }}
Excellent (85+)
{{ performance_categories.good|length }}
Good (70-84)
{{ performance_categories.average|length }}
Average (50-69)
{{ performance_categories.poor|length }}
Poor (<50)

📊 Top Performers Comparison

{% if top_performers %}

🏆 Top Performing Clients

{% for client in top_performers %}
{% if forloop.counter == 1 %}
{% elif forloop.counter == 2 %}
2
{% elif forloop.counter == 3 %}
3
{% else %}
{{ forloop.counter }}
{% endif %}

{{ client.client_name }}

{% if client.client_score >= 85 %} Excellent {% elif client.client_score >= 70 %} Good {% elif client.client_score >= 50 %} Average {% else %} Poor {% endif %} {% if client.risk_category == 'low' %} Low Risk {% elif client.risk_category == 'medium' %} Medium Risk {% else %} High Risk {% endif %}

👔 Portfolio: {{ client.manager_name|default:client.manager.get_full_name }}

{{ client.client_score|floatformat:1 }}
Client Score
{{ client.total_loans }}
Total Loans
{{ client.active_loans }}
Active
{{ client.repayment_rate|floatformat:1 }}%
Repayment Rate
KES {{ client.total_borrowed|floatformat:0 }}
Total Borrowed
KES {{ client.outstanding_balance|floatformat:0 }}
Outstanding
{{ client.days_since_payment }}
Days Since Payment
Repayment Rate {{ client.repayment_rate|floatformat:1 }}%
Client Score {{ client.client_score|floatformat:1 }}
{% endfor %}
{% endif %} {% if bottom_performers %}

⚠️ Clients Needing Attention

{% for client in bottom_performers %}
⚠️

{{ client.client_name }}

Needs Attention High Risk

👔 Portfolio: {{ client.manager_name|default:client.manager.get_full_name }}

{{ client.client_score|floatformat:1 }}
Client Score
{{ client.repayment_rate|floatformat:1 }}%
Repayment Rate
KES {{ client.outstanding_balance|floatformat:0 }}
Outstanding
{{ client.days_since_payment }}
Days Since Payment
{{ client.default_history }}
Default History
{% endfor %}
{% endif %}
{% endblock %}