{% extends 'oscar/dashboard/reports/index.html' %}
{% load currency_filters %}
{% load i18n %}

{% block report %}
<table class="table table-striped table-bordered table-hover">
    {% if objects %}
        <tr>
            <th>{% trans "Voucher code" %}</th>
            <th>{% trans "Added to a basket" %}</th>
            <th>{% trans "Used in an order" %}</th>
            <th>{% trans "Total discount" %}</th>
        </tr>
        {% for voucher in objects %}
        <tr>
            <td><a href="{% url 'dashboard:voucher-stats' voucher.id %}">{{ voucher.code }}</a></td>
            <td>{{ voucher.num_basket_additions }}</td>
            <td>{{ voucher.num_orders }}</td>
            <td>{{ voucher.total_discount|currency }}</td>
        </tr>
        {% endfor %}
    {% else %}
        <tr><td>{% trans "No vouchers were used in this period" %}</td></tr>
    {% endif %}
</table>
{% include "oscar/dashboard/partials/pagination.html" %}
{% endblock %}
