From 39c693df434a21ecc2ee054f367f588925c1d179 Mon Sep 17 00:00:00 2001 From: Kara Engelhardt Date: Mon, 11 May 2026 18:06:29 +0200 Subject: [PATCH] Show invoice_dirty status on order details page (Z#23230731) --- .../templates/pretixcontrol/order/index.html | 33 +++++++++++++++++++ src/pretix/control/views/orders.py | 3 ++ 2 files changed, 36 insertions(+) diff --git a/src/pretix/control/templates/pretixcontrol/order/index.html b/src/pretix/control/templates/pretixcontrol/order/index.html index bece30e114..c240038efb 100644 --- a/src/pretix/control/templates/pretixcontrol/order/index.html +++ b/src/pretix/control/templates/pretixcontrol/order/index.html @@ -134,6 +134,39 @@ {% endif %} + {% if invoice_qualified and order.invoice_dirty %} +
+

+ {% blocktrans trimmed %} + This order was changed after the last invoice was generated. A new invoice was not generated yet, because invoices are configured to be generated on payment or if required by the payment method. + A new invoice will be generated once the customer pays the invoice or selects a payment method that requires an invoice. + {% endblocktrans %} +

+ {% if "event.orders:write" in request.eventpermset %} +

+ {% if uncancelled_invoice %} +

+ {% csrf_token %} + +
+ {% elif can_generate_invoice %} +
+ {% csrf_token %} + +
+ {% endif %} +

+ {% endif %} +
+ {% endif %} +
{% for cr in order.cancellation_requests.all %} diff --git a/src/pretix/control/views/orders.py b/src/pretix/control/views/orders.py index 57155ad896..eed4443c70 100644 --- a/src/pretix/control/views/orders.py +++ b/src/pretix/control/views/orders.py @@ -554,6 +554,9 @@ class OrderDetail(OrderView): ctx['download_buttons'] = self.download_buttons ctx['payment_refund_sum'] = self.order.payment_refund_sum ctx['pending_sum'] = self.order.pending_sum + ctx['uncancelled_invoice'] = self.order.invoices.exclude( + Exists(self.order.invoices.filter(refers=OuterRef('pk'), is_cancellation=True)) + ).exclude(is_cancellation=True).first() return ctx