membershipworks: Add a model admin for event invoices
All checks were successful
Ruff / ruff (push) Successful in 30s
Test / test (push) Successful in 4m13s

This commit is contained in:
Adam Goldsmith 2024-05-24 11:18:57 -04:00
parent c03c5ff2f0
commit 26420ce28e

View File

@ -115,6 +115,31 @@ class EventInstructorAdmin(admin.ModelAdmin):
search_fields = ["name", "member__account_name"] 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): class EventInvoiceInline(admin.StackedInline):
model = EventInvoice model = EventInvoice