Item list: Fix exclusive tax rules

This commit is contained in:
Raphael Michel
2024-07-02 09:03:33 +02:00
parent d9f46cb817
commit 075b9c187f
2 changed files with 10 additions and 4 deletions

View File

@@ -136,9 +136,15 @@
{% if i.tax_rule and i.default_price %} {% if i.tax_rule and i.default_price %}
<br/> <br/>
<small class="text-muted"> <small class="text-muted">
{% blocktrans trimmed with rate=i.tax_rule.rate|floatformat:-2 taxname=i.tax_rule.name|default:s_taxes %} {% if not i.tax_rule.price_includes_tax %}
incl. {{ rate }}% {{ taxname }} {% blocktrans trimmed with rate=i.tax_rule.rate|floatformat:-2 taxname=i.tax_rule.name %}
{% endblocktrans %} <strong>plus</strong> {{ rate }}% {{ taxname }}
{% endblocktrans %}
{% else %}
{% blocktrans trimmed with rate=i.tax_rule.rate|floatformat:-2 taxname=i.tax_rule.name|default:s_taxes %}
incl. {{ rate }}% {{ taxname }}
{% endblocktrans %}
{% endif %}
</small> </small>
{% endif %} {% endif %}
</td> </td>

View File

@@ -103,7 +103,7 @@ class ItemList(ListView):
def get_queryset(self): def get_queryset(self):
return Item.objects.filter( return Item.objects.filter(
event=self.request.event event=self.request.event
).annotate( ).select_related("tax_rule").annotate(
var_count=Count('variations') var_count=Count('variations')
).prefetch_related("category", "limit_sales_channels").order_by( ).prefetch_related("category", "limit_sales_channels").order_by(
F('category__position').asc(nulls_first=True), F('category__position').asc(nulls_first=True),