Manual payment: Support for "invoice immediately"

This commit is contained in:
Raphael Michel
2023-03-17 15:25:51 +01:00
parent d0f603283b
commit 8dfc77a927

View File

@@ -1125,6 +1125,12 @@ class ManualPayment(BasePaymentProvider):
widget=I18nTextarea, widget=I18nTextarea,
validators=[PlaceholderValidator(['{order}', '{amount}', '{currency}', '{amount_with_currency}'])], validators=[PlaceholderValidator(['{order}', '{amount}', '{currency}', '{amount_with_currency}'])],
)), )),
('invoice_immediately',
forms.BooleanField(
label=_('Create an invoice for orders using bank transfer immediately if the event is otherwise '
'configured to create invoices after payment is completed.'),
required=False,
)),
] + list(super().settings_form_fields.items()) ] + list(super().settings_form_fields.items())
) )
d.move_to_end('_enabled', last=False) d.move_to_end('_enabled', last=False)
@@ -1164,6 +1170,10 @@ class ManualPayment(BasePaymentProvider):
format_map(self.settings.get('pending_description', as_type=LazyI18nString), self.format_map(payment.order, payment)) format_map(self.settings.get('pending_description', as_type=LazyI18nString), self.format_map(payment.order, payment))
) )
@property
def requires_invoice_immediately(self):
return self.settings.get('invoice_immediately', False, as_type=bool)
class OffsettingProvider(BasePaymentProvider): class OffsettingProvider(BasePaymentProvider):
is_enabled = True is_enabled = True