{% if receive and not edit_receive %}
{# ── Read-only summary ── #}
| Location |
{{ receive.location }} |
Received count |
{{ receive.item_count|default:"—" }} |
| Invoice # |
{{ receive.invoice_number|default:"—" }} |
Invoice date |
{{ receive.invoice_date|date:"d-M-Y"|default:"—" }} |
{% if receive.comment %}
| Comment |
{{ receive.comment }} |
{% endif %}
Edit
Audit trail
{% else %}
{# ── Edit / create form ── #}
{% endif %}
{# ── Order items (with receive progress) ── #}
{% if receive %}
Receive progress for this order
{% for row in rows %}
{% with oi=row.order_item %}
Item {{ oi.order_item_identifier }}
— {{ oi.product.name }}
{% if oi.unit_qty_pending is not None and oi.unit_qty_pending == 0 %}
Fully received
{% elif row.receive_items %}
Partial
{% else %}
Pending
{% endif %}
| Container |
{{ oi.container }} |
Units/container |
{{ oi.container_unit_qty }} |
| Containers ordered |
{{ oi.item_qty_ordered }} |
Units ordered |
{{ oi.unit_qty_ordered }} |
| Units received |
{{ oi.unit_qty_received|default:"0" }} |
Units pending |
{% if oi.unit_qty_pending %}
{{ oi.unit_qty_pending }}
{% else %}
0
{% endif %}
|
{# Existing receive items #}
{% if row.receive_items %}
| Receive item # |
Batch |
Container |
Containers |
Units |
Date |
Reference |
|
{% for entry in row.receive_items %}
{% with ri=entry.ri %}
{{ ri.receive_item_identifier }} |
{% if show_batch %}{{ ri.lot.lot_no }}{% else %}******{% endif %} |
{{ ri.container }} |
{{ ri.item_qty_received }} |
{{ ri.unit_qty_received }} |
{{ ri.receive_item_datetime|date:"d-M-Y" }} |
{{ ri.reference }} |
{% if entry.can_edit_delete %}
{% else %}
{% endif %}
|
{% endwith %}
{% endfor %}
{% endif %}
{# Receive button — navigates to dedicated receive-item page #}
{% endwith %}
{% endfor %}
{% if unconfirmed_count > 0 %}
{{ unconfirmed_count }} stock item{{ unconfirmed_count|pluralize }}
need{{ unconfirmed_count|pluralize:"s," }} labelling and confirming.
{% endif %}
{% endif %}