{% extends 'base.html' %} {% block title %}{{ invoice.reference }}{% endblock %} {% block content %}

{{ invoice.reference }}

← Back {% if invoice.status != 'cancelled' and invoice.status != 'paid' %} {% if request.user.is_owner or request.user.is_manager %} ✕ Cancel {% endif %} {% endif %}

Customer

Name
{{ invoice.customer_display }}
{% if invoice.customer_phone %}
Phone
{{ invoice.customer_phone }}
{% endif %} {% if invoice.customer_email %}
Email
{{ invoice.customer_email }}
{% endif %}
Issue Date
{{ invoice.issue_date|date:"d M Y" }}
Due Date
{{ invoice.due_date|date:"d M Y"|default:"—" }} {% if invoice.is_overdue %}Overdue{% endif %}
Status
{{ invoice.get_status_display }}
{% if invoice.note %}
📝 {{ invoice.note }}
{% endif %}

Summary

Subtotal {{ business.currency }} {{ invoice.subtotal|floatformat:0 }}
{% if invoice.discount %}
Discount - {{ business.currency }} {{ invoice.discount|floatformat:0 }}
{% endif %}
Total {{ business.currency }} {{ invoice.total|floatformat:0 }}
Paid {{ business.currency }} {{ invoice.total_paid|floatformat:0 }}
Balance Due {{ business.currency }} {{ invoice.balance_due|floatformat:0 }}

Items

{% for item in invoice.items.all %} {% endfor %}
DescriptionQtyUnit PriceTotal
{{ item.description }} {{ item.quantity }} {{ business.currency }} {{ item.unit_price|floatformat:0 }} {{ business.currency }} {{ item.line_total|floatformat:0 }}

Payment History

{% if payments %} {% for payment in payments %} {% endfor %}
DateAmountMethodAccountNoteBy
{{ payment.date|date:"d M Y" }} {{ business.currency }} {{ payment.amount|floatformat:0 }} {{ payment.get_payment_method_display }} {{ payment.account.name }} {{ payment.note|default:"—" }} {{ payment.created_by.username|default:"—" }}
{% else %}
No payments yet.
{% endif %}
{% if invoice.status != 'paid' and invoice.status != 'cancelled' %}

Record Payment

{% load form_tags %}
{% csrf_token %} {% for field in payment_form %}
{{ field|daisyui }} {% for error in field.errors %} {{ error }} {% endfor %}
{% endfor %} {% if payment_form.non_field_errors %}
{{ payment_form.non_field_errors }}
{% endif %}
{% endif %} {% endblock %}