{% extends 'base.html' %} {% load humanize %} {% block title %}Invoice {{ invoice.invoice_number }} - 3ncount{% endblock %} {% block page_title %}Invoice {{ invoice.invoice_number }}{% endblock %} {% block page_actions %}
Print Edit
{% endblock %} {% block content %} {% if invoice.get_balance_due > 0 %} {% endif %}

Invoice Details

Customer Information

{{ invoice.customer.name }}

{% if invoice.customer.address %}

{{ invoice.customer.address|linebreaksbr }}

{% endif %} {% if invoice.customer.email %}

{{ invoice.customer.email }}

{% endif %} {% if invoice.customer.phone %}

{{ invoice.customer.phone }}

{% endif %}
Invoice Information

Date: {{ invoice.invoice_date|date:"d M Y" }}

Due Date: {{ invoice.due_date|date:"d M Y" }}

{% if invoice.reference %}

Reference: {{ invoice.reference }}

{% endif %}

Status: {% if invoice.status == 'DRAFT' %} Draft {% elif invoice.status == 'SENT' %} Sent {% elif invoice.status == 'PARTIAL' %} Partially Paid {% elif invoice.status == 'PAID' %} Paid {% elif invoice.status == 'OVERDUE' %} Overdue {% elif invoice.status == 'CANCELLED' %} Cancelled {% endif %}

{% for item in invoice.items.all %} {% endfor %} {% if invoice.tax_amount > 0 %} {% endif %}
Description Qty Unit Price Amount
{{ item.description }} {{ item.quantity|floatformat:2 }} RM {{ item.unit_price|floatformat:2|intcomma }} RM {{ item.get_total|floatformat:2|intcomma }}
Subtotal: RM {{ invoice.subtotal|floatformat:2|intcomma }}
Tax ({{ invoice.tax_rate }}%): RM {{ invoice.tax_amount|floatformat:2|intcomma }}
Total:
RM {{ invoice.total_amount|floatformat:2|intcomma }}
{% if invoice.notes %}
Notes:

{{ invoice.notes|linebreaksbr }}

{% endif %}
Created by {{ invoice.created_by.username }} on {{ invoice.created_at|date:"d M Y H:i" }}
{% if invoice.status != 'PAID' %} Edit {% endif %} Print {% if invoice.status != 'PAID' and invoice.amount_paid == 0 %} Delete {% endif %}
Payment Summary
Total Amount: RM {{ invoice.total_amount|floatformat:2|intcomma }}
Amount Paid: RM {{ invoice.amount_paid|floatformat:2|intcomma }}

Balance Due: RM {{ invoice.get_balance_due|floatformat:2|intcomma }}
{% if invoice.get_balance_due > 0 %}
Payment Progress
{{ invoice.get_payment_percentage|floatformat:0 }}% Paid
{% endif %}
Payment History
{% if payments %}
{% for payment in payments %}
RM {{ payment.amount|floatformat:2|intcomma }} {{ payment.payment_date|date:"d M Y" }}
{{ payment.get_payment_method_display }} {% if payment.bank_account %} - {{ payment.bank_account.name }} {% endif %} {% if payment.notes %} {{ payment.notes }} {% endif %}
Receipt {% if invoice.status != 'PAID' %} Delete {% endif %}
{% endfor %}
{% else %}

No payments recorded yet

Record First Payment
{% endif %}
{% endblock %}