mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Do not show payment text of canceled and failed payments on invoice (Z#23231070) (#6075)
This commit is contained in:
@@ -58,6 +58,7 @@ from pretix.base.invoicing.transmission import (
|
|||||||
from pretix.base.models import (
|
from pretix.base.models import (
|
||||||
ExchangeRate, Invoice, InvoiceAddress, InvoiceLine, Order, OrderFee,
|
ExchangeRate, Invoice, InvoiceAddress, InvoiceLine, Order, OrderFee,
|
||||||
)
|
)
|
||||||
|
from pretix.base.models.orders import OrderPayment
|
||||||
from pretix.base.models.tax import EU_CURRENCIES
|
from pretix.base.models.tax import EU_CURRENCIES
|
||||||
from pretix.base.services.tasks import (
|
from pretix.base.services.tasks import (
|
||||||
TransactionAwareProfiledEventTask, TransactionAwareTask,
|
TransactionAwareProfiledEventTask, TransactionAwareTask,
|
||||||
@@ -102,7 +103,7 @@ def build_invoice(invoice: Invoice) -> Invoice:
|
|||||||
introductory = invoice.event.settings.get('invoice_introductory_text', as_type=LazyI18nString)
|
introductory = invoice.event.settings.get('invoice_introductory_text', as_type=LazyI18nString)
|
||||||
additional = invoice.event.settings.get('invoice_additional_text', as_type=LazyI18nString)
|
additional = invoice.event.settings.get('invoice_additional_text', as_type=LazyI18nString)
|
||||||
footer = invoice.event.settings.get('invoice_footer_text', as_type=LazyI18nString)
|
footer = invoice.event.settings.get('invoice_footer_text', as_type=LazyI18nString)
|
||||||
if lp and lp.payment_provider:
|
if lp and lp.payment_provider and lp.state not in (OrderPayment.PAYMENT_STATE_FAILED, OrderPayment.PAYMENT_STATE_CANCELED):
|
||||||
if 'payment' in inspect.signature(lp.payment_provider.render_invoice_text).parameters:
|
if 'payment' in inspect.signature(lp.payment_provider.render_invoice_text).parameters:
|
||||||
payment = str(lp.payment_provider.render_invoice_text(invoice.order, lp))
|
payment = str(lp.payment_provider.render_invoice_text(invoice.order, lp))
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user