Allow to hide cancellation fee from end-user in approval flow (#2735)

Co-authored-by: Richard Schreiber <wiffbi@gmail.com>
This commit is contained in:
Raphael Michel
2022-07-25 18:58:25 +02:00
committed by GitHub
parent c90cb1f19c
commit 94900cd386
6 changed files with 55 additions and 7 deletions

View File

@@ -762,6 +762,7 @@ class EventSettingsSerializer(SettingsSerializer):
'cancel_allow_user_paid_adjust_fees_step',
'cancel_allow_user_paid_refund_as_giftcard',
'cancel_allow_user_paid_require_approval',
'cancel_allow_user_paid_require_approval_fee_unknown',
'change_allow_user_variation',
'change_allow_user_addons',
'change_allow_user_until',

View File

@@ -1514,6 +1514,15 @@ DEFAULTS = {
"before the order is canceled and a refund is issued."),
)
},
'cancel_allow_user_paid_require_approval_fee_unknown': {
'default': 'False',
'type': bool,
'form_class': forms.BooleanField,
'serializer_class': serializers.BooleanField,
'form_kwargs': dict(
label=_("Do not show the cancellation fee to users when they request cancellation."),
)
},
'cancel_allow_user_paid_refund_as_giftcard': {
'default': 'off',
'type': str,

View File

@@ -674,6 +674,7 @@ class CancelSettingsForm(SettingsForm):
'cancel_allow_user_paid_adjust_fees_step',
'cancel_allow_user_paid_refund_as_giftcard',
'cancel_allow_user_paid_require_approval',
'cancel_allow_user_paid_require_approval_fee_unknown',
'change_allow_user_variation',
'change_allow_user_price',
'change_allow_user_until',

View File

@@ -16,6 +16,9 @@
<legend>{% trans "Paid orders" %}</legend>
{% bootstrap_field form.cancel_allow_user_paid layout="control" %}
{% bootstrap_field form.cancel_allow_user_paid_require_approval layout="control" %}
<div data-display-dependency="#id_cancel_allow_user_paid_require_approval">
{% bootstrap_field form.cancel_allow_user_paid_require_approval_fee_unknown layout="control" %}
</div>
{% bootstrap_field form.cancel_allow_user_paid_keep layout="control" %}
{% bootstrap_field form.cancel_allow_user_paid_keep_percentage layout="control" %}
{% bootstrap_field form.cancel_allow_user_paid_keep_fees layout="control" %}

View File

@@ -373,7 +373,26 @@
{% if user_cancel_allowed %}
<li class="list-group-item">
{% if order.status == "p" and order.total != 0 %}
{% if order.user_cancel_fee >= order.total %}
{% if request.event.settings.cancel_allow_user_paid_require_approval and request.event.settings.cancel_allow_user_paid_require_approval_fee_unknown %}
<p>
{% blocktrans trimmed %}
You can request to cancel this order.
{% endblocktrans %}
{% blocktrans trimmed %}
If your request is approved, the organizer will determine if you will receive a
full refund or if a cancellation fee is deducted according to their cancellation
policy.
{% endblocktrans %}
{% if request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "force" %}
{% trans "The refund will be issued in form of a gift card that you can use for further purchases." %}
{% elif request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "option" %}
{% trans "The refund can be issued to your original payment method or as a gift card." %}
{% elif request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "off" %}
{% trans "The refund will be issued to your original payment method." %}
{% endif %}
{% trans "This will invalidate all tickets in this order." %}
</p>
{% elif order.user_cancel_fee >= order.total %}
<p>
{% if request.event.settings.cancel_allow_user_paid_require_approval %}
{% blocktrans trimmed %}

View File

@@ -22,12 +22,25 @@
data-asynctask
class="">
{% if request.event.settings.cancel_allow_user_paid_require_approval and order.status == "p" and order.total != 0 %}
<p>
{% blocktrans trimmed %}
You can request the cancellation of your order on this page. The event organizer will then decide
on your request. If they approve, your order will be canceled and all tickets will be invalidated.
{% endblocktrans %}
</p>
{% if request.event.settings.cancel_allow_user_paid_require_approval_fee_unknown %}
<p>
{% blocktrans trimmed %}
You can request to cancel this order.
{% endblocktrans %}
{% blocktrans trimmed %}
If your request is approved, the organizer will determine if you will receive a
full refund or if a cancellation fee is deducted according to their cancellation
policy.
{% endblocktrans %}
</p>
{% else %}
<p>
{% blocktrans trimmed %}
You can request the cancellation of your order on this page. The event organizer will then decide
on your request. If they approve, your order will be canceled and all tickets will be invalidated.
{% endblocktrans %}
</p>
{% endif %}
{% else %}
<p>
{% blocktrans trimmed %}
@@ -37,6 +50,7 @@
</p>
{% endif %}
{% if not request.event.settings.cancel_allow_user_paid_require_approval or not request.event.settings.cancel_allow_user_paid_require_approval_fee_unknown %}
{% if request.event.settings.cancel_allow_user_paid_adjust_fees and order.status == "p" and order.total != 0 %}
<p>
{% if cancel_fee %}
@@ -82,6 +96,7 @@
<strong>{% trans "Refund amount:" %}</strong> {{ refund_amount|money:request.event.currency }}
</p>
{% endif %}
{% endif %}
{% if refund_amount %}
{% if request.event.settings.cancel_allow_user_paid_refund_as_giftcard == "manually" %}