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

{{ l('Return Invoice', 'রিটার্ন ইনভয়েস') }}

{{ l('Create a return for sold items from invoice', 'ইনভয়েস থেকে বিক্রিত পণ্যের রিটার্ন তৈরি করুন') }}: {{ invoice.invoice_no }}

{{ l('Back to Returns', 'রিটার্নে ফিরুন') }}
{{ l('Original Invoice', 'আসল ইনভয়েস') }}
{{ l('Invoice No', 'ইনভয়েস নং') }}
{{ invoice.invoice_no }}
{{ l('Customer', 'কাস্টমার') }}
{{ invoice.customer.name if invoice.customer else l('Walk-in','সাধারণ') }}
{{ l('Invoice Date', 'তারিখ') }}
{{ invoice.created_at.strftime('%d-%m-%Y') if invoice.created_at else '—' }}
{{ l('Invoice Total', 'মোট') }}
৳ {{ "%.2f"|format(invoice.total_amount or 0) }}
{{ invoice.shop.shop_name if invoice.shop else 'Shop Manager POS' }}
{{ l('Sales Return Form', 'সেলস রিটার্ন ফর্ম') }}
{{ l('Reference Invoice', 'রেফারেন্স ইনভয়েস') }}
#{{ invoice.invoice_no }}
{{ invoice.created_at.strftime('%d-%m-%Y') if invoice.created_at else '' }}
{{ l('Note', 'নোট') }}: {{ l('Stock will be added back for returned quantities. Only enter quantities you want to return.', 'ফেরতকৃত পরিমাণ স্টকে যোগ হবে। শুধু যতটুকু ফেরত দিতে চান সেটাই লিখুন।') }}
{% for item in invoice.items %} {% set returned = namespace(qty=0) %} {% for r in invoice.returns %} {% for ri in r.items %} {% if ri.product_id == item.product_id %} {% set returned.qty = returned.qty + ri.quantity %} {% endif %} {% endfor %} {% endfor %} {% set available = (item.quantity or 0) - returned.qty %} {% endfor %}
{{ l('Product', 'পণ্য') }} {{ l('Sold Qty', 'বিক্রিত পরিমাণ') }} {{ l('Already Returned', 'আগে ফেরত দেওয়া') }} {{ l('Available', 'ফেরতযোগ্য') }} {{ l('Return Qty', 'ফেরত পরিমাণ') }}
{{ item.product.name if item.product else l('Deleted Product','মুছে যাওয়া পণ্য') }}
{% if item.product and item.product.sku %}
{{ item.product.sku }}
{% endif %}
{{ "%.2f"|format(item.quantity or 0) }} {% if returned.qty > 0 %} {{ "%.2f"|format(returned.qty) }} {% else %} {% endif %} {% if available > 0 %} {{ "%.2f"|format(available) }} {% else %} {{ l('None', 'শেষ') }} {% endif %} {% if available > 0 %} {% else %} {% endif %}
{{ l('Cancel', 'বাতিল') }}
{% endblock %}