mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Add "paid" note on invoices if there is no open payment
This commit is contained in:
@@ -13,7 +13,7 @@ from django.db.models import Count
|
|||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
from django.utils.translation import pgettext, ugettext as _
|
from django.utils.translation import pgettext, pgettext_lazy, ugettext as _
|
||||||
from django_countries.fields import Country
|
from django_countries.fields import Country
|
||||||
from i18nfield.strings import LazyI18nString
|
from i18nfield.strings import LazyI18nString
|
||||||
|
|
||||||
@@ -53,6 +53,8 @@ def build_invoice(invoice: Invoice) -> Invoice:
|
|||||||
footer = invoice.event.settings.get('invoice_footer_text', as_type=LazyI18nString)
|
footer = invoice.event.settings.get('invoice_footer_text', as_type=LazyI18nString)
|
||||||
if open_payment and open_payment.payment_provider:
|
if open_payment and open_payment.payment_provider:
|
||||||
payment = open_payment.payment_provider.render_invoice_text(invoice.order)
|
payment = open_payment.payment_provider.render_invoice_text(invoice.order)
|
||||||
|
elif invoice.order.status == Order.STATUS_PAID:
|
||||||
|
return pgettext_lazy('invoice', 'The payment for this invoice has already been received.')
|
||||||
else:
|
else:
|
||||||
payment = ""
|
payment = ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user