forked from CGM_Public/pretix_original
New check-in features (#3022)
This commit is contained in:
@@ -1052,7 +1052,7 @@ class MailSettingsForm(SettingsForm):
|
||||
"value is 0, the mail will never be sent.")
|
||||
)
|
||||
mail_text_order_expire_warning = I18nFormField(
|
||||
label=_("Text"),
|
||||
label=_("Text (if order will expire automatically)"),
|
||||
required=False,
|
||||
widget=I18nTextarea,
|
||||
)
|
||||
@@ -1061,6 +1061,11 @@ class MailSettingsForm(SettingsForm):
|
||||
required=False,
|
||||
widget=I18nTextInput,
|
||||
)
|
||||
mail_text_order_pending_warning = I18nFormField(
|
||||
label=_("Text (if order will not expire automatically)"),
|
||||
required=False,
|
||||
widget=I18nTextarea,
|
||||
)
|
||||
mail_subject_order_pending_warning = I18nFormField(
|
||||
label=_("Subject (if order will not expire automatically)"),
|
||||
required=False,
|
||||
|
||||
@@ -210,6 +210,7 @@ class OrderFilterForm(FilterForm):
|
||||
('', _('All orders')),
|
||||
(_('Valid orders'), (
|
||||
(Order.STATUS_PAID, _('Paid (or canceled with paid fee)')),
|
||||
(Order.STATUS_PAID + 'v', _('Paid or confirmed')),
|
||||
(Order.STATUS_PENDING, _('Pending')),
|
||||
(Order.STATUS_PENDING + Order.STATUS_PAID, _('Pending or paid')),
|
||||
)),
|
||||
@@ -296,6 +297,8 @@ class OrderFilterForm(FilterForm):
|
||||
qs = qs.filter(status__in=[Order.STATUS_PENDING, Order.STATUS_PAID])
|
||||
elif s == 'ne':
|
||||
qs = qs.filter(status__in=[Order.STATUS_PENDING, Order.STATUS_EXPIRED])
|
||||
elif s == 'pv':
|
||||
qs = qs.filter(Q(status=Order.STATUS_PAID) | Q(status=Order.STATUS_PENDING, valid_if_pending=True))
|
||||
elif s in ('p', 'n', 'e', 'c', 'r'):
|
||||
qs = qs.filter(status=s)
|
||||
elif s == 'overpaid':
|
||||
|
||||
@@ -387,7 +387,6 @@ class ItemCreateForm(I18nModelForm):
|
||||
'show_quota_left',
|
||||
'hidden_if_available',
|
||||
'require_bundling',
|
||||
'checkin_attention',
|
||||
'require_membership',
|
||||
'grant_membership_type',
|
||||
'grant_membership_duration_like_event',
|
||||
@@ -800,6 +799,7 @@ class ItemVariationForm(I18nModelForm):
|
||||
'require_membership',
|
||||
'require_membership_hidden',
|
||||
'require_membership_types',
|
||||
'checkin_attention',
|
||||
'available_from',
|
||||
'available_until',
|
||||
'sales_channels',
|
||||
|
||||
@@ -68,12 +68,6 @@ from pretix.helpers.money import change_decimal_field
|
||||
|
||||
|
||||
class ExtendForm(I18nModelForm):
|
||||
quota_ignore = forms.BooleanField(
|
||||
label=_('Overbook quota'),
|
||||
help_text=_('If you check this box, this operation will be performed even if it leads to an overbooked quota '
|
||||
'and you having sold more tickets than you planned!'),
|
||||
required=False
|
||||
)
|
||||
expires = forms.DateField(
|
||||
label=_("Expiration date"),
|
||||
widget=forms.DateInput(attrs={
|
||||
@@ -81,16 +75,35 @@ class ExtendForm(I18nModelForm):
|
||||
'data-is-payment-date': 'true'
|
||||
}),
|
||||
)
|
||||
valid_if_pending = forms.BooleanField(
|
||||
label=_('Confirm order regardless of payment'),
|
||||
help_text=_('If you check this box, this order will behave like a paid order for most purposes, even though it '
|
||||
'is not yet paid. This means that the customer can already download and use tickets regardless '
|
||||
'of your event settings, and the order might be treated as paid by some plugins. If you check '
|
||||
'this, this order will not be marked as "expired" automatically if the payment deadline arrives, '
|
||||
'since we expect that you want to collect the amount somehow and not auto-cancel the order.'),
|
||||
required=False
|
||||
)
|
||||
quota_ignore = forms.BooleanField(
|
||||
label=_('Overbook quota'),
|
||||
help_text=_('If you check this box, this operation will be performed even if it leads to an overbooked quota '
|
||||
'and you having sold more tickets than you planned!'),
|
||||
required=False
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Order
|
||||
fields = []
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
kwargs.setdefault('initial', {})
|
||||
kwargs['initial'].setdefault('valid_if_pending', kwargs['instance'].valid_if_pending)
|
||||
kwargs['initial'].setdefault('expires', kwargs['instance'].expires)
|
||||
super().__init__(*args, **kwargs)
|
||||
if self.instance.status == Order.STATUS_PENDING or self.instance._is_still_available(now(),
|
||||
count_waitinglist=False)\
|
||||
is True:
|
||||
if (
|
||||
self.instance.status == Order.STATUS_PENDING or
|
||||
self.instance._is_still_available(now(), count_waitinglist=False) is True
|
||||
):
|
||||
del self.fields['quota_ignore']
|
||||
|
||||
def clean(self):
|
||||
@@ -435,6 +448,20 @@ class OrderPositionChangeForm(forms.Form):
|
||||
localize=True,
|
||||
label=_('New price (gross)')
|
||||
)
|
||||
blocked = forms.BooleanField(
|
||||
required=False,
|
||||
label=_('Ticket is blocked')
|
||||
)
|
||||
valid_from = SplitDateTimeField(
|
||||
required=False,
|
||||
widget=SplitDateTimePickerWidget,
|
||||
label=_('Validity start')
|
||||
)
|
||||
valid_until = SplitDateTimeField(
|
||||
required=False,
|
||||
widget=SplitDateTimePickerWidget,
|
||||
label=_('Validity end')
|
||||
)
|
||||
used_membership = forms.ChoiceField(
|
||||
required=False,
|
||||
)
|
||||
@@ -466,6 +493,9 @@ class OrderPositionChangeForm(forms.Form):
|
||||
initial = kwargs.get('initial', {})
|
||||
|
||||
initial['price'] = instance.price
|
||||
initial['blocked'] = instance.blocked and "admin" in instance.blocked
|
||||
initial['valid_from'] = instance.valid_from
|
||||
initial['valid_until'] = instance.valid_until
|
||||
|
||||
kwargs['initial'] = initial
|
||||
super().__init__(*args, **kwargs)
|
||||
@@ -756,7 +786,8 @@ class EventCancelForm(forms.Form):
|
||||
label=_('Automatically refund money if possible'),
|
||||
initial=True,
|
||||
required=False,
|
||||
help_text=_('Only available for payment method that support automatic refunds.')
|
||||
help_text=_('Only available for payment method that support automatic refunds. Tickets that have been blocked '
|
||||
'(manually or by a plugin) are not auto-canceled and you will need to deal with them manually.')
|
||||
)
|
||||
manual_refund = forms.BooleanField(
|
||||
label=_('Create refund in the manual refund to-do list'),
|
||||
|
||||
Reference in New Issue
Block a user