user_account_detail.jinja 3.81 KB
Newer Older
Sli's avatar
Sli committed
1
2
3
4
5
6
7
8
9
10
{% extends "core/base.jinja" %}

{% block title %}
{% trans user_name=profile.get_display_name() %}{{ user_name }}'s account{% endtrans %}
{% endblock %}

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