{% extends "base.html" %} {% block content %}

Loan #{{ loan.id }}

{{ loan.display_loan_type or loan.loan_type or "Loan" }} · Applied on {{ loan.requested_on.strftime("%d-%m-%Y") if loan.requested_on else "-" }}
{% set st = (loan.status or '').lower() %} {% if st in ['approved', 'active'] %} Approved / Active {% elif st in ['requested', 'pending', 'under_review'] %} Pending Approval {% elif st == 'rejected' %} Rejected {% elif st == 'closed' %} Closed {% else %} {{ loan.status or "Unknown" }} {% endif %} {% if admin_view %} Back to Admin {% else %} Back {% endif %}
Loan Amount
₹{{ "%.2f"|format(loan_amount or 0) }}
Tenure
{{ tenure_months or "-" }} months
Monthly EMI
₹{{ "%.2f"|format(emi_amount or 0) }}
Outstanding
₹{{ "%.2f"|format(outstanding or 0) }}
Loan Details
Start Month
{{ loan.start_month.strftime("%b %Y") if loan.start_month else "-" }}
Total Paid
₹{{ "%.2f"|format(total_paid or 0) }}
Status
{{ (loan.status or "Unknown")|replace("_"," ")|title }}
Reason / Notes

Reason:

{{ loan.reason or "Not provided." }}

{% if loan.remarks %}

HR / Manager Remarks:

{{ loan.remarks }}

{% endif %}
{% if not admin_view and can_cancel %}
{{ csrf_token() if csrf_token is defined }}
{% endif %}
Approval Details
Approved By: {{ loan.approved_by.full_name if loan.approved_by else "-" }}
Approved On: {{ loan.approved_on.strftime("%d-%m-%Y") if loan.approved_on else "-" }}
HR / Manager Remarks:
{{ loan.remarks or "No remarks." }}
{% if emi_schedule %} {% for emi in emi_schedule %} {% set status = (emi.status if emi.status is defined else ('paid' if emi.paid else 'pending')) %} {% endfor %} {% else %} {% endif %}
# Month EMI (₹) Status
{{ loop.index }} {{ emi.month_label }} ₹{{ "%.2f"|format(emi.amount or 0) }} {% if status == 'paid' or emi.paid %} Paid {% elif status == 'skipped' %} Skipped {% elif emi.is_overdue and status == 'pending' %} Overdue {% else %} Pending {% endif %}
EMI schedule not available.
Skip EMI Requests
{% if skip_requests is defined and skip_requests %} {% for r in skip_requests %}
{{ r.request_month.strftime("%b %Y") if r.request_month else "-" }}
{% if r.status == 'approved' %} Approved {% elif r.status == 'rejected' %} Rejected {% else %} Pending {% endif %}
{% if r.reason %}
Reason: {{ r.reason }}
{% endif %} {% if r.remarks %}
HR Remarks: {{ r.remarks }}
{% endif %}
{% endfor %} {% else %}
No skip requests.
{% endif %}
Extra / Offline Payments
{% if extra_payment_requests is defined and extra_payment_requests %} {% for r in extra_payment_requests %}
₹{{ "%.2f"|format(r.amount or 0) }} {% if r.payment_mode %} · {{ r.payment_mode }} {% endif %}
{% if r.status == 'approved' %} Approved {% elif r.status == 'rejected' %} Rejected {% else %} Pending {% endif %}
{% if r.payment_ref %}
Ref: {{ r.payment_ref }}
{% endif %} {% if r.remarks %}
HR Remarks: {{ r.remarks }}
{% endif %}
{% endfor %} {% else %}
No extra payment requests.
{% endif %}
{% if transactions is defined and transactions %}
Payment Transactions
    {% for t in transactions %}
  • {{ t.txn_date.strftime("%d-%m-%Y") if t.txn_date else "-" }} · {{ t.txn_type|replace('_',' ')|title }}
    {{ t.direction }} ₹{{ "%.2f"|format(t.amount or 0) }}
    {% if t.reference %}
    Ref: {{ t.reference }}
    {% endif %}
  • {% endfor %}
{% endif %}
{% if not admin_view and loan.status in ['approved','active'] %}
Request to Skip EMI
{% set pending_emis = emi_schedule | selectattr('can_skip', 'equalto', True) | list %} {% if pending_emis %}
{{ csrf_token() if csrf_token is defined }}
{% else %}

No pending EMIs available for skip request.

{% endif %}
Extra / Offline Payment Request
{{ csrf_token() if csrf_token is defined }}
{% endif %}
{% endblock %}