Fix sort of payments and refunds.
Now sorted by reverse date and reverse id for same date.
This commit is contained in:
parent
6cffd58a8d
commit
37988b7a91
1 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ from refunding.models import Payment, Refund
|
|||
|
||||
@login_required
|
||||
def latest_refunds(request):
|
||||
refunds = Refund.objects.all().order_by('-date')[:20]
|
||||
refunds = Refund.objects.all().order_by('-date', '-id')[:20]
|
||||
context = {
|
||||
'refunds': refunds,
|
||||
'default_nothing': 'No refund to show.'
|
||||
|
@ -89,7 +89,7 @@ def refund_delete(request, pk):
|
|||
|
||||
@login_required
|
||||
def not_refunded_payments(request):
|
||||
payments = Payment.objects.filter(refund=None).order_by('-date')
|
||||
payments = Payment.objects.filter(refund=None).order_by('-date', '-id')
|
||||
value_sum = payments.aggregate(Sum('value')).get('value__sum')
|
||||
if value_sum:
|
||||
value_sum /= 100
|
||||
|
|
Loading…
Reference in a new issue