Configurable invoice prefixes

This commit is contained in:
Raphael Michel
2017-07-17 22:57:37 +02:00
parent 670bfa18de
commit 7bb12ff0ec
7 changed files with 135 additions and 5 deletions

View File

@@ -96,6 +96,7 @@ def generate_cancellation(invoice: Invoice):
cancellation = copy.copy(invoice)
cancellation.pk = None
cancellation.invoice_no = None
cancellation.prefix = None
cancellation.refers = invoice
cancellation.is_cancellation = True
cancellation.date = timezone.now().date()
@@ -125,6 +126,7 @@ def generate_invoice(order: Order):
invoice = Invoice(
order=order,
event=order.event,
organizer=order.event.organizer,
date=timezone.now().date(),
locale=locale
)
@@ -171,7 +173,7 @@ def build_preview_invoice_pdf(event):
expires=timezone.now(), code="PREVIEW", total=119)
invoice = Invoice(
order=order, event=event, invoice_no="PREVIEW",
date=timezone.now().date(), locale=locale
date=timezone.now().date(), locale=locale, organizer=event.organizer
)
invoice.invoice_from = event.settings.get('invoice_address_from')