forked from CGM_Public/pretix_original
Fix custom taxation without invoice addresses
This commit is contained in:
@@ -160,6 +160,7 @@ class TaxRule(LoggedModel):
|
|||||||
|
|
||||||
def get_matching_rule(self, invoice_address):
|
def get_matching_rule(self, invoice_address):
|
||||||
rules = json.loads(self.custom_rules)
|
rules = json.loads(self.custom_rules)
|
||||||
|
if invoice_address:
|
||||||
for r in rules:
|
for r in rules:
|
||||||
if r['country'] == 'EU' and str(invoice_address.country) not in EU_COUNTRIES:
|
if r['country'] == 'EU' and str(invoice_address.country) not in EU_COUNTRIES:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
checked in order and once the first rule matches the order, it will be used and all further rules will
|
checked in order and once the first rule matches the order, it will be used and all further rules will
|
||||||
be ignored. If no rule matches, tax will be charged.
|
be ignored. If no rule matches, tax will be charged.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
{% trans "All of these rules will only apply if an invoice address is set." %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="formset" data-formset data-formset-prefix="{{ formset.prefix }}">
|
<div class="formset" data-formset data-formset-prefix="{{ formset.prefix }}">
|
||||||
|
|||||||
Reference in New Issue
Block a user