1
0
Fork 1
mirror of https://github.com/pretix/pretix-servicefees.git synced 2025-04-29 17:52:37 +02:00

Compare commits

...

7 commits

Author SHA1 Message Date
Raphael Michel
6c52b0d5d1 Bump to 1.13.1 2025-03-26 15:13:38 +01:00
Richard Schreiber
0f81aa42dd
Fix fee_calc tax-splitting with products having no tax-rule 2025-03-18 09:26:55 +01:00
Richard Schreiber
3b42a29dfe use tax-rule pk as key instead of (rate, code) 2025-03-11 16:40:31 +01:00
Richard Schreiber
6a7594af23 improve readability suggested from code review 2025-03-11 16:40:05 +01:00
Richard Schreiber
18b02c7f63
Apply suggestions from code review
Co-authored-by: Mira <mira@teamwiki.de>
2025-03-11 16:35:04 +01:00
Richard Schreiber
c65992fef0 fix fee_calc splitting with None tax-rules 2025-03-04 09:58:02 +01:00
Chislon
68492cdb91 Translated on translate.pretix.eu (Chinese (Traditional Han script))
Currently translated at 100.0% (24 of 24 strings)

Translation: pretix/pretix Plugin: Service Fees
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix-plugin-service-fees/zh_Hant/

powered by weblate
2025-02-10 12:59:07 +01:00
3 changed files with 20 additions and 14 deletions
pretix_servicefees
__init__.py
locale/zh_Hant/LC_MESSAGES
signals.py

View file

@ -1 +1 @@
__version__ = "1.13.0"
__version__ = "1.13.1"

View file

@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-14 11:41+0100\n"
"PO-Revision-Date: 2024-02-15 13:58+0000\n"
"Last-Translator: Martin Gross <gross@rami.io>\n"
"Language-Team: Chinese (Traditional) <https://translate.pretix.eu/projects/"
"pretix/pretix-plugin-service-fees/zh_Hant/>\n"
"PO-Revision-Date: 2025-01-31 01:00+0000\n"
"Last-Translator: Chislon <chislon@gmail.com>\n"
"Language-Team: Chinese (Traditional Han script) <https://translate.pretix.eu/"
"projects/pretix/pretix-plugin-service-fees/zh_Hant/>\n"
"Language: zh_Hant\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.3.1\n"
"X-Generator: Weblate 5.9.2\n"
#: pretix_servicefees/apps.py:11
msgid "Service Fees"
@ -135,10 +135,11 @@ msgstr ""
msgid ""
"Split taxes proportionate to the tax rates and net values of the ordered "
"products."
msgstr ""
msgstr "根據稅率和訂購產品的淨值按比例分稅。"
#: pretix_servicefees/views.py:51
msgid ""
"If not split based on ordered products, the tax rate falls back to the "
"events base tax rate or no tax, if none is given."
msgstr ""
msgstr "如果沒有根據訂購的產品進行拆分,稅率會恢復到事件的基本稅率,如果沒有給出稅率"
",則不徵稅。"

View file

@ -141,21 +141,26 @@ def get_fees(
if split_taxes:
# split taxes based on products ordered
d = defaultdict(lambda: Decimal("0.00"))
trs = {}
for p in positions:
if isinstance(p, CartPosition):
tr = p.item.tax_rule
else:
tr = p.tax_rule
d[tr] += p.price - p.tax_value
if not tr:
tr = tax_rule_zero
# use tr.pk as key as tax_rule_zero is not hashable
d[tr.pk] += p.price - p.tax_value
trs[tr.pk] = tr
base_values = sorted([tuple(t) for t in d.items()], key=lambda t: t[0].rate)
sum_base = sum(t[1] for t in base_values)
base_values = sorted([(trs[key], value) for key, value in d.items()], key=lambda t: t[0].rate)
sum_base = sum(value for key, value in base_values)
if sum_base:
fee_values = [
(t[0], round_decimal(fee * t[1] / sum_base, event.currency))
for t in base_values
(key, round_decimal(fee * value / sum_base, event.currency))
for key, value in base_values
]
sum_fee = sum(t[1] for t in fee_values)
sum_fee = sum(value for key, value in fee_values)
# If there are rounding differences, we fix them up, but always leaning to the benefit of the tax
# authorities