{% load i18n %}
{% load purchase %}

<table class="table table-hover table-sm">
    <thead><tr>
        <th scope="col">{% translate "Date" %}</th>
        <th scope="col">{% translate "# baskets" %}</th>
        <th scope="col">{% translate "Turnover" %}</th>
        <th scope="col">{% translate "Average basket" %}</th>
    </tr></thead>
    <tbody>
        {% for report in by_day %}
            <tr>
                {% with d=report.date %}
                    <th scope="row"><a href="{% url "purchase:reports" %}?year={{ d.year }}&month={{ d.month }}&day={{ d.day }}">{{ d }}</a></th>
                {% endwith %}
                <td>{{ report.count }}</td>
                <td>{{ report.turnover|currency }}</td>
                <td>{{ report.average_basket|currency }}</td>
            </tr>
        {% endfor %}
    </tbody>
</table>
