club_sellings.jinja 1.58 KB
Newer Older
Skia's avatar
Skia committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}

{% block content %}
<h3>{% trans %}Sellings{% endtrans %}</h3>
<form action="" method="get">
    {% csrf_token %}
    {{ form }}
    <p><input type="submit" value="{% trans %}Show{% endtrans %}" /></p>
</form>
<p>
{% trans %}Quantity: {% endtrans %}{{ result.count() }} {% trans %}units{% endtrans %}<br/>
{% trans %}Total: {% endtrans %}{{ total }}
</p>
<table>
    <thead>
        <tr>
            <td>{% trans %}Date{% endtrans %}</td>
            <td>{% trans %}Counter{% endtrans %}</td>
            <td>{% trans %}Barman{% endtrans %}</td>
            <td>{% trans %}Customer{% endtrans %}</td>
            <td>{% trans %}Label{% endtrans %}</td>
            <td>{% trans %}Quantity{% endtrans %}</td>
            <td>{% trans %}Total{% endtrans %}</td>
            <td>{% trans %}Payment method{% endtrans %}</td>
        </tr>
    </thead>
    <tbody>
    {% for s in result %}
        <tr>
            <td>{{ s.date|localtime|date(DATETIME_FORMAT) }} {{ s.date|localtime|time(DATETIME_FORMAT) }}</td>
            <td>{{ s.counter }}</td>
            <td><a href="{{ s.seller.get_absolute_url() }}">{{ s.seller.get_display_name() }}</a></td>
            <td><a href="{{ s.customer.user.get_absolute_url() }}">{{ s.customer.user.get_display_name() }}</a></td>
            <td>{{ s.label }}</td>
            <td>{{ s.quantity }}</td>
            <td>{{ s.quantity * s.unit_price }}</td>
            <td>{{ s.get_payment_method_display() }}</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
{% endblock %}