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

Order {{ order.id }} {% if (current_user.id == order.courrier_id and (not order.stoptime)) or current_user.is_admin() -%} Close
{%- endif %}

Courrier: {{ order.courrier.username }} {% if order.courrier == None %} Volunteer {% endif %}
Location: {{ order.location.name }}
Starttime: {{ order.starttime }}
Stoptime: {{ order.stoptime }}
Total price: {{ total_price|euro }}

Orders

{% for item in order.orders %} {{ item.user.username }} - {{ item.food.name }} - {{ item.food.price|euro }} {% if item.can_delete(order.id, current_user.id) -%}{%- endif %}
{% endfor %}

Debts

{% for key, value in total_payments.items() %} {{ key.username }} - {{ value|euro }}
{% endfor %}

Order:

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