{% from "_pagination.html" import render_pagination %} {% macro list_orders(orders, controller, can_delete, can_fulfill, can_receive, get_order_last_restore, url_for_storage) %} {{ render_pagination(orders, controller) }}
ID | Project | PO | Institution | Name | Received | Expected Fulfillment Date | Last Restore Date | Shipping Label | {% if controller=="admin_orders" %}Fulfilled{% else %}Duplicate{% endif %} | Edit | {% if controller=="admin_orders" and can_delete() %}Delete | {% endif %} {% if controller=="admin_orders" %}Return Label | {% endif %}
---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ order.id }} | {{ order.project_id }} | {{ order.po_number }} | {{ order.owner.company }} | {{ order.owner.last_name }}, {{ order.owner.first_name }} | {% if controller=="admin_orders" %} {% if can_receive() %} {% if order.received_date %} Received {% else %} Received Order {% endif %} {% else %} {% if order.received_date %} Received {% else %} Not yet received {% endif %} {% endif %} {% else %} {% if order.received_date %} {{ order.received_date.strftime("%Y-%m-%d %H:%M") }} {% else %} {% endif %} {% endif %} | {{ order.expected_fulfillment_date() }} | {{ get_order_last_restore(order)}} | {% if order.shipping_label_url %} View Shipping Label {% endif %} | {% if controller=="admin_orders" %} {% if can_fulfill() %} {% if order.fulfilled %} Fulfilled {% else %} {% if order.received_date %} Fulfill Order {% endif %} {% endif %} {% else %} {% if order.fulfilled %} Fulfilled {% else %} {% if order.received_date %} Not yet fulfilled {% endif %} {% endif %} {% endif %} {% else %} Duplicate {% endif %} | {% if controller=="admin_orders" %} Edit Order {% else %} {% if not order.received_date %} Edit Order {% endif %} {% endif %} | {% if controller=="admin_orders" and can_delete() %}Delete Order | {% endif %} {% if controller=="admin_orders" %}{%if order.return_shipping_label_url %} View {% endif %} Generate | {% endif %}