{% 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 the Principal Amount directly changes what the customer owes — Total Amount = Principal Amount. Editing Interest or Processing Fee is for internal accounting records only and will not change the customer's balance.

Current Loan Information

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

This is the amount the customer must repay. Changing it updates the total balance directly.

{{ loan.get_effective_interest_rate_total }}% total

ℹ️ Type any amount — the badge updates to show what % of principal that is. ({{ loan.get_effective_interest_rate }}%/month × {{ loan.duration_days }} days)

{{ loan.get_effective_processing_fee_rate }}%

ℹ️ Type any amount — badge shows the % of principal.

Current: {{ loan.duration_days }} days — any positive number is accepted

Current: {{ loan.repayment_method|capfirst }}

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 (= Principal): KES {{ loan.total_amount|floatformat:2 }}

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

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

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

ℹ️ Interest ({{ loan.interest_amount|floatformat:2 }}) and Processing Fee ({{ loan.processing_fee|floatformat:2 }}) are internal accounting records and do not add to the balance.

{% 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 %}