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

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

7
{% block content %}
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
        {% if i.is_owned_by(user) %}
            <td><a href="{{ url('counter:refilling_delete', refilling_id=i.id) }}">Delete</a></td>
        {% endif %}
Skia's avatar
Skia committed
34
35
36
37
    </tr>
{% endfor %}
    </tbody>
</table>
Skia's avatar
Skia committed
38
39
{% endif %}
{% if customer.buyings.exists() %}
40
<h4>{% trans %}Account buyings{% endtrans %}</h4>
Skia's avatar
Skia committed
41
42
43
44
<table>
    <thead>
        <tr>
            <td>{% trans %}Date{% endtrans %}</td>
45
            <td>{% trans %}Counter{% endtrans %}</td>
Skia's avatar
Skia committed
46
            <td>{% trans %}Barman{% endtrans %}</td>
Skia's avatar
Skia committed
47
            <td>{% trans %}Label{% endtrans %}</td>
Skia's avatar
Skia committed
48
49
            <td>{% trans %}Quantity{% endtrans %}</td>
            <td>{% trans %}Total{% endtrans %}</td>
50
            <td>{% trans %}Payment method{% endtrans %}</td>
Skia's avatar
Skia committed
51
52
53
        </tr>
    </thead>
    <tbody>
54
    {% for i in customer.buyings.order_by('-date').all() %}
Skia's avatar
Skia committed
55
56
        <tr>
        <td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
57
58
        <td>{{ i.counter }}</td>
        <td><a href="{{ i.seller.get_absolute_url() }}">{{ i.seller.get_display_name() }}</a></td>
Skia's avatar
Skia committed
59
        <td>{{ i.label }}</td>
Skia's avatar
Skia committed
60
61
        <td>{{ i.quantity }}</td>
        <td>{{ i.quantity * i.unit_price }}</td>
62
        <td>{{ i.get_payment_method_display() }}</td>
Skia's avatar
Skia committed
63
64
65
        {% if i.is_owned_by(user) %}
            <td><a href="{{ url('counter:selling_delete', selling_id=i.id) }}">Delete</a></td>
        {% endif %}
Skia's avatar
Skia committed
66
67
68
69
    </tr>
{% endfor %}
    </tbody>
</table>
Skia's avatar
Skia committed
70
71
{% endif %}
{% if customer.user.invoices.exists() %}
72
<h4>{% trans %}Eboutic invoices{% endtrans %}</h4>
Skia's avatar
Skia committed
73
74
75
76
77
78
79
80
81
<table>
    <thead>
        <tr>
            <td>{% trans %}Date{% endtrans %}</td>
            <td>{% trans %}Items{% endtrans %}</td>
            <td>{% trans %}Amount{% endtrans %}</td>
        </tr>
    </thead>
    <tbody>
82
    {% for i in customer.user.invoices.order_by('-date').all() %}
Skia's avatar
Skia committed
83
84
85
86
87
        <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
88
                <li>{{ it.quantity }} x {{ it.product_name }} - {{ it.product_unit_price }}</li>
Skia's avatar
Skia committed
89
90
91
92
93
94
95
96
                {% endfor %}
            </ul>
        </td>
        <td>{{ i.get_total() }}</td>
    </tr>
{% endfor %}
    </tbody>
</table>
Skia's avatar
Skia committed
97
{% endif %}
Skia's avatar
Skia committed
98
99
100
{% else %}
<p>{% trans %}User has no account{% endtrans %}</p>
{% endif %}
101
102
103
104
{% endblock %}