Show more information about pending registrations
authorMagnus Hagander <magnus@hagander.net>
Mon, 7 Jul 2025 10:18:34 +0000 (12:18 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 7 Jul 2025 10:20:02 +0000 (12:20 +0200)
In particular, make it possible to show the bulk payment invoice
directly from the registration page, if one exists.

postgresqleu/confreg/models.py
template/confreg/admin_registration_single.html

index 039efbf84418808822fed25e632881293a010de8..4819e7406b73dc02033da79372d9695bb2796bcb 100644 (file)
@@ -590,7 +590,10 @@ class BulkPayment(models.Model):
     @property
     def payment_method_description(self):
         if not self.paidat:
-            return "not paid."
+            if self.invoice:
+                return "not paid (invoice #{}).".format(self.invoice.id)
+            else:
+                return "not paid."
         if self.invoice:
             if self.invoice.paidat:
                 return "paid with invoice #{0}.\nInvoice {1}".format(self.invoice.id, self.invoice.payment_method_description)
@@ -794,7 +797,15 @@ class ConferenceRegistration(models.Model):
     @property
     def payment_method_description(self):
         if not self.payconfirmedat:
-            return "Not paid."
+            if self.invoice:
+                return "not paid (invoice #{}).".format(self.invoice.id)
+            elif self.bulkpayment:
+                if self.bulkpayment.invoice:
+                    return "not paid (bulk payment invoice #{}).".format(self.bulkpayment.invoice.id)
+                else:
+                    return "not paid (bulk payment {}, no invoice yet).".format(self.bulkpayment.id)
+            else:
+                return "Not paid."
         if self.payconfirmedby == "no payment reqd":
             return "Registration does not require payment."
         if self.payconfirmedby == "Multireg/nopay":
index 8530f659bbd8ff5f6fcca18ae3f1ae520011ccd8..2ebf916185ec14e92b23530eefe5d88dd204eb3d 100644 (file)
   <td>{{reg.payment_method_description|linebreaksbr}}
 {%if reg.invoice %}
     <a class="pull-right btn btn-default btn-sm" href="/invoiceadmin/{{reg.invoice.id}}/">View invoice</a>
+{%elif reg.bulkpayment and reg.bulkpayment.invoice %}
+    <a class="pull-right btn btn-default btn-sm" href="/invoiceadmin/{{reg.bulkpayment.invoice.id}}/">View bulk payment invoice</a>
 {%endif%}
   </td>
  </tr>