forked from CGM_Public/pretix_original
Refactor cancelling positions and orders in the data model (#1088)
- [x] Data model - [x] display in order view in backend - [x] review all usages of OrderPositions.objects - [x] review all usages of order.positions - [x] review all other model usages - [x] review plugins - [x] plugins backwards-compatible API? - [x] decide on way forward for REST API - [x] need to cancel fees - [x] tests - [ ] plugins - [ ] gdpr - [ ] reports - [x] docs
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
<option value="e" {% if request.GET.status == "e" %}selected="selected"{% endif %}>{% trans "Expired" %}</option>
|
||||
<option value="ne" {% if request.GET.status == "ne" %}selected="selected"{% endif %}>{% trans "Pending or expired" %}</option>
|
||||
<option value="c" {% if request.GET.status == "c" %}selected="selected"{% endif %}>{% trans "Canceled" %}</option>
|
||||
<option value="r" {% if request.GET.status == "r" %}selected="selected"{% endif %}>{% trans "Refunded" %}</option>
|
||||
</select>
|
||||
<select name="item" class="form-control">
|
||||
<option value="">{% trans "All products" %}</option>
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
<p>{% blocktrans trimmed %}
|
||||
Do you really want to cancel this order? You cannot revert this action.
|
||||
{% endblocktrans %}</p>
|
||||
{% if order.payment_refund_sum > 0 %}
|
||||
<p>{% blocktrans trimmed %}
|
||||
This will <strong>not</strong> automatically transfer the money back, but you will be offered options to
|
||||
refund the payment afterwards.
|
||||
{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" href="">
|
||||
{% csrf_token %}
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
<label>
|
||||
<input name="{{ position.form.prefix }}-operation" type="radio" value="cancel"
|
||||
{% if position.form.operation.value == "cancel" %}checked="checked"{% endif %}>
|
||||
{% trans "Remove from order" %}
|
||||
{% trans "Cancel position" %}
|
||||
{% if position.addons.exists %}
|
||||
<em class="text-danger">
|
||||
{% trans "Removing this position will also remove all add-ons to this position." %}
|
||||
|
||||
@@ -50,11 +50,6 @@
|
||||
{% trans "Cancel order" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if order.payment_refund_sum > 0 %}
|
||||
<a href="{% url "control:event.order.refunds.start" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}" class="btn btn-default">
|
||||
{% trans "Create a refund" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<a href="{% eventurl request.event "presale:event.order" order=order.code secret=order.secret %}"
|
||||
@@ -171,11 +166,11 @@
|
||||
action="{% url "control:event.order.reissueinvoice" event=request.event.slug organizer=request.event.organizer.slug code=order.code id=i.pk %}">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-default btn-xs"
|
||||
{% if order.status != "r" and order.status != "c" %}
|
||||
{% if order.status != "c" %}
|
||||
data-toggle="tooltip"
|
||||
title="{% trans 'Generate a cancellation document for this invoice and create a new invoice with a new invoice number.' %}"
|
||||
{% endif %}>
|
||||
{% if order.status == "r" or order.status == "c" %}
|
||||
{% if order.status == "c" %}
|
||||
{% trans "Generate cancellation" %}
|
||||
{% else %}
|
||||
{% trans "Cancel and reissue" %}
|
||||
@@ -234,7 +229,7 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{% for line in items.positions %}
|
||||
<div class="row-fluid product-row">
|
||||
<div class="row-fluid product-row {% if line.canceled %}pos-canceled{% endif %}">
|
||||
<div class="col-md-9 col-xs-6">
|
||||
{% if line.addon_to %}
|
||||
<span class="addon-signifier">+</span>
|
||||
@@ -260,24 +255,26 @@
|
||||
<br/>
|
||||
<span class="fa fa-calendar"></span> {{ line.subevent.name }} · {{ line.subevent.get_date_range_display }}
|
||||
{% endif %}
|
||||
<div class="position-buttons">
|
||||
{% if not line.addon_to or request.event.settings.ticket_download_addons %}
|
||||
{% if line.item.admission or request.event.settings.ticket_download_nonadm %}
|
||||
{% for b in download_buttons %}
|
||||
<form action="{% url "control:event.order.download.ticket" code=order.code event=request.event.slug organizer=request.event.organizer.slug position=line.pk output=b.identifier %}"
|
||||
method="post" data-asynctask data-asynctask-download
|
||||
class="form-inline helper-display-inline">
|
||||
{% csrf_token %}
|
||||
<button type="submit"
|
||||
class="btn btn-xs btn-default">
|
||||
<span class="fa {{ b.icon }}"></span> {{ b.text }}
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% if not line.canceled %}
|
||||
<div class="position-buttons">
|
||||
{% if not line.addon_to or request.event.settings.ticket_download_addons %}
|
||||
{% if line.item.admission or request.event.settings.ticket_download_nonadm %}
|
||||
{% for b in download_buttons %}
|
||||
<form action="{% url "control:event.order.download.ticket" code=order.code event=request.event.slug organizer=request.event.organizer.slug position=line.pk output=b.identifier %}"
|
||||
method="post" data-asynctask data-asynctask-download
|
||||
class="form-inline helper-display-inline">
|
||||
{% csrf_token %}
|
||||
<button type="submit"
|
||||
class="btn btn-xs btn-default">
|
||||
<span class="fa {{ b.icon }}"></span> {{ b.text }}
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% eventsignal event "pretix.control.signals.order_position_buttons" order=order position=line request=request %}
|
||||
</div>
|
||||
{% eventsignal event "pretix.control.signals.order_position_buttons" order=order position=line request=request %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if line.has_questions %}
|
||||
<dl>
|
||||
{% if line.item.admission and event.settings.attendee_names_asked %}
|
||||
@@ -486,6 +483,11 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if order.payment_refund_sum > 0 %}
|
||||
<a href="{% url "control:event.order.refunds.start" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}" class="btn btn-default">
|
||||
{% trans "Create a refund" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
<span class="label label-warning {{ class }}">{% trans "Pending" %}</span>
|
||||
{% endif %}
|
||||
{% elif order.status == "p" %}
|
||||
<span class="label label-success {{ class }}">{% trans "Paid" %}</span>
|
||||
{% if order.count_positions == 0 %}
|
||||
<span class="label label-info {{ class }}">{% trans "Canceled (paid fee)" %}</span>
|
||||
{% else %}
|
||||
<span class="label label-success {{ class }}">{% trans "Paid" %}</span>
|
||||
{% endif %}
|
||||
{% elif order.status == "e" %} {# expired #}
|
||||
<span class="label label-danger {{ class }}">{% trans "Expired" %}</span>
|
||||
{% elif order.status == "c" %}
|
||||
<span class="label label-danger {{ class }}">{% trans "Canceled" %}</span>
|
||||
{% elif order.status == "r" %}
|
||||
<span class="label label-danger {{ class }}">{% trans "Refunded" %}</span>
|
||||
{% endif %}
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
{% endif %}
|
||||
{{ o.total|money:request.event.currency }}
|
||||
</td>
|
||||
<td class="text-right">{{ o.pcnt }}</td>
|
||||
<td class="text-right">{{ o.pcnt|default_if_none:"0" }}</td>
|
||||
<td class="text-right">{% include "pretixcontrol/orders/fragment_order_status.html" with order=o %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Product" %}</th>
|
||||
<th>{% trans "Canceled" %}</th>
|
||||
<th>{% trans "Refunded" %}</th>
|
||||
<th>{% trans "Canceled" %}¹</th>
|
||||
<th>{% trans "Expired" %}</th>
|
||||
<th colspan="3">{% trans "Purchased" %}</th>
|
||||
</tr>
|
||||
@@ -39,7 +38,6 @@
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>{% trans "Pending" %}</th>
|
||||
<th>{% trans "Paid" %}</th>
|
||||
<th>{% trans "Total" %}</th>
|
||||
@@ -51,7 +49,6 @@
|
||||
<tr class="category">
|
||||
<th>{{ tup.0 }}</th>
|
||||
<th>{{ tup.0.num.canceled|togglesum:request.event.currency }}</th>
|
||||
<th>{{ tup.0.num.refunded|togglesum:request.event.currency }}</th>
|
||||
<th>{{ tup.0.num.expired|togglesum:request.event.currency }}</th>
|
||||
<th>{{ tup.0.num.pending|togglesum:request.event.currency }}</th>
|
||||
<th>{{ tup.0.num.paid|togglesum:request.event.currency }}</th>
|
||||
@@ -66,11 +63,6 @@
|
||||
{{ item.num.canceled|togglesum:request.event.currency }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ listurl }}?item={{ item.id }}&status=r&provider={{ item.provider }}">
|
||||
{{ item.num.refunded|togglesum:request.event.currency }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ listurl }}?item={{ item.id }}&status=e&provider={{ item.provider }}">
|
||||
{{ item.num.expired|togglesum:request.event.currency }}
|
||||
@@ -95,7 +87,6 @@
|
||||
<tr class="variation {% if tup.0 %}categorized{% endif %}">
|
||||
<td>{{ var }}</td>
|
||||
<td>{{ var.num.canceled|togglesum:request.event.currency }}</td>
|
||||
<td>{{ var.num.refunded|togglesum:request.event.currency }}</td>
|
||||
<td>{{ var.num.expired|togglesum:request.event.currency }}</td>
|
||||
<td>{{ var.num.pending|togglesum:request.event.currency }}</td>
|
||||
<td>{{ var.num.paid|togglesum:request.event.currency }}</td>
|
||||
@@ -110,7 +101,6 @@
|
||||
<tr class="total">
|
||||
<th>{% trans "Total" %}</th>
|
||||
<th>{{ total.num.canceled|togglesum:request.event.currency }}</th>
|
||||
<th>{{ total.num.refunded|togglesum:request.event.currency }}</th>
|
||||
<th>{{ total.num.expired|togglesum:request.event.currency }}</th>
|
||||
<th>{{ total.num.pending|togglesum:request.event.currency }}</th>
|
||||
<th>{{ total.num.paid|togglesum:request.event.currency }}</th>
|
||||
@@ -119,4 +109,7 @@
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<p class="help-block">
|
||||
¹ {% trans "If you click links in this column, you will only find orders that are canceled completely, while the numbers also include single canceled positions within valid orders." %}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user