mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-28 06:12:37 +02:00
Add payments table page
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -496,6 +496,24 @@ class VolunteerRegistration(Registration):
|
||||
'content': content,
|
||||
})
|
||||
|
||||
payments = Payment.objects.filter(registrations__team__participation__tournament=tournament).all()
|
||||
valid = payments.filter(valid=True).count()
|
||||
pending = payments.filter(valid=None).count()
|
||||
invalid = payments.filter(valid=False).count()
|
||||
if pending + invalid > 0:
|
||||
text = _("There are {valid} validated payments, {pending} pending and {invalid} invalid for the "
|
||||
"tournament of {tournament}. You can check the status of the payments on the "
|
||||
"<a href=\"{url}\">payments list</a>.")
|
||||
url = reverse_lazy("participation:tournament_payments", args=(tournament.id,))
|
||||
content = format_lazy(text, valid=valid, pending=pending, invalid=invalid, tournament=tournament.name,
|
||||
url=url)
|
||||
informations.append({
|
||||
'title': _("Payments"),
|
||||
'type': "info",
|
||||
'priority': 5,
|
||||
'content': content,
|
||||
})
|
||||
|
||||
return informations
|
||||
|
||||
class Meta:
|
||||
|
Reference in New Issue
Block a user