{% load humanize %} Bill {{ bill.bill_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 %}

BILL

{{ bill.bill_number }}

{% if bill.vendor_bill_number %}

Vendor Bill #: {{ bill.vendor_bill_number }}

{% endif %}

Date: {{ bill.bill_date|date:"d/m/Y" }}
Due Date: {{ bill.due_date|date:"d/m/Y" }}

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

From (Vendor):

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

To (Our Company):

{{ 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 %}
{% 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 {{ bill.subtotal|floatformat:2|intcomma }}
SST ({{ bill.sst_rate }}%): RM {{ bill.sst_amount|floatformat:2|intcomma }}
TOTAL: RM {{ bill.total|floatformat:2|intcomma }}
{% if bill.get_balance_due > 0 %}
Amount Paid: RM {{ bill.amount_paid|floatformat:2|intcomma }}
Balance Due: RM {{ bill.get_balance_due|floatformat:2|intcomma }}
{% endif %} {% if bill.notes %}
Notes:
{{ bill.notes|linebreaks }}
{% endif %}