mirror of
https://github.com/pretix/pretix-servicefees.git
synced 2025-04-17 13:32:36 +02:00
use tax-rule pk as key instead of (rate, code)
This commit is contained in:
parent
6a7594af23
commit
3b42a29dfe
1 changed files with 3 additions and 3 deletions
|
@ -149,9 +149,9 @@ def get_fees(
|
|||
tr = p.tax_rule
|
||||
if not tr:
|
||||
tr = tax_rule_zero
|
||||
key = (tr.rate, tr.code)
|
||||
d[key] += p.price - p.tax_value
|
||||
trs[key] = tr
|
||||
# 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([(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)
|
||||
|
|
Loading…
Add table
Reference in a new issue