Display self-service cancellation fee during backend cancellation

This commit is contained in:
Raphael Michel
2022-04-04 13:42:26 +02:00
parent cccd4af6dd
commit 65a7e8516e
2 changed files with 13 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load money %}
{% block title %}
{% trans "Cancel order" %}
{% endblock %}
@@ -22,13 +23,21 @@
{% csrf_token %}
<input type="hidden" name="status" value="c"/>
{% bootstrap_form_errors form %}
{% if form.cancellation_fee %}
{% if fee %}
{% with fee|money:request.event.currency as f %}
<p>{% blocktrans trimmed with fee="<strong>"|add:f|add:"</strong>"|safe %}
The configured cancellation fee for a self-service cancellation would be {{ fee }} for this
order, but for a cancellation performed by you, you need to set the cancellation fee here:
{% endblocktrans %}</p>
{% endwith %}
{% endif %}
{% bootstrap_field form.cancellation_fee layout='' %}
{% endif %}
{% bootstrap_field form.send_email layout='' %}
{% if form.cancel_invoice %}
{% bootstrap_field form.cancel_invoice layout='' %}
{% endif %}
{% if form.cancellation_fee %}
{% bootstrap_field form.cancellation_fee layout='' %}
{% endif %}
<div class="row checkout-button-row">
<div class="col-md-4">
<a class="btn btn-block btn-default btn-lg"

View File

@@ -1303,6 +1303,7 @@ class OrderTransition(OrderView):
elif self.order.cancel_allowed() and to == 'c':
return render(self.request, 'pretixcontrol/order/cancel.html', {
'form': self.mark_canceled_form,
'fee': self.order.user_cancel_fee,
'order': self.order,
})
else: