user_account.jinja 3.14 KB
Newer Older
1
2
3
{% extends "core/user_base.jinja" %}

{% block title %}
Skia's avatar
Skia committed
4
{% trans user_name=profile.get_display_name() %}{{ user_name }}'s account{% endtrans %}
5
6
7
{% endblock %}

{% block infos %}
Skia's avatar
Skia committed
8
{% if customer %}
Skia's avatar
Skia committed
9
<h3>{% trans %}User account{% endtrans %}</h3>
Skia's avatar
Skia committed
10
<p>{% trans %}Amount: {% endtrans %}{{ customer.amount }}</p>
Skia's avatar
Skia committed
11
{% if customer.refillings.exists() %}
Skia's avatar
Skia committed
12
13
14
15
16
<h4>{% trans %}Refillings{% endtrans %}</h4>
<table>
    <thead>
        <tr>
            <td>{% trans %}Date{% endtrans %}</td>
17
            <td>{% trans %}Counter{% endtrans %}</td>
Skia's avatar
Skia committed
18
19
            <td>{% trans %}Barman{% endtrans %}</td>
            <td>{% trans %}Amount{% endtrans %}</td>
20
            <td>{% trans %}Payment method{% endtrans %}</td>
Skia's avatar
Skia committed
21
22
23
        </tr>
    </thead>
    <tbody>
24
    {% for i in customer.refillings.order_by('-date').all() %}
Skia's avatar
Skia committed
25
26
        <tr>
        <td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
27
        <td>{{ i.counter }}</td>
28
        <td><a href="{{ i.operator.get_absolute_url() }}">{{ i.operator.get_display_name() }}</a></td>
Skia's avatar
Skia committed
29
        <td>{{ i.amount }}</td>
30
        <td>{{ i.get_payment_method_display() }}</td>
Skia's avatar
Skia committed
31
32
33
34
    </tr>
{% endfor %}
    </tbody>
</table>
Skia's avatar
Skia committed
35
36
{% endif %}
{% if customer.buyings.exists() %}
37
<h4>{% trans %}Account buyings{% endtrans %}</h4>
Skia's avatar
Skia committed
38
39
40
41
<table>
    <thead>
        <tr>
            <td>{% trans %}Date{% endtrans %}</td>
42
            <td>{% trans %}Counter{% endtrans %}</td>
Skia's avatar
Skia committed
43
            <td>{% trans %}Barman{% endtrans %}</td>
Skia's avatar
Skia committed
44
            <td>{% trans %}Label{% endtrans %}</td>
Skia's avatar
Skia committed
45
46
            <td>{% trans %}Quantity{% endtrans %}</td>
            <td>{% trans %}Total{% endtrans %}</td>
47
            <td>{% trans %}Payment method{% endtrans %}</td>
Skia's avatar
Skia committed
48
49
50
        </tr>
    </thead>
    <tbody>
51
    {% for i in customer.buyings.order_by('-date').all() %}
Skia's avatar
Skia committed
52
53
        <tr>
        <td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
54
55
        <td>{{ i.counter }}</td>
        <td><a href="{{ i.seller.get_absolute_url() }}">{{ i.seller.get_display_name() }}</a></td>
Skia's avatar
Skia committed
56
        <td>{{ i.label }}</td>
Skia's avatar
Skia committed
57
58
        <td>{{ i.quantity }}</td>
        <td>{{ i.quantity * i.unit_price }}</td>
59
        <td>{{ i.get_payment_method_display() }}</td>
Skia's avatar
Skia committed
60
61
62
63
    </tr>
{% endfor %}
    </tbody>
</table>
Skia's avatar
Skia committed
64
65
{% endif %}
{% if customer.user.invoices.exists() %}
66
<h4>{% trans %}Eboutic invoices{% endtrans %}</h4>
Skia's avatar
Skia committed
67
68
69
70
71
72
73
74
75
<table>
    <thead>
        <tr>
            <td>{% trans %}Date{% endtrans %}</td>
            <td>{% trans %}Items{% endtrans %}</td>
            <td>{% trans %}Amount{% endtrans %}</td>
        </tr>
    </thead>
    <tbody>
76
    {% for i in customer.user.invoices.order_by('-date').all() %}
Skia's avatar
Skia committed
77
78
79
80
81
        <tr>
        <td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
        <td>
            <ul>
                {% for it in i.items.all() %}
Skia's avatar
Skia committed
82
                <li>{{ it.quantity }} x {{ it.product_name }} - {{ it.product_unit_price }}</li>
Skia's avatar
Skia committed
83
84
85
86
87
88
89
90
                {% endfor %}
            </ul>
        </td>
        <td>{{ i.get_total() }}</td>
    </tr>
{% endfor %}
    </tbody>
</table>
Skia's avatar
Skia committed
91
{% endif %}
Skia's avatar
Skia committed
92
93
94
{% else %}
<p>{% trans %}User has no account{% endtrans %}</p>
{% endif %}
95
96
97
98
{% endblock %}