{% extends 'base.html' %} {% load humanize %} {% block title %}Edit Loan - Haven Grazuri Investment Limited{% endblock %} {% block content %}
{% if messages %}
{% for message in messages %}
{% if message.tags == 'error' %} {% elif message.tags == 'success' %} {% elif message.tags == 'warning' %} ⚠️ {% else %} ℹ️ {% endif %}

{{ message }}

{% endfor %}
{% endif %}

Edit Loan

Modify loan details for {{ loan.loan_number }}

⚠️

Important Notice

Editing loan details will affect calculations and may impact existing repayments. Please ensure all changes are accurate.

Current Loan Information

Borrower
{{ loan.borrower.get_full_name }}
Loan Number
{{ loan.loan_number }}
Status
{{ loan.get_status_display }}
{% csrf_token %}

Current: KES {{ loan.principal_amount|floatformat:2 }}

Current: KES {{ loan.interest_amount|floatformat:2 }}

Current: KES {{ loan.processing_fee|floatformat:2 }}

Current: {{ loan.duration_days }} days

Current: {{ loan.disbursement_date|date:"Y-m-d" }}

Current: {{ loan.due_date|date:"Y-m-d" }}

Current: {{ loan.get_status_display }}
⚠️ Status transitions are validated. Not all transitions are allowed.

Total Amount: KES {{ loan.total_amount|floatformat:2 }}

Amount Paid: KES {{ loan.amount_paid|floatformat:2 }}

Outstanding: KES {{ loan.outstanding_amount|floatformat:2 }}

Total Penalties: KES {{ loan.total_penalties|floatformat:2 }}

{% if loan.repayments.exists %}
⚠️

Repayment Impact

This loan has {{ loan.repayments.count }} existing repayment(s). Changing the loan amount or interest rate may affect the outstanding balance calculations.

{% endif %}
Cancel
{% endblock %}