{% extends "pos/base.html" %} {% block title %}Installment Deal #{{ deal.installment_no }}{% endblock %} {% block stylesheets %} {% endblock %} {% block content %}

Installment Deal #{{ deal.installment_no }}

{{ deal.plan.plan_name|default:"Custom Plan" }} — {{ deal.duration_months }} months — {{ deal.sale_date }}
{% if deal.status == 'ACTIVE' %} Edit Deal {% endif %} Delete {% if deal.status == 'ACTIVE' %} Active {% elif deal.status == 'COMPLETED' %} Completed {% elif deal.status == 'DEFAULTED' %} Defaulted {% else %} {{ deal.status }} {% endif %}
{% if messages %} {% for msg in messages %}
{{ msg }}
{% endfor %} {% endif %}
{{ deal.total_price|floatformat:0 }}
Total Price
{{ deal.down_payment|floatformat:0 }}
Down Payment
{{ summary.total_paid|floatformat:0 }}
Total Received
{{ summary.total_pending|floatformat:0 }}
Remaining
{{ summary.overdue_amount|floatformat:0 }}
Overdue Amount
{% if summary.overdue_days > 0 %} {{ summary.overdue_days }} days late {% endif %}
{{ summary.installments_done }}/{{ summary.installments_total }}
Installments Done
Repayment Schedule {% if deal.status == 'ACTIVE' %} Payment Receive — Phase C {% endif %}
{% for slot in schedule %} {% empty %} {% endfor %}
# Due Date Due Amount Paid Amount Balance Status Last Paid
{% if slot.installment_number == 0 %} DP {% else %} {{ slot.installment_number }} {% endif %} {{ slot.due_date }} {{ slot.due_amount|floatformat:0 }} {% if slot.paid_amount > 0 %} {{ slot.paid_amount|floatformat:0 }} {% else %}—{% endif %} {% if slot.status == 'PAID' %} 0 {% else %} {{ slot.due_amount|floatformat:0 }} {% endif %} {% if slot.status == 'PAID' %} Paid {% elif slot.status == 'PARTIAL' %} Partial {% elif slot.status == 'OVERDUE' %} Overdue {% elif slot.status == 'WAIVED' %} Waived {% else %} Pending {% endif %} {{ slot.last_payment_date|default:"—" }}
No schedule generated.
Products in This Deal
{% for item in products %} {% empty %} {% endfor %}
Product Qty Purchase Price Sale Price/Unit Total Cost Total Sale
{{ item.product_name }} {{ item.quantity }} {{ item.purchase_price|floatformat:0 }} {{ item.cash_price_per_unit|floatformat:0 }} {{ item.total_cost|floatformat:0 }} {{ item.total_sale_price|floatformat:0 }}
No products.
Totals: {{ total_cost|floatformat:0 }} {{ deal.cash_price|floatformat:0 }}
Deal Details {% if deal.status == 'ACTIVE' %} Edit {% endif %}
Invoice Ref
#{{ deal.payments_invoice_no }}
Sale Date
{{ deal.sale_date }}
First Installment
{{ deal.start_date }}
Duration
{{ deal.duration_months }} months
Cash Price
{{ deal.cash_price|floatformat:0 }}
Markup
{{ deal.markup_amount|floatformat:0 }}
Total Price
{{ deal.total_price|floatformat:0 }}
Monthly Installment
{{ deal.monthly_amount|floatformat:0 }}
{% if deal.notes %}
Notes
{{ deal.notes }}
{% endif %}
Buyer Details
{% if customer %}
Name
{{ customer.name }}
Mobile
{{ customer.mobile|default:"—" }}
CNIC
{{ customer.cnic|default:"—" }}
{% if deal.buyer_father_name %}
Father's Name
{{ deal.buyer_father_name }}
{% endif %} {% if deal.buyer_occupation %}
Occupation
{{ deal.buyer_occupation }}
{% endif %} {% if deal.buyer_employer %}
Employer
{{ deal.buyer_employer }}
{% endif %} {% if deal.buyer_monthly_income %}
Monthly Income
{{ deal.buyer_monthly_income|floatformat:0 }}
{% endif %}
Address
{{ customer.address|default:"—" }}
{% else %}

Customer not found.

{% endif %}
Witnesses {% if witnesses|length < 2 %} Add {% endif %}
{% for witness in witnesses %}
W{{ witness.witness_number }} {{ witness.name }}
{% csrf_token %}
{% if witness.father_name %}Father: {{ witness.father_name }}
{% endif %} {% if witness.cnic %}CNIC: {{ witness.cnic }}
{% endif %} {% if witness.mobile %}Mobile: {{ witness.mobile }}
{% endif %} {% if witness.relationship %}Relationship: {{ witness.relationship }}{% endif %}
{% empty %}
No witnesses added. Add first witness.
{% endfor %}
{% endblock %}