2016-05-19 09:19:51 +00:00
|
|
|
{% extends 'shop_base.html' %}
|
2016-05-15 22:09:00 +00:00
|
|
|
{% load bootstrap3 %}
|
2016-05-29 13:04:52 +00:00
|
|
|
{% load shop_tags %}
|
2016-05-15 22:09:00 +00:00
|
|
|
|
2016-05-19 09:19:51 +00:00
|
|
|
{% block shop_content %}
|
2016-05-15 22:09:00 +00:00
|
|
|
<h3>Orders</h3>
|
|
|
|
<table class="table table-bordered table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Order ID</th>
|
2016-05-29 12:48:57 +00:00
|
|
|
<th>Items</th>
|
|
|
|
<th>Total amount</th>
|
2016-05-15 22:09:00 +00:00
|
|
|
<th>Open?</th>
|
|
|
|
<th>Paid?</th>
|
|
|
|
<th>Delivered?</th>
|
2016-05-30 19:29:18 +00:00
|
|
|
<th>Invoice</th>
|
2016-05-15 22:09:00 +00:00
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for order in orders %}
|
2016-05-31 17:55:33 +00:00
|
|
|
{% if order.products.exists %}
|
2016-05-29 12:48:57 +00:00
|
|
|
<tr {% if not order.open and order.paid and order.is_fully_handed_out %}style="color: lightgrey"{% endif %}>
|
2016-05-15 22:09:00 +00:00
|
|
|
<td>{{ order.id }}</td>
|
2016-05-29 12:48:57 +00:00
|
|
|
<td>{{ order.get_number_of_items }}</td>
|
2016-05-29 13:04:52 +00:00
|
|
|
<td>{{ order.total|currency }}</td>
|
2016-05-29 13:16:29 +00:00
|
|
|
<td class="text-center">{{ order.open|truefalseicon }}</td>
|
|
|
|
<td class="text-center">{{ order.paid|truefalseicon }}</td>
|
|
|
|
<td class="text-center">{{ order.handed_out_status }}</td>
|
2016-05-15 22:09:00 +00:00
|
|
|
<td>
|
2016-05-30 19:29:18 +00:00
|
|
|
{% if order.invoice.pdf %}
|
2016-05-30 21:58:22 +00:00
|
|
|
{% url 'shop:download_invoice' pk=order.pk as invoice_download_url %}
|
|
|
|
{% bootstrap_button "PDF" icon="save-file" href=invoice_download_url button_class="btn-primary btn-xs" %}
|
2016-05-30 19:29:18 +00:00
|
|
|
{% else %}
|
|
|
|
N/A
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
2016-05-29 12:48:57 +00:00
|
|
|
{% url 'shop:order_detail' pk=order.pk as order_detail_url %}
|
2016-05-29 13:18:36 +00:00
|
|
|
{% bootstrap_button "Order details" icon="th-list" href=order_detail_url button_class="btn-primary btn-xs" %}
|
2016-05-15 22:09:00 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-05-31 17:55:33 +00:00
|
|
|
{% endif %}
|
2016-05-15 22:09:00 +00:00
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
{% endblock %}
|