aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/templates/settle_bills.html
blob: 30f64d03628d19a08f088c06c6fe8ded28bbbef1 (plain)
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
{% extends "sidebar_table_layout.html" %}

{% block sidebar %}
    <div id="table_overflow">
    <table class="balance table">
    {% set balance = g.project.balance %}
    {% for member in g.project.members | sort(attribute='name') if member.activated or balance[member.id]|round(2) != 0 %}
    <tr id="bal-member-{{ member.id }}" action={% if member.activated %}delete{% else %}reactivate{% endif %}>
        <td class="balance-name">{{ member.name }}</td>
        <td class="balance-value {% if balance[member.id]|round(2) > 0 %}positive{% elif balance[member.id]|round(2) < 0 %}negative{% endif %}">
            {% if balance[member.id]|round(2) > 0 %}+{% endif %}{{ "%.2f" | format(balance[member.id]) }}
        </td>
    </tr>
    {% endfor %}
    </table>
    </div>
{% endblock %}


{% block content %}
    <table id="bill_table" class="split_bills table table-striped">
        <thead><tr><th>{{ _("Who pays?") }}</th><th>{{ _("To whom?") }}</th><th>{{ _("How much?") }}</th></tr></thead>
    <tbody>
    {% for bill in bills %}
    <tr receiver={{bill.receiver.id}}>
            <td>{{ bill.ower }}</td>
            <td>{{ bill.receiver }}</td>
            <td>{{ bill.amount|currencyformat_nc(g.project.default_currency) }}</td>
    </tr>
    {% endfor %}
    </tbody>
    </table>

{% endblock %}