aboutsummaryrefslogtreecommitdiff
path: root/budget
diff options
context:
space:
mode:
Diffstat (limited to 'budget')
-rw-r--r--budget/templates/compute_bills.html31
-rw-r--r--budget/templates/list_bills.html5
-rw-r--r--budget/web.py2
3 files changed, 2 insertions, 36 deletions
diff --git a/budget/templates/compute_bills.html b/budget/templates/compute_bills.html
deleted file mode 100644
index 4c6fd56..0000000
--- a/budget/templates/compute_bills.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{% extends "layout.html" %}
-
-{% block top_menu %}
-<a href="{{ url_for('list_bills', project_id=project.id) }}">Back to the list</a>
-{% endblock %}
-
-{% block content %}
-<h2>Computations</h2>
-
-<div class="container span-16">
- <ol>
- <li>For each person, get the list of bills he have to pay</li>
- <li>Increase the amount this person have to pay</li>
- <li>At the same time, increase what the payer of the bill have to receive</li>
- <li>At the end, for each person, substract what he have to pay to what he have to receive</li>
- </ol>
-</div>
-
-<div class="container span-6 last">
- <a class="awesome large green button" onclick = "if (! confirm('Are you sure ?')) return false;" href="">Mark this as payed / processed</a>
-</div>
-
-<table>
- <thead><tr><th>Name</th><th>Balance</th></tr></thead>
- <tbody>
-{% for person, balance in balances.items() %}
- <tr><td>{{ person.name }}</td><td>{{ balance }}</td></tr>
-{% endfor %}
- </tbody>
-</table>
-{% endblock %}
diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html
index ad6cee9..76a7701 100644
--- a/budget/templates/list_bills.html
+++ b/budget/templates/list_bills.html
@@ -12,7 +12,7 @@
{% set balance = project.get_balance() %}
{% for member in project.active_members %}
<li class="{{ loop.cycle("even", "odd") }}">
- <span class="balance {% if balance[member] < 0 %}positive{% elif balance[member] > 0 %}negative{% endif %}">{{ balance[member] }}</span>
+ <span class="balance {% if balance[member] > 0 %}positive{% elif balance[member] < 0 %}negative{% endif %}">{{ balance[member] }}</span>
{{ member.name }}
<a class="remove" href="{{ url_for("remove_member", project_id=project.id, member_id=member.id) }}">delete</a></li>
{% endfor %}
@@ -44,9 +44,6 @@
</tbody>
</table>
- <a class="awesome large green button fleft" href="{{ url_for("compute_bills", project_id=project.id) }}">Compute bills</a>
- <p> Periodically (probably at the end of each month, you can compute the balance of each people, in order to reset all the debts. You can also let this "as-is" and try to find a good balance, that's up to you</p>
-
{% else %}
<p>Nothing to list yet. You probably want to <a href="{{ url_for("add_bill", project_id=project.id) }}">add a bill</a> ?</p>
{% endif %}
diff --git a/budget/web.py b/budget/web.py
index b98e764..24a034b 100644
--- a/budget/web.py
+++ b/budget/web.py
@@ -169,7 +169,7 @@ def add_bill(project):
db.session.add(form.save())
db.session.commit()
- flash("The bill have been added")
+ flash("The bill has been added")
return redirect(url_for('list_bills', project_id=project.id))
return render_template("add_bill.html", form=form, project=project)