handed_out -> ticket_generated
This commit is contained in:
parent
b1b810f165
commit
cad3b21fc4
|
@ -13,7 +13,7 @@
|
||||||
Use this view to hand out badges to participants. Use the search field to search for username, email, products, order ID, ticket UUID, etc. To check in participants go to the <a href="{% url 'backoffice:ticket_checkin' camp_slug=camp.slug %}">Ticket Checkin view</a> instead. To hand out merchandise and other products go to the <a href="{% url 'backoffice:product_handout' camp_slug=camp.slug %}">Hand Out Products</a> view instead.
|
Use this view to hand out badges to participants. Use the search field to search for username, email, products, order ID, ticket UUID, etc. To check in participants go to the <a href="{% url 'backoffice:ticket_checkin' camp_slug=camp.slug %}">Ticket Checkin view</a> instead. To hand out merchandise and other products go to the <a href="{% url 'backoffice:product_handout' camp_slug=camp.slug %}">Hand Out Products</a> view instead.
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
This table shows all (Shop|Discount|Sponsor)Tickets which are badge_handed_out=False. Tickets must be checked in before they are shown in this list.
|
This table shows all (Shop|Discount|Sponsor)Tickets which are badge_ticket_generated=False. Tickets must be checked in before they are shown in this list.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
Use this view to hand out products to participants. Use the search field to search for username, email, products, order ID etc. To check in participants go to the <a href="{% url 'backoffice:ticket_checkin' camp_slug=camp.slug %}">Ticket Checkin view</a> instead. To hand out badges go to the <a href="{% url 'backoffice:badge_handout' camp_slug=camp.slug %}">Badge Handout view</a> instead.
|
Use this view to hand out products to participants. Use the search field to search for username, email, products, order ID etc. To check in participants go to the <a href="{% url 'backoffice:ticket_checkin' camp_slug=camp.slug %}">Ticket Checkin view</a> instead. To hand out badges go to the <a href="{% url 'backoffice:badge_handout' camp_slug=camp.slug %}">Badge Handout view</a> instead.
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
This table shows all OrderProductRelations which are handed_out=False (not including unpaid, cancelled and refunded orders). The table is initally sorted by order ID but the sorting can be changed by clicking the column headlines (if javascript is enabled).
|
This table shows all OrderProductRelations which are ticket_generated=False (not including unpaid, cancelled and refunded orders). The table is initally sorted by order ID but the sorting can be changed by clicking the column headlines (if javascript is enabled).
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -41,7 +41,7 @@ class ProductHandoutView(CampViewMixin, InfoTeamPermissionMixin, ListView):
|
||||||
|
|
||||||
def get_queryset(self, **kwargs):
|
def get_queryset(self, **kwargs):
|
||||||
return OrderProductRelation.objects.filter(
|
return OrderProductRelation.objects.filter(
|
||||||
handed_out=False,
|
ticket_generated=False,
|
||||||
order__paid=True,
|
order__paid=True,
|
||||||
order__refunded=False,
|
order__refunded=False,
|
||||||
order__cancelled=False,
|
order__cancelled=False,
|
||||||
|
@ -53,9 +53,9 @@ class BadgeHandoutView(CampViewMixin, InfoTeamPermissionMixin, ListView):
|
||||||
context_object_name = "tickets"
|
context_object_name = "tickets"
|
||||||
|
|
||||||
def get_queryset(self, **kwargs):
|
def get_queryset(self, **kwargs):
|
||||||
shoptickets = ShopTicket.objects.filter(badge_handed_out=False)
|
shoptickets = ShopTicket.objects.filter(badge_ticket_generated=False)
|
||||||
sponsortickets = SponsorTicket.objects.filter(badge_handed_out=False)
|
sponsortickets = SponsorTicket.objects.filter(badge_ticket_generated=False)
|
||||||
discounttickets = DiscountTicket.objects.filter(badge_handed_out=False)
|
discounttickets = DiscountTicket.objects.filter(badge_ticket_generated=False)
|
||||||
return list(chain(shoptickets, sponsortickets, discounttickets))
|
return list(chain(shoptickets, sponsortickets, discounttickets))
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ class MerchandiseOrdersView(CampViewMixin, OrgaTeamPermissionMixin, ListView):
|
||||||
|
|
||||||
return (
|
return (
|
||||||
OrderProductRelation.objects.filter(
|
OrderProductRelation.objects.filter(
|
||||||
handed_out=False,
|
ticket_generated=False,
|
||||||
order__paid=True,
|
order__paid=True,
|
||||||
order__refunded=False,
|
order__refunded=False,
|
||||||
order__cancelled=False,
|
order__cancelled=False,
|
||||||
|
@ -170,7 +170,7 @@ class MerchandiseToOrderView(CampViewMixin, OrgaTeamPermissionMixin, TemplateVie
|
||||||
camp_prefix = "BornHack {}".format(timezone.now().year)
|
camp_prefix = "BornHack {}".format(timezone.now().year)
|
||||||
|
|
||||||
order_relations = OrderProductRelation.objects.filter(
|
order_relations = OrderProductRelation.objects.filter(
|
||||||
handed_out=False,
|
ticket_generated=False,
|
||||||
order__paid=True,
|
order__paid=True,
|
||||||
order__refunded=False,
|
order__refunded=False,
|
||||||
order__cancelled=False,
|
order__cancelled=False,
|
||||||
|
@ -198,7 +198,7 @@ class VillageOrdersView(CampViewMixin, OrgaTeamPermissionMixin, ListView):
|
||||||
|
|
||||||
return (
|
return (
|
||||||
OrderProductRelation.objects.filter(
|
OrderProductRelation.objects.filter(
|
||||||
handed_out=False,
|
ticket_generated=False,
|
||||||
order__paid=True,
|
order__paid=True,
|
||||||
order__refunded=False,
|
order__refunded=False,
|
||||||
order__cancelled=False,
|
order__cancelled=False,
|
||||||
|
@ -216,7 +216,7 @@ class VillageToOrderView(CampViewMixin, OrgaTeamPermissionMixin, TemplateView):
|
||||||
camp_prefix = "BornHack {}".format(timezone.now().year)
|
camp_prefix = "BornHack {}".format(timezone.now().year)
|
||||||
|
|
||||||
order_relations = OrderProductRelation.objects.filter(
|
order_relations = OrderProductRelation.objects.filter(
|
||||||
handed_out=False,
|
ticket_generated=False,
|
||||||
order__paid=True,
|
order__paid=True,
|
||||||
order__refunded=False,
|
order__refunded=False,
|
||||||
order__cancelled=False,
|
order__cancelled=False,
|
||||||
|
|
|
@ -46,4 +46,4 @@ class OrderProductRelationFactory(DjangoModelFactory):
|
||||||
product = factory.SubFactory(ProductFactory)
|
product = factory.SubFactory(ProductFactory)
|
||||||
order = factory.SubFactory(OrderFactory)
|
order = factory.SubFactory(OrderFactory)
|
||||||
quantity = 1
|
quantity = 1
|
||||||
handed_out = False
|
ticket_generated = False
|
||||||
|
|
|
@ -289,35 +289,35 @@ class Order(CreatedUpdatedModel):
|
||||||
self.open = None
|
self.open = None
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def is_not_handed_out(self):
|
def is_not_ticket_generated(self):
|
||||||
if self.orderproductrelation_set.filter(handed_out=True).count() == 0:
|
if self.orderproductrelation_set.filter(tic=True).count() == 0:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def is_partially_handed_out(self):
|
def is_partially_ticket_generated(self):
|
||||||
if (
|
if (
|
||||||
self.orderproductrelation_set.filter(handed_out=True).count() != 0
|
self.orderproductrelation_set.filter(ticket_generated=True).count() != 0
|
||||||
and self.orderproductrelation_set.filter(handed_out=False).count() != 0
|
and self.orderproductrelation_set.filter(ticket_generated=False).count() != 0
|
||||||
):
|
):
|
||||||
# some products are handed out, others are not
|
# some products are handed out, others are not
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def is_fully_handed_out(self):
|
def is_fully_ticket_generated(self):
|
||||||
if self.orderproductrelation_set.filter(handed_out=False).count() == 0:
|
if self.orderproductrelation_set.filter(ticket_generated=False).count() == 0:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def handed_out_status(self):
|
def ticket_generated_status(self):
|
||||||
if self.is_not_handed_out():
|
if self.is_not_ticket_generated():
|
||||||
return "no"
|
return "no"
|
||||||
elif self.is_partially_handed_out():
|
elif self.is_partially_ticket_generated():
|
||||||
return "partially"
|
return "partially"
|
||||||
elif self.is_fully_handed_out():
|
elif self.is_fully_ticket_generated():
|
||||||
return "fully"
|
return "fully"
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
@ -473,7 +473,7 @@ class OrderProductRelation(CreatedUpdatedModel):
|
||||||
return Decimal(self.product.price * self.quantity)
|
return Decimal(self.product.price * self.quantity)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
if self.handed_out and not self.order.paid:
|
if self.ticket_generated and not self.order.paid:
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
"Product can not be handed out when order is not paid."
|
"Product can not be handed out when order is not paid."
|
||||||
)
|
)
|
||||||
|
|
|
@ -25,13 +25,13 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for order in orders %}
|
{% for order in orders %}
|
||||||
{% if order.products.exists %}
|
{% if order.products.exists %}
|
||||||
<tr {% if not order.open and order.paid and order.is_fully_handed_out %}style="color: lightgrey"{% endif %}>
|
<tr {% if not order.open and order.paid and order.is_fully_ticket_generated %}style="color: lightgrey"{% endif %}>
|
||||||
<td>{{ order.id }}</td>
|
<td>{{ order.id }}</td>
|
||||||
<td>{{ order.get_number_of_items }}</td>
|
<td>{{ order.get_number_of_items }}</td>
|
||||||
<td>{{ order.total|currency }}</td>
|
<td>{{ order.total|currency }}</td>
|
||||||
<td class="text-center">{{ order.open|truefalseicon }}</td>
|
<td class="text-center">{{ order.open|truefalseicon }}</td>
|
||||||
<td class="text-center">{{ order.paid|truefalseicon }}</td>
|
<td class="text-center">{{ order.paid|truefalseicon }}</td>
|
||||||
<td class="text-center">{{ order.handed_out_status }}</td>
|
<td class="text-center">{{ order.ticket_generated_status }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if order.paid %}
|
{% if order.paid %}
|
||||||
{% if order.invoice.pdf %}
|
{% if order.invoice.pdf %}
|
||||||
|
|
Loading…
Reference in a new issue