Merge pull request #1643 from pretix/event_cancellation_giftcard_refund

Allow to issue gift card refunds when cancelling whole events
This commit is contained in:
Martin Gross
2020-04-15 13:00:41 +02:00
committed by GitHub
4 changed files with 19 additions and 2 deletions

View File

@@ -554,6 +554,12 @@ class EventCancelForm(forms.Form):
'manual refund to-do list. Do not check if you want to refund some of the orders by offsetting '
'with different orders or issuing gift cards.')
)
refund_as_giftcard = forms.BooleanField(
label=_('Refund order value to a gift card instead instead of the original payment method'),
widget=forms.CheckboxInput(attrs={'data-display-dependency': '#id_auto_refund'}),
initial=False,
required=False,
)
keep_fee_fixed = forms.DecimalField(
label=_("Keep a fixed cancellation fee"),
max_digits=10, decimal_places=2,

View File

@@ -34,6 +34,7 @@
<legend>{% trans "Refund options" %}</legend>
{% bootstrap_field form.auto_refund layout="control" %}
{% bootstrap_field form.manual_refund layout="control" %}
{% bootstrap_field form.refund_as_giftcard layout="control" %}
{% bootstrap_field form.keep_fee_fixed layout="control" %}
{% bootstrap_field form.keep_fee_percentage layout="control" %}
{% bootstrap_field form.keep_fees layout="control" %}
@@ -43,6 +44,13 @@
{% bootstrap_field form.send layout="control" %}
{% bootstrap_field form.send_subject layout="horizontal" %}
{% bootstrap_field form.send_message layout="horizontal" %}
<div class="alert alert-info" data-display-dependency="#id_refund_as_giftcard">
{% blocktrans trimmed %}
Since you are refunding your customers orders to gift cards, you should explain to them how to
access their giftcards. The easiest way to do this, is to include an explanation and a link to
their order using the here provided email functionality.
{% endblocktrans %}
</div>
</fieldset>
<fieldset>
<legend>{% trans "Waiting list" %}</legend>

View File

@@ -2017,6 +2017,8 @@ class EventCancel(EventPermissionRequiredMixin, AsyncAction, FormView):
self.request.event.pk,
subevent=form.cleaned_data['subevent'].pk if form.cleaned_data.get('subevent') else None,
auto_refund=form.cleaned_data.get('auto_refund'),
manual_refund=form.cleaned_data.get('manual_refund'),
refund_as_giftcard=form.cleaned_data.get('refund_as_giftcard'),
keep_fee_fixed=form.cleaned_data.get('keep_fee_fixed'),
keep_fee_percentage=form.cleaned_data.get('keep_fee_percentage'),
keep_fees=form.cleaned_data.get('keep_fees'),