ihatemoney/ihatemoney/templates/settle_bills.html
Leo Mouyna a1ff32f6ad feat: add the ability to refund.
Create a new form based on the bill one with autocompleted fields.
Add an action button at the end of each row on settle page.
Add API payments entry.
Implement refund tests related.

See issue: #137
2020-03-11 22:47:22 +01:00

59 lines
2.4 KiB
HTML

{% 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><th>{{ _("Actions") }}</th></tr></thead>
<tbody>
{% for bill in bills %}
<tr receiver={{bill.receiver.id}}>
<td>{{ bill.ower }}</td>
<td>{{ bill.receiver }}</td>
<td>{{ "%0.2f"|format(bill.amount) }}</td>
<td class="table-actions">
<a
class="payment"
href="{{ url_for(".add_payment", receiver=bill.receiver.id) }}"
title="{{ _("pay") }}" data-toggle="modal"
data-target="#payment-form-{{bill.ower.id}}-{{bill.receiver.id}}"
>
{{ _('pay') }}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% for form in bill_forms %}
<div id="payment-form-{{form.payer.data}}-{{form.payed_for.data[0]}}" class="modal fade show" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">{{ form.title }}</h3>
<a href="#" class="close" data-dismiss="modal">&times;</a>
</div>
<form action="{{ url_for(".add_payment", receiver=form.payed_for.data[0]) }}" method="post" class="modal-body container">
{{ forms.add_bill(form, title=False, edit=True) }}
</form>
</div>
</div>
</div>
{% endfor %}
{% endblock %}