Add more recurring info to UI

master
Drew DeVault 9 years ago
parent 35cd5cdb9e
commit fd281f3eaf
  1. 7
      fosspay/blueprints/html.py
  2. 8
      templates/admin.html

@ -60,11 +60,12 @@ def admin():
projects=projects,
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]),
recurring=lambda p: sum([d.amount for d in p.donations if d.type == DonationType.monthly and d.active]),
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]),
unspecified_recurring=sum([d.amount for d in unspecified if d.type == DonationType.monthly and d.active]),
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)]),
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)]),
)
@html.route("/create-project", methods=["POST"])

@ -78,7 +78,13 @@
<td></td>
<td><strong>Total</strong></td>
<td>${{ "{:.2f}".format(total_one_time / 100) }}</td>
<td>${{ "{:.2f}".format(total_recurring / 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>
</tr>
</tbody>
</table>

Loading…
Cancel
Save