add send_email field to mark-paid

This commit is contained in:
Richard Schreiber
2021-02-17 12:37:26 +01:00
parent 488273d5f2
commit 0d0bbe1ce5
3 changed files with 8 additions and 1 deletions

View File

@@ -104,7 +104,7 @@ class ConfirmPaymentForm(forms.Form):
class CancelForm(ConfirmPaymentForm):
send_email = forms.BooleanField(
required=False,
label=_('Notify user by e-mail'),
label=_('Notify customer by email'),
initial=True
)
cancellation_fee = forms.DecimalField(
@@ -139,6 +139,11 @@ class CancelForm(ConfirmPaymentForm):
class MarkPaidForm(ConfirmPaymentForm):
send_email = forms.BooleanField(
required=False,
label=_('Notify customer by email'),
initial=True
)
amount = forms.DecimalField(
required=True,
max_digits=10, decimal_places=2,

View File

@@ -24,6 +24,7 @@
{% bootstrap_form_errors form %}
{% bootstrap_field form.amount layout='horizontal' %}
{% bootstrap_field form.payment_date layout='horizontal' %}
{% bootstrap_field form.send_email layout='horizontal' %}
{% if form.force %}
{% bootstrap_field form.force layout='horizontal' horizontal_label_class='sr-only' horizontal_field_class='col-md-12' %}
{% endif %}

View File

@@ -1105,6 +1105,7 @@ class OrderTransition(OrderView):
try:
p.confirm(user=self.request.user, count_waitinglist=False, payment_date=payment_date,
send_mail=self.mark_paid_form.cleaned_data['send_email'],
force=self.mark_paid_form.cleaned_data.get('force', False))
except Quota.QuotaExceededException as e:
p.state = OrderPayment.PAYMENT_STATE_FAILED