diff --git a/src/pretix/control/forms/orders.py b/src/pretix/control/forms/orders.py index e12f7f418b..9af5e17ae5 100644 --- a/src/pretix/control/forms/orders.py +++ b/src/pretix/control/forms/orders.py @@ -49,7 +49,7 @@ class ExtendForm(I18nModelForm): return data -class MarkPaidForm(forms.Form): +class ConfirmPaymentForm(forms.Form): force = forms.BooleanField( label=_('Overbook quota and ignore late payment'), help_text=_('If you check this box, this operation will be performed even if it leads to an overbooked quota ' @@ -75,6 +75,20 @@ class MarkPaidForm(forms.Form): del self.fields['force'] +class MarkPaidForm(ConfirmPaymentForm): + amount = forms.DecimalField( + required=True, + max_digits=10, decimal_places=2, + localize=True, + label=_('Payment amount'), + ) + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + change_decimal_field(self.fields['amount'], self.instance.event.currency) + self.fields['amount'].initial = max(0, self.instance.pending_sum) + + class ExporterForm(forms.Form): def clean(self): data = super().clean() diff --git a/src/pretix/control/templates/pretixcontrol/order/pay.html b/src/pretix/control/templates/pretixcontrol/order/pay.html index b22424c634..5c1eed4ab8 100644 --- a/src/pretix/control/templates/pretixcontrol/order/pay.html +++ b/src/pretix/control/templates/pretixcontrol/order/pay.html @@ -18,17 +18,21 @@