mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Added voucher redemption
This commit is contained in:
@@ -85,6 +85,12 @@
|
||||
{% if line.variation %}
|
||||
– {{ line.variation }}
|
||||
{% endif %}
|
||||
{% if line.voucher %}
|
||||
<br /><span class="fa fa-ticket"></span> {% trans "Voucher code used:" %}
|
||||
<a href="{% url "control:event.voucher" event=request.event.slug organizer=request.event.organizer.slug voucher=line.voucher.pk %}">
|
||||
{{ line.voucher.code }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if line.has_questions %}
|
||||
<dl>
|
||||
{% if line.item.admission and event.settings.attendee_names_asked %}
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
{% block title %}{% trans "Voucher" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Voucher" %}</h1>
|
||||
{% if voucher.redeemed %}
|
||||
<div class="alert alert-warning">
|
||||
{% trans "This voucher already has been used. It is not recommended to modify it." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form_errors form %}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<strong><a href="
|
||||
{% url "control:event.voucher" organizer=request.event.organizer.slug event=request.event.slug voucher=v.id %}">{{ v.code }}</a></strong>
|
||||
</td>
|
||||
<td>{% if v.is_ordered %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</td>
|
||||
<td>{% if v.redeemed %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</td>
|
||||
<td>{{ v.valid_until|date }}</td>
|
||||
<td>{{ v.item }}</td>
|
||||
<td class="text-right">
|
||||
|
||||
@@ -135,8 +135,8 @@ class OrderDetail(OrderView):
|
||||
def keyfunc(pos):
|
||||
if (pos.item.admission and self.request.event.settings.attendee_names_asked) \
|
||||
or pos.item.questions.all():
|
||||
return pos.id, 0, 0, 0
|
||||
return 0, pos.item_id, pos.variation_id, pos.price
|
||||
return pos.id, 0, 0, 0, None
|
||||
return 0, pos.item_id, pos.variation_id, pos.price, pos.voucher
|
||||
|
||||
positions = []
|
||||
for k, g in groupby(sorted(list(cartpos), key=keyfunc), key=keyfunc):
|
||||
|
||||
Reference in New Issue
Block a user