diff --git a/src/backoffice/templates/info_desk/scan.html b/src/backoffice/templates/info_desk/scan.html
index 351a8ee2..7a15b2dc 100644
--- a/src/backoffice/templates/info_desk/scan.html
+++ b/src/backoffice/templates/info_desk/scan.html
@@ -56,6 +56,13 @@
Product:
{{ ticket.product }}
+ {% if ticket.ticket_type.single_ticket_per_product and ticket.shortname == "shop" %}
+ |
+
+ Quantity:
+ |
+ {{ ticket.orp.quantity }}
+ {% endif %}
|
Order:
diff --git a/src/profiles/templates/tickets/ticket_list.html b/src/profiles/templates/tickets/ticket_list.html
index 2dc6d6b4..807be910 100644
--- a/src/profiles/templates/tickets/ticket_list.html
+++ b/src/profiles/templates/tickets/ticket_list.html
@@ -40,7 +40,7 @@
|
{{ ticket.product.name }}
|
- {% if ticket.ticket_type.single_ticket_per_product %}{{ ticket.get_orp.quantity }} × {% endif %}
+ {% if ticket.ticket_type.single_ticket_per_product %}{{ ticket.orp.quantity }} × {% endif %}
{{ ticket.product.price|currency }}
|
{% if ticket.used %}
diff --git a/src/tickets/models.py b/src/tickets/models.py
index d72d5662..5580cda3 100644
--- a/src/tickets/models.py
+++ b/src/tickets/models.py
@@ -93,8 +93,7 @@ class BaseTicket(CampRelatedModel, UUIDModel):
formatdict = {"ticket": self}
if self.ticket_type.single_ticket_per_product and self.shortname == "shop":
- orp = self.get_orp()
- formatdict["quantity"] = orp.quantity
+ formatdict["quantity"] = self.orp.quantity
return generate_pdf_letter(
filename="{}_ticket_{}.pdf".format(self.shortname, self.pk),
@@ -165,5 +164,6 @@ class ShopTicket(BaseTicket):
def shortname(self):
return "shop"
- def get_orp(self):
+ @property
+ def orp(self):
return OrderProductRelation.objects.get(product=self.product, order=self.order)
|