exclude uncollectable pledges

pull/1/head
Andromeda Yelton 2012-12-06 15:31:32 -05:00
parent 150ed860c9
commit 23708e15ba
2 changed files with 2 additions and 1 deletions

View File

@ -95,6 +95,7 @@
<h2>Pledges</h2>
<dl>
<dt>How much has been pledged to Unglue.it?</dt>
<p>Excludes pledges canceled, failed, or otherwise uncollectable.</p>
<dd>
<ul class="terms">
<li>{{ transactions.today.count }} pledges have been made today totaling ${% if transactions.today.sum %}{{ transactions.today.sum }}{% else %}0{% endif %}.

View File

@ -1599,7 +1599,7 @@ class InfoPageView(TemplateView):
else:
wishlists.yesterday = wishlists.month.filter(created__day = date_today().day-1)
transactions = Transaction.objects
transactions = Transaction.objects.all().exclude(status__in=['Error', 'Canceled', 'Refunded', 'Failed', 'Written-Off'])
transactions.sum = transactions.aggregate(Sum('amount'))['amount__sum']
transactions.today = transactions.filter(date_created__range = (date_today(), now()))
transactions.today.sum = transactions.today.aggregate(Sum('amount'))['amount__sum']