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

{{ l('Customer Sales Report', 'কাস্টমারের ক্রয় রিপোর্ট') }}

{{ customer.name }}{% if customer.phone %} · {{ customer.phone }}{% endif %}

{{ l('Back to Customers', 'কাস্টমার লিস্টে ফিরুন') }}
{{ l('Total Purchase', 'মোট ক্রয়') }}
৳ {{ "%.2f"|format(total_purchase or 0) }}
{{ l('Total Invoices', 'মোট ইনভয়েস') }}
{{ invoices|length }}
{{ l('Due Balance', 'বাকি') }}
৳ {{ "%.2f"|format(customer.due_amount or 0) }}
{{ l('Customer Information', 'কাস্টমারের তথ্য') }}
{{ l('Name', 'নাম') }}
{{ customer.name }}
{% if customer.phone %}
{{ l('Phone', 'ফোন') }}
{{ customer.phone }}
{% endif %} {% if customer.address %}
{{ l('Address', 'ঠিকানা') }}
{{ customer.address }}
{% endif %}
{{ l('Payment Status', 'পেমেন্ট স্ট্যাটাস') }}
{% if (customer.due_amount or 0) > 0 %} {{ l('Has Due', 'বাকি আছে') }}: ৳ {{ "%.2f"|format(customer.due_amount) }} {% else %} {{ l('Clear', 'পরিষ্কার') }} {% endif %}
{{ l('All Purchase Transactions', 'সকল ক্রয় লেনদেন') }}
{{ l('Total Records', 'মোট রেকর্ড') }}: {{ invoices|length }}
{% set ns = namespace(has_rows=false) %} {% for invoice in invoices %} {% for item in invoice.items %} {% set ns.has_rows = true %} {% endfor %} {% endfor %} {% if not ns.has_rows %} {% endif %} {% if ns.has_rows %} {% endif %}
{{ l('Invoice No', 'ইনভয়েস নং') }} {{ l('Product', 'পণ্য') }} {{ l('Qty', 'পরিমাণ') }} {{ l('Unit Price', 'একক মূল্য') }} {{ l('Total', 'মোট') }} {{ l('Date', 'তারিখ') }} {{ l('Action', 'অ্যাকশন') }}
{{ invoice.invoice_no }} {% if item.product %}{{ item.product.name }}{% else %}{{ l('Deleted Product', 'মুছে যাওয়া পণ্য') }}{% endif %} {{ "%.2f"|format(item.quantity or 0) }} ৳ {{ "%.2f"|format(item.price or 0) }} ৳ {{ "%.2f"|format(item.total or 0) }} {{ invoice.created_at.strftime('%d-%m-%Y %I:%M %p') if invoice.created_at else '—' }} {{ l('View', 'দেখুন') }}
{{ l('No purchase records found for this customer.', 'এই কাস্টমারের কোনো ক্রয় রেকর্ড পাওয়া যায়নি।') }}
{{ l('Grand Total', 'সর্বমোট') }} ৳ {{ "%.2f"|format(total_purchase or 0) }}
{% endblock %}