{% extends "layout.html" %} {% set active_page = "orders" -%} {% import "bootstrap/wtf.html" as wtf %} {% block container %}

Order {{ order.id }} {% if order.can_close(current_user.id) -%} Close
{%- endif %}

courrier: {{ order.courrier.username }} {% if order.courrier == None and not current_user.is_anonymous() %} Volunteer {% endif %}
location: {{ order.location.name }}
opened on {{ order.starttime }}
status: {% if order.stoptime %}{{ order.stoptime|countdown }}{% else %}open{% endif %}
total price: {{ total_price|euro }}
{% if form -%}

Order:

{{ wtf.quick_form(form, action=url_for('.order_item_create', id=order.id), button_map={'submit_button': 'primary'}, form_type='horizontal') }}
{%- endif %}

Orders

{% for item in order.items %} {{ item.get_name() }} - {{ item.product.name }} - {{ item.product.price|euro }} {% if item.can_delete(order.id, current_user.id, session.get('anon_name', '')) -%}{%- endif %}
{% endfor %}

Ordered products:

{% for key, value in order.group_by_product().items() %} {{ key }} - {{ value }}
{% endfor %}

Debts

{% for key, value in order.group_by_user_pay().items() %} {{ key }} - {{ value|euro }}
{% endfor %}
{% endblock %}