From 26420ce28eb363071e9dc7de358b056743ba8aa4 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 24 May 2024 11:18:57 -0400 Subject: [PATCH] membershipworks: Add a model admin for event invoices --- membershipworks/admin.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/membershipworks/admin.py b/membershipworks/admin.py index d566371..ac11a26 100644 --- a/membershipworks/admin.py +++ b/membershipworks/admin.py @@ -115,6 +115,31 @@ class EventInstructorAdmin(admin.ModelAdmin): search_fields = ["name", "member__account_name"] +@admin.register(EventInvoice) +class EventInvoiceAdmin(admin.ModelAdmin): + model = EventInvoice + list_display = [ + "uuid", + "event", + "date_submitted", + "date_paid", + "amount", + ] + list_filter = [ + ("date_paid", admin.EmptyFieldListFilter), + ] + show_facets = admin.ShowFacets.ALWAYS + search_fields = [ + "uuid", + "event__eid", + "event__title", + "event__url", + "event__instructor__name", + "event__instructor__member__account_name", + ] + date_hierarchy = "date_submitted" + + class EventInvoiceInline(admin.StackedInline): model = EventInvoice