summaryrefslogtreecommitdiff
path: root/postgresqleu/views.py
diff options
context:
space:
mode:
authorMagnus Hagander2020-03-27 17:37:24 +0000
committerMagnus Hagander2020-03-27 17:37:24 +0000
commit62c52511330b4edf6edf93c29282b660929e4f46 (patch)
tree1c75e3ea451a80361d6ef91f519f4a5bebdddaea /postgresqleu/views.py
parentc7330736f883fe7bf3affa9c9ef5bfcc25916a6d (diff)
Add an administrative view of refunds
While refunds could be viewed on the individual invoice that was refunded, it's useful to also have a global view of refunds on the admin page (which links to the invoices as necessary). Button on the frontpage will be highlighted if there are any refunds that are in pendning state (either waiting for us to issue them or waiting for completion).
Diffstat (limited to 'postgresqleu/views.py')
-rw-r--r--postgresqleu/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/postgresqleu/views.py b/postgresqleu/views.py
index 966a2415..317cb1d7 100644
--- a/postgresqleu/views.py
+++ b/postgresqleu/views.py
@@ -8,6 +8,7 @@ from django.conf import settings
from postgresqleu.newsevents.models import News
from postgresqleu.confreg.models import Conference, ConferenceSeries
from postgresqleu.invoices.models import PendingBankTransaction, BankFileUpload, InvoicePaymentMethod
+from postgresqleu.invoices.models import InvoiceRefund
from postgresqleu.util.db import exec_to_dict, conditional_exec_to_scalar
@@ -141,6 +142,7 @@ def admin_dashboard(request):
if permissions['invoices']:
pending_bank = PendingBankTransaction.objects.all().exists()
+ pending_refunds = InvoiceRefund.objects.filter(completed__isnull=True).exists()
ipm = list(InvoicePaymentMethod.objects.filter(active=True, config__has_key='file_upload_interval'))
if ipm:
# At least one payment method exists that *should* get uploads checked
@@ -164,6 +166,7 @@ def admin_dashboard(request):
return render(request, 'adm/index.html', {
'permissions': permissions,
'pending_bank': pending_bank,
+ 'pending_refunds': pending_refunds,
'bank_file_uploads': bank_file_uploads,
'schedalert': conditional_exec_to_scalar(request.user.is_superuser, "SELECT NOT EXISTS (SELECT 1 FROM pg_stat_activity WHERE application_name='pgeu scheduled job runner' AND datname=current_database())"),
'mailqueuealert': conditional_exec_to_scalar(request.user.is_superuser, "SELECT EXISTS (SELECT 1 FROM mailqueue_queuedmail LIMIT 1)"),