More distinction for monthly payments

This commit is contained in:
Drew DeVault 2016-07-04 16:37:52 -04:00
parent fd281f3eaf
commit 1ea97dc898
2 changed files with 10 additions and 10 deletions

View File

@ -61,8 +61,10 @@ def admin():
donations=donations,
one_times=lambda p: sum([d.amount for d in p.donations if d.type == DonationType.one_time]),
recurring=lambda p: sum([d.amount for d in p.donations if d.type == DonationType.monthly and d.active]),
recurring_ever=lambda p: sum([d.amount * d.payments for d in p.donations if d.type == DonationType.monthly]),
unspecified_one_times=sum([d.amount for d in unspecified if d.type == DonationType.one_time]),
unspecified_recurring=sum([d.amount for d in unspecified if d.type == DonationType.monthly and d.active]),
unspecified_recurring_ever=sum([d.amount * d.payments for d in unspecified if d.type == DonationType.monthly]),
total_one_time=sum([d.amount for d in Donation.query.filter(Donation.type == DonationType.one_time)]),
total_recurring=sum([d.amount for d in Donation.query.filter(Donation.type == DonationType.monthly, Donation.active == True)]),
total_recurring_ever=sum([d.amount * d.payments for d in Donation.query.filter(Donation.type == DonationType.monthly)]),

View File

@ -49,14 +49,15 @@
{% endif %}
<h2>Projects</h2>
<div class="row">
<div class="col-md-6">
<div class="col-md-9">
<table class="table">
<thead>
<tr>
<th style="width: 10%"></th>
<th>Project Name</th>
<th>One-time</th>
<th>Recurring</th>
<th>Recurring (active)</th>
<th>Recurring (total paid)</th>
</tr>
</thead>
<tbody>
@ -66,6 +67,7 @@
<td>{{ project.name }}</td>
<td>${{ "{:.2f}".format(one_times(project) / 100) }}</td>
<td>${{ "{:.2f}".format(recurring(project) / 100) }}</td>
<td>${{ "{:.2f}".format(recurring_ever(project) / 100) }}</td>
</tr>
{% endfor %}
<tr>
@ -73,23 +75,19 @@
<td>(not specified)</td>
<td>${{ "{:.2f}".format(unspecified_one_times / 100) }}</td>
<td>${{ "{:.2f}".format(unspecified_recurring / 100) }}</td>
<td>${{ "{:.2f}".format(unspecified_recurring_ever / 100) }}</td>
</tr>
<tr>
<td></td>
<td><strong>Total</strong></td>
<td>${{ "{:.2f}".format(total_one_time / 100) }}</td>
<td>${{ "{:.2f}".format(total_recurring / 100) }} (active)</td>
</tr>
<tr>
<td></td>
<td><strong>Total</strong></td>
<td></td>
<td>${{ "{:.2f}".format(total_recurring_ever / 100) }} (paid)</td>
<td>${{ "{:.2f}".format(total_recurring / 100) }}</td>
<td>${{ "{:.2f}".format(total_recurring_ever / 100) }}</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6 well">
<div class="col-md-3 well">
<h4>Add Project</h4>
<p>Donors will not be given a choice of project unless you have at least 2.</p>
<form method="POST" action="{{root}}/create-project">