forked from CGM_Public/pretix_original
Add signal invoice_line_text
This commit is contained in:
@@ -24,7 +24,7 @@ from pretix.base.models import Invoice, InvoiceAddress, InvoiceLine, Order
|
|||||||
from pretix.base.models.tax import EU_CURRENCIES
|
from pretix.base.models.tax import EU_CURRENCIES
|
||||||
from pretix.base.services.tasks import TransactionAwareTask
|
from pretix.base.services.tasks import TransactionAwareTask
|
||||||
from pretix.base.settings import GlobalSettingsObject
|
from pretix.base.settings import GlobalSettingsObject
|
||||||
from pretix.base.signals import periodic_task
|
from pretix.base.signals import invoice_line_text, periodic_task
|
||||||
from pretix.celery_app import app
|
from pretix.celery_app import app
|
||||||
from pretix.helpers.database import rolledback_transaction
|
from pretix.helpers.database import rolledback_transaction
|
||||||
from pretix.helpers.models import modelcopy
|
from pretix.helpers.models import modelcopy
|
||||||
@@ -139,6 +139,9 @@ def build_invoice(invoice: Invoice) -> Invoice:
|
|||||||
desc = " + " + desc
|
desc = " + " + desc
|
||||||
if invoice.event.settings.invoice_attendee_name and p.attendee_name:
|
if invoice.event.settings.invoice_attendee_name and p.attendee_name:
|
||||||
desc += "<br />" + pgettext("invoice", "Attendee: {name}").format(name=p.attendee_name)
|
desc += "<br />" + pgettext("invoice", "Attendee: {name}").format(name=p.attendee_name)
|
||||||
|
for recv, resp in invoice_line_text.send(sender=invoice.event, position=p):
|
||||||
|
if resp:
|
||||||
|
desc += "<br/>" + resp
|
||||||
|
|
||||||
for answ in p.answers.all():
|
for answ in p.answers.all():
|
||||||
if not answ.question.print_on_invoice:
|
if not answ.question.print_on_invoice:
|
||||||
|
|||||||
@@ -622,3 +622,11 @@ order_split = EventPluginSignal(
|
|||||||
This signal is sent out when an order is split into two orders and allows you to copy related models
|
This signal is sent out when an order is split into two orders and allows you to copy related models
|
||||||
to the new order. You will be passed the old order as ``original`` and the new order as ``split_order``.
|
to the new order. You will be passed the old order as ``original`` and the new order as ``split_order``.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
invoice_line_text = EventPluginSignal(
|
||||||
|
providing_args=["position"]
|
||||||
|
)
|
||||||
|
"""
|
||||||
|
This signal is sent out when an invoice is built for an order. You can return additional text that
|
||||||
|
should be shown on the invoice for the given ``position``.
|
||||||
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user