{% extends "base.html" %} {% block content %}

{{ shop.shop_name }}

{% if shop.address and shop.address != "None" %}{{ shop.address }}
{% endif %} {% if shop.phone and shop.phone != "None" %}Phone: {{ shop.phone }}{% endif %}

Inv: {{ invoice.invoice_no }} {{ invoice.created_at.strftime("%d-%m-%y %I:%M%p") }}
{% if invoice.customer %}
{{ invoice.customer.name }} {{ invoice.customer.phone or '' }}
{% else %}
Walk-in Customer
{% endif %}
{% for item in invoice.items %} {% endfor %}
Item Qty Price Total
{% if item.product %}{{ item.product.name }}{% else %}Deleted Product{% endif %} {% set q = item.quantity or 0 %}{{ q|int if q == q|int else "%.2f"|format(q) }} {{ "%.2f"|format(item.price) }} {{ "%.2f"|format(item.total) }}

Subtotal ৳ {{ "%.2f"|format(invoice.subtotal or invoice.total_amount) }}
{% if invoice.discount_amount %}
Discount{% if invoice.coupon_code %} ({{ invoice.coupon_code }}){% endif %} - ৳ {{ "%.2f"|format(invoice.discount_amount) }}
{% endif %}
Grand Total ৳ {{ "%.2f"|format(invoice.total_amount) }}
{% if invoice.received_amount and invoice.received_amount > 0 %}
Received ৳ {{ "%.2f"|format(invoice.received_amount) }}
{% if invoice.change_amount and invoice.change_amount > 0 %}
Change Return ৳ {{ "%.2f"|format(invoice.change_amount) }}
{% endif %} {% endif %}
Paid ({{ invoice.payment_method }}) ৳ {{ "%.2f"|format(invoice.paid_amount or 0) }}
{% if invoice.due_amount and invoice.due_amount > 0 %}
Due ৳ {{ "%.2f"|format(invoice.due_amount) }}
{% endif %}

{{ l('Download PDF', 'পিডিএফ ডাউনলোড') }} {{ l('Return Items', 'পণ্য ফেরত') }} {% if invoice.customer and invoice.due_amount and invoice.due_amount > 0 %} {{ l('Collect Due', 'বাকি আদায়') }} {% endif %}
{% endblock %}