{% load humanize %} Invoice {{ invoice.invoice_number }}

{{ company_info.name }}

{{ company_info.address|linebreaks }} {% if company_info.phone %}Tel: {{ company_info.phone }}
{% endif %} {% if company_info.email %}Email: {{ company_info.email }}
{% endif %} {% if company_info.sst_number %}SST No: {{ company_info.sst_number }}{% endif %}

INVOICE

{{ invoice.invoice_number }}

Date: {{ invoice.invoice_date|date:"d/m/Y" }}
Due Date: {{ invoice.due_date|date:"d/m/Y" }}

{% if invoice.status == 'PAID' %} PAID {% elif invoice.is_overdue %} OVERDUE {% else %} UNPAID {% endif %}

Bill To:

{{ invoice.customer.name }}
{% if invoice.customer.business_registration_no %} Reg No: {{ invoice.customer.business_registration_no }}
{% endif %} {% if invoice.customer.address %} {{ invoice.customer.address|linebreaks }} {% endif %} {% if invoice.customer.phone %}Tel: {{ invoice.customer.phone }}
{% endif %} {% if invoice.customer.email %}Email: {{ invoice.customer.email }}{% endif %}

Payment Terms:

Due Date: {{ invoice.due_date|date:"d/m/Y" }}
Payment Method: Bank Transfer
{% if company_info.bank_name %} Bank: {{ company_info.bank_name }}
{% endif %} {% if company_info.bank_account_number %} Account: {{ company_info.bank_account_number }}
{% endif %} {% if company_info.bank_account_holder %} Account Name: {{ company_info.bank_account_holder }} {% endif %}
{% for item in items %} {% endfor %}
# Description Quantity Unit Price Amount
{{ forloop.counter }} {{ item.description }} {{ item.quantity|floatformat:2 }} RM {{ item.unit_price|floatformat:2|intcomma }} RM {{ item.total|floatformat:2|intcomma }}
Subtotal: RM {{ invoice.subtotal|floatformat:2|intcomma }}
SST ({{ invoice.sst_rate }}%): RM {{ invoice.sst_amount|floatformat:2|intcomma }}
TOTAL: RM {{ invoice.total|floatformat:2|intcomma }}
{% if invoice.get_balance_due > 0 %}
Amount Paid: RM {{ invoice.amount_paid|floatformat:2|intcomma }}
Balance Due: RM {{ invoice.get_balance_due|floatformat:2|intcomma }}
{% endif %} {% if invoice.terms %}
Terms & Conditions:
{{ invoice.terms|linebreaks }}
{% endif %}