{% extends 'base.html' %} {% load static %} {% load custom_filters %} {% block page_title %}Loan Management{% endblock %} {% block header_actions %}
Back
{% endblock %} {% block content %}
Active Loans
{{ summary.total_active }}
{{ summary.total_amount_active|floatformat:2 }} KSh total
Paid Loans
{{ summary.total_paid }}
{{ summary.total_amount_paid|floatformat:2 }} KSh total
Overdue Loans
{{ overdue_count|default:"0" }}
Require attention
Defaulted
{{ summary.total_defaulted }}
Unpaid loans
All Loans
{{ loans.count }} loans
{% for loan in loans %} {% empty %} {% endfor %}
Borrower Amount Interest Total Due Issued Due Date Status Actions
{{ loan.borrower_name }} {% if loan.borrower_phone %} {{ loan.borrower_phone }} {% endif %}
KSh {{ loan.amount|floatformat:2 }} {{ loan.interest_rate }}% KSh {{ loan.total_due|floatformat:2 }} {{ loan.issued_date|date:"M d, Y" }}
{{ loan.due_date|date:"M d, Y" }} {% if loan.days_remaining > 0 %} {{ loan.days_remaining }} days left {% elif loan.is_overdue %} {{ loan.days_remaining|abs }} days overdue {% endif %}
{% if loan.status == 'active' %} {% if loan.is_overdue %} Overdue {% else %} Active {% endif %} {% elif loan.status == 'paid' %} Paid {% elif loan.status == 'defaulted' %} Defaulted {% endif %}
No loans found

Add your first loan using the "Add Loan" button.

Overdue Loans
{% if overdue_loans %}
{% for loan in overdue_loans|slice:":5" %}
{{ loan.borrower_name }}
Due: {{ loan.due_date|date:"M d, Y" }}
KSh {{ loan.total_due|floatformat:2 }}
{{ loan.days_remaining }} days overdue
{% endfor %}
{% else %}

No overdue loans

{% endif %}
Recent Payments
{% if recent_payments %}
{% for payment in recent_payments|slice:":5" %}
{{ payment.loan.borrower_name }}
{{ payment.payment_date|date:"M d, H:i" }}
KSh {{ payment.amount|floatformat:2 }}
{{ payment.payment_method }}
{% endfor %}
{% else %}

No recent payments

{% endif %}
{% endblock %}