diff --git a/pretix_servicefees/locale/ar/LC_MESSAGES/django.po b/pretix_servicefees/locale/ar/LC_MESSAGES/django.po index 5683297..4c63a5e 100644 --- a/pretix_servicefees/locale/ar/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/ar/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/cs/LC_MESSAGES/django.po b/pretix_servicefees/locale/cs/LC_MESSAGES/django.po index 3eec18b..78f387a 100644 --- a/pretix_servicefees/locale/cs/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/cs/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/da/LC_MESSAGES/django.po b/pretix_servicefees/locale/da/LC_MESSAGES/django.po index 8d44966..23b817d 100644 --- a/pretix_servicefees/locale/da/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/da/LC_MESSAGES/django.po @@ -48,5 +48,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/de/LC_MESSAGES/django.po b/pretix_servicefees/locale/de/LC_MESSAGES/django.po index 0091735..e67cab1 100644 --- a/pretix_servicefees/locale/de/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/de/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "Servicegebühr" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "Servicegebühr (%)" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "Servicegebühr für Vorverkaufsstellen" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "Servicegebühr für Vorverkaufsstellen (%)" diff --git a/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po b/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po index a36cda9..23ea5ea 100644 --- a/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "Servicegebühr" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "Servicegebühr (%)" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "Servicegebühr für Vorverkaufsstellen" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "Servicegebühr für Vorverkaufsstellen (%)" diff --git a/pretix_servicefees/locale/django.pot b/pretix_servicefees/locale/django.pot index 7275353..db3ba21 100644 --- a/pretix_servicefees/locale/django.pot +++ b/pretix_servicefees/locale/django.pot @@ -46,5 +46,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/el/LC_MESSAGES/django.po b/pretix_servicefees/locale/el/LC_MESSAGES/django.po index 975e3bb..d7197c5 100644 --- a/pretix_servicefees/locale/el/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/el/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/es/LC_MESSAGES/django.po b/pretix_servicefees/locale/es/LC_MESSAGES/django.po index 00e37b0..2172e60 100644 --- a/pretix_servicefees/locale/es/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/es/LC_MESSAGES/django.po @@ -48,5 +48,13 @@ msgid "Service fee" msgstr "Tarifa por servicio" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "Tarifa por servicio (%)" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/fr/LC_MESSAGES/django.po b/pretix_servicefees/locale/fr/LC_MESSAGES/django.po index 6628fba..eca00e1 100644 --- a/pretix_servicefees/locale/fr/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/fr/LC_MESSAGES/django.po @@ -48,7 +48,15 @@ msgid "Service fee" msgstr "Frais de service" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "Frais de service (%)" + +#: pretix_servicefees/views.py:13 #, fuzzy #| msgid "Service fees" msgid "Service fee with resellers" msgstr "Frais de service" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "Frais de service (%)" diff --git a/pretix_servicefees/locale/it/LC_MESSAGES/django.po b/pretix_servicefees/locale/it/LC_MESSAGES/django.po index b4744f5..e6b18af 100644 --- a/pretix_servicefees/locale/it/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/it/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/nl/LC_MESSAGES/django.po b/pretix_servicefees/locale/nl/LC_MESSAGES/django.po index 0e9b43d..7f8ee23 100644 --- a/pretix_servicefees/locale/nl/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/nl/LC_MESSAGES/django.po @@ -50,5 +50,13 @@ msgid "Service fee" msgstr "Servicekosten" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "Servicekosten (%)" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "Servicekosten voor wederverkopers" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "Servicekosten voor wederverkopers (%)" diff --git a/pretix_servicefees/locale/nl_BE/LC_MESSAGES/django.po b/pretix_servicefees/locale/nl_BE/LC_MESSAGES/django.po index 7c1b2af..8ca95a5 100644 --- a/pretix_servicefees/locale/nl_BE/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/nl_BE/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/nl_Informal/LC_MESSAGES/django.po b/pretix_servicefees/locale/nl_Informal/LC_MESSAGES/django.po index d5029f9..06167b8 100644 --- a/pretix_servicefees/locale/nl_Informal/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/nl_Informal/LC_MESSAGES/django.po @@ -50,5 +50,13 @@ msgid "Service fee" msgstr "Servicekosten" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "Servicekosten (%)" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "Servicekosten voor wederverkopers" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "Servicekosten voor wederverkopers (%)" diff --git a/pretix_servicefees/locale/pt_BR/LC_MESSAGES/django.po b/pretix_servicefees/locale/pt_BR/LC_MESSAGES/django.po index 6395c96..e05a1b1 100644 --- a/pretix_servicefees/locale/pt_BR/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/pt_BR/LC_MESSAGES/django.po @@ -45,5 +45,13 @@ msgid "Service fee" msgstr "" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "" + +#: pretix_servicefees/views.py:13 msgid "Service fee with resellers" msgstr "" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "" diff --git a/pretix_servicefees/locale/tr/LC_MESSAGES/django.po b/pretix_servicefees/locale/tr/LC_MESSAGES/django.po index efaf1b9..89587c5 100644 --- a/pretix_servicefees/locale/tr/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/tr/LC_MESSAGES/django.po @@ -50,7 +50,15 @@ msgid "Service fee" msgstr "Servis ücreti" #: pretix_servicefees/views.py:12 +msgid "Service fee (%)" +msgstr "Servis ücreti (%)" + +#: pretix_servicefees/views.py:13 #, fuzzy #| msgid "Service fees" msgid "Service fee with resellers" msgstr "Servis ücretleri" + +#: pretix_servicefees/views.py:14 +msgid "Service fee with resellers (%)" +msgstr "Servis ücretleri (%)" diff --git a/pretix_servicefees/signals.py b/pretix_servicefees/signals.py index aee8859..cecbc6e 100644 --- a/pretix_servicefees/signals.py +++ b/pretix_servicefees/signals.py @@ -4,6 +4,7 @@ from django.urls import resolve, reverse from django.dispatch import receiver from django.http import HttpRequest from django.utils.translation import ugettext_lazy as _, ugettext, get_language +from pretix.base.decimal import round_decimal from pretix.base.models import Event, Order, TaxRule from pretix.base.models.orders import OrderFee from pretix.base.signals import order_fee_calculation @@ -26,10 +27,16 @@ def navbar_settings(sender, request, **kwargs): def get_fees(event, total, invoice_address, mod=''): - fee = event.settings.get('service_fee_abs' + mod, as_type=Decimal) - if mod and fee is None: - fee = event.settings.get('service_fee_abs', as_type=Decimal) - if fee and total != Decimal('0.00'): + fee_abs = event.settings.get('service_fee_abs' + mod, as_type=Decimal) + if mod and fee_abs is None: + fee_abs = event.settings.get('service_fee_abs', as_type=Decimal) + + fee_percent = event.settings.get('service_fee_percent' + mod, as_type=Decimal) + if mod and fee_percent is None: + fee_percent = event.settings.get('service_fee_percent', as_type=Decimal) + + if fee_abs and fee_percent and total != Decimal('0.00'): + fee = round_decimal(fee_abs + total * (fee_percent / 100), event.currency) tax_rule = event.settings.tax_rate_default or TaxRule.zero() if tax_rule.tax_applicable(invoice_address): tax = tax_rule.tax(fee) diff --git a/pretix_servicefees/templates/pretix_servicefees/settings.html b/pretix_servicefees/templates/pretix_servicefees/settings.html index 0185fbe..a3d62ac 100644 --- a/pretix_servicefees/templates/pretix_servicefees/settings.html +++ b/pretix_servicefees/templates/pretix_servicefees/settings.html @@ -8,7 +8,9 @@ {% bootstrap_form_errors form %}