From d56e2de409a42b054aaf5c7ab09db9f87bd6958a Mon Sep 17 00:00:00 2001
From: Raphael Michel
Date: Wed, 28 Sep 2022 13:37:58 +0200
Subject: [PATCH] Bank transfer: Do not show EPC-QR and GiroCode for non-EUR
payments
---
src/pretix/plugins/banktransfer/payment.py | 2 +
.../pretixplugins/banktransfer/pending.html | 64 ++++++++++---------
2 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/src/pretix/plugins/banktransfer/payment.py b/src/pretix/plugins/banktransfer/payment.py
index 0e733cec30..86d1fcadcd 100644
--- a/src/pretix/plugins/banktransfer/payment.py
+++ b/src/pretix/plugins/banktransfer/payment.py
@@ -316,9 +316,11 @@ class BankTransfer(BasePaymentProvider):
'amount': payment.amount,
'settings': self.settings,
'swiss_qrbill': self.swiss_qrbill(payment),
+ 'eu_barcodes': self.event.currency == 'EUR',
'pending_description': self.settings.get('pending_description', as_type=LazyI18nString),
'details': self.settings.get('bank_details', as_type=LazyI18nString),
}
+ ctx['any_barcodes'] = ctx['swiss_qrbill'] or ctx['eu_barcodes']
return template.render(ctx)
def payment_control_render(self, request: HttpRequest, payment: OrderPayment) -> str:
diff --git a/src/pretix/plugins/banktransfer/templates/pretixplugins/banktransfer/pending.html b/src/pretix/plugins/banktransfer/templates/pretixplugins/banktransfer/pending.html
index 98991d3591..7332e8a8cc 100644
--- a/src/pretix/plugins/banktransfer/templates/pretixplugins/banktransfer/pending.html
+++ b/src/pretix/plugins/banktransfer/templates/pretixplugins/banktransfer/pending.html
@@ -41,14 +41,16 @@
{% trans "After you sent the bank transfer, you can close this window. We will send you an email as soon as we received your payment." %}
- {% if settings.bank_details_type == "sepa" %}
+ {% if settings.bank_details_type == "sepa" and any_barcodes %}
{% if swiss_qrbill %}
@@ -62,36 +64,38 @@
{% endif %}
-
-
- {% trans "Scan the qr-code with your banking app" %}
-
-
-
-
-
-
-
- {% trans "Scan the qr-code with your banking app" %}
-
-
-
-
-
-
-
+
+
+
+