{% extends edc_base_template %} {% load static %} {% block main %} {{ block.super }}
Edc PharmacyOrders › {{ order.order_identifier }}
{# ── Order summary ── #}
Order {{ order.order_identifier }} — {{ order.title|default:"(untitled)" }}   {% if order.status == COMPLETE %} Complete {% elif order.status == PARTIAL %} Partial {% else %} New {% endif %}
{% if order.comment %} {% endif %}
Supplier {{ order.supplier|default:"—" }} Order date {{ order.order_datetime|date:"d-M-Y" }}
Items ordered {{ order.item_count }} Created by {{ order.user_created|default:"—" }}
Last modified {{ order.modified|default:order.created|date:"d-M-Y H:i" }}
Printed {% if order.printed %} Yes — by {{ order.printed_by|default:"—" }} on {{ order.printed_datetime|date:"d-M-Y H:i"|default:"—" }} {% else %} No — will be set when the PDF is printed {% endif %}
Comment {{ order.comment }}
Edit {% if order.item_count > 0 %}  {% if order.printed %}Re-print PDF{% else %}Print PDF{% endif %} Go to receiving {% endif %}   Audit trail
{# ── Order items ── #}
Order items   Add item
{% if rows %} {% for row in rows %} {% with oi=row.order_item %}
{{ oi.order_item_identifier }} — {{ oi.product.name }}   {% if oi.unit_qty_pending == 0 %} Fully received {% elif oi.unit_qty_received and oi.unit_qty_received > 0 %} 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 %}
Edit {% if row.can_delete %}  
{% csrf_token %}
{% else %}   Cannot delete — stock has been received {% endif %} Audit trail
{% endwith %} {% endfor %} {% else %}

No items on this order yet. Click Add item to add one.

{% endif %}

← All orders

{# ── Delete confirmation modal (shared across delete forms on this page) ── #} {% endblock main %}