{% extends 'base.html' %} {% load humanize %} {% load math_filters %} {% block title %}Loans Due - Management Dashboard{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{{ report_data.summary.total_loans_due|intcomma }}
Total Loans Due
$
KSh {{ report_data.summary.total_amount_due|intcomma }}
Total Amount Due
📈
KSh {{ report_data.summary.average_due_amount|intcomma }}
Average Due Amount
⚠️
{{ report_data.priority_breakdown.overdue_count|intcomma }}
Overdue Loans

Priority Distribution

Breakdown by urgency level

Overdue
{{ report_data.priority_breakdown.overdue_count|default:0 }}
Due Today
{{ report_data.priority_breakdown.due_today_count|default:0 }}
Due This Week
{{ report_data.priority_breakdown.due_this_week_count|default:0 }}
Due Later
{{ report_data.priority_breakdown.due_later_count|default:0 }}

Repayment Methods

Distribution by payment frequency

🔍 Filter & Search

📊 Export to Excel 📄 Export to PDF

Due Date Details

{{ report_data.loans|length }} loan{{ report_data.loans|length|pluralize }} found

{% if report_data.loans %} {% for loan in report_data.loans %} {% endfor %}
Loan Details Product Repayment Method Payment Schedule Expected Payment Outstanding Balance Days Until Due Priority Last Payment Actions
{{ loan.loan_number }}
{{ loan.borrower_name }}
{{ loan.borrower_phone }}
Due: {{ loan.due_date|date:"M d, Y" }}
{{ loan.loan_product|default:'Unknown' }}
{% if loan.product_type == 'boost' %} 1 Month {% elif loan.product_type == 'boost_plus' %} 2 Months {% elif loan.product_type == 'mwamba' %} 3 Months {% elif loan.product_type == 'imara' %} 6 Months {% endif %}
{{ loan.repayment_method|default:'Monthly'|title }}
{% if loan.repayment_method == 'daily' %} Every Day {% elif loan.repayment_method == 'weekly' %} Every Week {% else %} 📅 Every Month {% endif %}
{% if loan.repayment_method == 'daily' %} Daily: KES {{ loan.expected_payment_amount|floatformat:0 }} {% elif loan.repayment_method == 'weekly' %} Weekly: KES {{ loan.expected_payment_amount|floatformat:0 }} {% else %} Monthly: KES {{ loan.expected_payment_amount|floatformat:0 }} {% endif %}
{% if loan.repayment_method == 'daily' %} Due Every Day {% elif loan.repayment_method == 'weekly' %} Due Every 7 Days {% else %} Due Every 30 Days {% endif %}
KSh {{ loan.expected_payment_amount|floatformat:0|intcomma }} KSh {{ loan.outstanding_balance|floatformat:0|intcomma }}
{% if loan.days_until_due < 0 %} {{ loan.days_until_due|abs }} days overdue {% elif loan.days_until_due == 0 %} Due today {% else %} {{ loan.days_until_due }} days {% endif %}
{% if loan.repayment_method == 'daily' %} {% if loan.days_until_due == 0 %} ⚠️ Due Today! {% elif loan.days_until_due <= 1 %} ⚠️ Due Tomorrow {% else %} Daily Payment {% endif %} {% elif loan.repayment_method == 'weekly' %} {% if loan.days_until_due == 0 %} ⚠️ Due Today! {% elif loan.days_until_due <= 3 %} ⚠️ Due Soon {% else %} Weekly Payment {% endif %} {% else %} {% if loan.days_until_due == 0 %} ⚠️ Due Today! {% elif loan.days_until_due <= 7 %} ⚠️ Due This Week {% else %} 📅 Monthly Payment {% endif %} {% endif %}
{% if loan.repayment_method == 'daily' %} {% if loan.days_until_due == 0 %} 🔥 CRITICAL
Daily Payment Due!
{% elif loan.days_until_due <= 1 %} ⚠️ HIGH
Daily Payment Soon
{% else %} DAILY
Daily Schedule
{% endif %} {% elif loan.repayment_method == 'weekly' %} {% if loan.days_until_due == 0 %} 🔥 CRITICAL
Weekly Payment Due!
{% elif loan.days_until_due <= 3 %} ⚠️ HIGH
Weekly Payment Soon
{% else %} WEEKLY
Weekly Schedule
{% endif %} {% else %} {% if loan.days_until_due == 0 %} 🔥 CRITICAL
Monthly Payment Due!
{% elif loan.days_until_due <= 7 %} ⚠️ HIGH
Monthly Payment Soon
{% else %} 📅 MONTHLY
Monthly Schedule
{% endif %} {% endif %}
{% if loan.last_payment_date %}
{{ loan.last_payment_date|date:"M d, Y" }}
KSh {{ loan.last_payment_amount|floatformat:0|intcomma }}
{% else %} No payments {% endif %}
{% else %}

No Loans Due

No loans are due in the selected period.

{% endif %}
{% endblock %}