diff --git a/fosspay/blueprints/html.py b/fosspay/blueprints/html.py index 0daecb6..3522546 100644 --- a/fosspay/blueprints/html.py +++ b/fosspay/blueprints/html.py @@ -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"]) diff --git a/templates/admin.html b/templates/admin.html index 7ebb5ef..17b2813 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -78,7 +78,13 @@ Total ${{ "{:.2f}".format(total_one_time / 100) }} - ${{ "{:.2f}".format(total_recurring / 100) }} + ${{ "{:.2f}".format(total_recurring / 100) }} (active) + + + + Total + + ${{ "{:.2f}".format(total_recurring_ever / 100) }} (paid)