forked from CGM_Public/pretix_original
Fix #399 -- Optionally create invoices only after successful payment
This commit is contained in:
@@ -109,6 +109,10 @@ def mark_order_paid(order: Order, provider: str=None, info: str=None, date: date
|
||||
}, user=user)
|
||||
order_paid.send(order.event, order=order)
|
||||
|
||||
if order.event.settings.get('invoice_generate') in ('True', 'paid') and invoice_qualified(order):
|
||||
if not order.invoices.exists():
|
||||
generate_invoice(order)
|
||||
|
||||
if send_mail:
|
||||
with language(order.locale):
|
||||
try:
|
||||
|
||||
@@ -331,7 +331,8 @@ class InvoiceSettingsForm(SettingsForm):
|
||||
('False', _('No')),
|
||||
('admin', _('Manually in admin panel')),
|
||||
('user', _('Automatically on user request')),
|
||||
('True', _('Automatically for all created orders'))
|
||||
('True', _('Automatically for all created orders')),
|
||||
('paid', _('Automatically on payment')),
|
||||
)
|
||||
)
|
||||
invoice_address_from = forms.CharField(
|
||||
|
||||
Reference in New Issue
Block a user