{% for batch in batches %}

{{ batch.location.name }}

{{ batch.get_status_display }}
{% for item in batch.queue_items %}
{{ item.product_name|default:'Product details needed' }}{{ item.barcode }} · {{ item.get_status_display }}{% if item.last_error %} · {{ item.last_error }}{% endif %}
{{ item.package_count }} package{{ item.package_count|pluralize }} {% if item.package_amount %}{{ item.package_amount }} {{ item.package_unit }}{% endif %} {% if batch.status == 'draft' and item.status == 'confirmed' %}
{{ item.package_count }}
{% endif %}
{% empty %}

No confirmed items in this location batch yet.

{% endfor %}
{% empty %}

Your saved batches will appear here.

{% endfor %}