2016-06-04 01:49:24 +02:00
|
|
|
from django.contrib.auth.decorators import login_required
|
|
|
|
from django.db.models import Sum
|
2016-06-03 20:17:22 +02:00
|
|
|
from django.shortcuts import render
|
2016-06-04 01:49:24 +02:00
|
|
|
from refunding.models import Payment
|
2016-06-03 20:17:22 +02:00
|
|
|
|
2016-06-04 01:49:24 +02:00
|
|
|
|
|
|
|
@login_required
|
|
|
|
def not_refunded_payments(request):
|
|
|
|
payments = Payment.objects.filter(refund=None)
|
|
|
|
sum = payments.aggregate(Sum('value')).get('value__sum') / 100
|
|
|
|
context = {
|
|
|
|
'payments': payments,
|
|
|
|
'sum': sum,
|
|
|
|
'default_nothing': 'No payment to be refunded.'
|
|
|
|
}
|
|
|
|
return render(request, "refunding/payments_list.html", context)
|