Merge pull request #378 from flokli/shopticket-backoffice-quantity
Show Quantity of ShopTickets in backoffice
This commit is contained in:
commit
66c2224806
|
@ -56,6 +56,13 @@
|
||||||
<strong>Product:</strong>
|
<strong>Product:</strong>
|
||||||
<td>
|
<td>
|
||||||
{{ ticket.product }}
|
{{ ticket.product }}
|
||||||
|
{% if ticket.ticket_type.single_ticket_per_product and ticket.shortname == "shop" %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>Quantity:</strong>
|
||||||
|
<td>
|
||||||
|
{{ ticket.orp.quantity }}
|
||||||
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<strong>Order:</strong>
|
<strong>Order:</strong>
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<td>
|
<td>
|
||||||
{{ ticket.product.name }}
|
{{ ticket.product.name }}
|
||||||
<td>
|
<td>
|
||||||
{% 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 }}
|
{{ ticket.product.price|currency }}
|
||||||
<td>
|
<td>
|
||||||
{% if ticket.used %}
|
{% if ticket.used %}
|
||||||
|
|
|
@ -93,8 +93,7 @@ class BaseTicket(CampRelatedModel, UUIDModel):
|
||||||
formatdict = {"ticket": self}
|
formatdict = {"ticket": self}
|
||||||
|
|
||||||
if self.ticket_type.single_ticket_per_product and self.shortname == "shop":
|
if self.ticket_type.single_ticket_per_product and self.shortname == "shop":
|
||||||
orp = self.get_orp()
|
formatdict["quantity"] = self.orp.quantity
|
||||||
formatdict["quantity"] = orp.quantity
|
|
||||||
|
|
||||||
return generate_pdf_letter(
|
return generate_pdf_letter(
|
||||||
filename="{}_ticket_{}.pdf".format(self.shortname, self.pk),
|
filename="{}_ticket_{}.pdf".format(self.shortname, self.pk),
|
||||||
|
@ -165,5 +164,6 @@ class ShopTicket(BaseTicket):
|
||||||
def shortname(self):
|
def shortname(self):
|
||||||
return "shop"
|
return "shop"
|
||||||
|
|
||||||
def get_orp(self):
|
@property
|
||||||
|
def orp(self):
|
||||||
return OrderProductRelation.objects.get(product=self.product, order=self.order)
|
return OrderProductRelation.objects.get(product=self.product, order=self.order)
|
||||||
|
|
Loading…
Reference in a new issue