forked from CGM_Public/pretix_original
Add attendee names to invoices
This commit is contained in:
@@ -109,6 +109,8 @@ def build_invoice(invoice: Invoice) -> Invoice:
|
|||||||
desc += " - " + str(p.variation.value)
|
desc += " - " + str(p.variation.value)
|
||||||
if p.addon_to_id:
|
if p.addon_to_id:
|
||||||
desc = " + " + desc
|
desc = " + " + desc
|
||||||
|
if invoice.event.settings.invoice_attendee_name and p.attendee_name:
|
||||||
|
desc += "<br />" + pgettext("invoice", "Attendee: {name}").format(name=p.attendee_name)
|
||||||
InvoiceLine.objects.create(
|
InvoiceLine.objects.create(
|
||||||
position=i, invoice=invoice, description=desc,
|
position=i, invoice=invoice, description=desc,
|
||||||
gross_value=p.price, tax_value=p.tax_value,
|
gross_value=p.price, tax_value=p.tax_value,
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ DEFAULTS = {
|
|||||||
'default': 'False',
|
'default': 'False',
|
||||||
'type': bool,
|
'type': bool,
|
||||||
},
|
},
|
||||||
|
'invoice_attendee_name': {
|
||||||
|
'default': 'True',
|
||||||
|
'type': bool,
|
||||||
|
},
|
||||||
'invoice_address_required': {
|
'invoice_address_required': {
|
||||||
'default': 'False',
|
'default': 'False',
|
||||||
'type': bool,
|
'type': bool,
|
||||||
|
|||||||
@@ -547,6 +547,10 @@ class InvoiceSettingsForm(SettingsForm):
|
|||||||
),
|
),
|
||||||
help_text=_("Invoices will never be automatically generated for free orders.")
|
help_text=_("Invoices will never be automatically generated for free orders.")
|
||||||
)
|
)
|
||||||
|
invoice_attendee_name = forms.BooleanField(
|
||||||
|
label=_("Show attendee names on invoices"),
|
||||||
|
required=False
|
||||||
|
)
|
||||||
invoice_email_attachment = forms.BooleanField(
|
invoice_email_attachment = forms.BooleanField(
|
||||||
label=_("Attach invoices to emails"),
|
label=_("Attach invoices to emails"),
|
||||||
help_text=_("If invoices are automatically generated for all orders, they will be attached to the order "
|
help_text=_("If invoices are automatically generated for all orders, they will be attached to the order "
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
{% bootstrap_field form.invoice_renderer layout="control" %}
|
{% bootstrap_field form.invoice_renderer layout="control" %}
|
||||||
{% bootstrap_field form.invoice_language layout="control" %}
|
{% bootstrap_field form.invoice_language layout="control" %}
|
||||||
{% bootstrap_field form.invoice_include_free layout="control" %}
|
{% bootstrap_field form.invoice_include_free layout="control" %}
|
||||||
|
{% bootstrap_field form.invoice_attendee_name layout="control" %}
|
||||||
{% bootstrap_field form.invoice_address_from layout="control" %}
|
{% bootstrap_field form.invoice_address_from layout="control" %}
|
||||||
{% bootstrap_field form.invoice_introductory_text layout="control" %}
|
{% bootstrap_field form.invoice_introductory_text layout="control" %}
|
||||||
{% bootstrap_field form.invoice_additional_text layout="control" %}
|
{% bootstrap_field form.invoice_additional_text layout="control" %}
|
||||||
|
|||||||
Reference in New Issue
Block a user