Fix #399 -- Optionally create invoices only after successful payment

This commit is contained in:
Raphael Michel
2017-02-03 12:33:46 +01:00
parent ef93b8ae38
commit 5495cd749a
2 changed files with 6 additions and 1 deletions

View File

@@ -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: