This commit is contained in:
Raphael Michel
2022-04-27 14:43:16 +02:00
committed by GitHub
parent 7730cc6170
commit 6fee0ac0a9
56 changed files with 4159 additions and 480 deletions

View File

@@ -55,7 +55,7 @@ from pretix.base.models import Customer, Order
from pretix.base.models.orders import InvoiceAddress, OrderPayment
from pretix.base.models.tax import TaxedPrice, TaxRule
from pretix.base.services.cart import (
CartError, error_messages, get_fees, set_cart_addons, update_tax_rates,
CartError, CartManager, error_messages, get_fees, set_cart_addons,
)
from pretix.base.services.memberships import validate_memberships_in_order
from pretix.base.services.orders import perform_order
@@ -873,11 +873,13 @@ class QuestionsStep(QuestionsViewMixin, CartMixin, TemplateFlowStep):
self.cart_session['saved_invoice_address'] = saved.pk
try:
diff = update_tax_rates(
event=request.event,
cm = CartManager(
event=self.request.event,
cart_id=get_or_create_cart_id(request),
invoice_address=addr
invoice_address=addr,
sales_channel=request.sales_channel.identifier,
)
diff = cm.recompute_final_prices_and_taxes()
except TaxRule.SaleNotAllowed:
messages.error(request,
_("Unfortunately, based on the invoice address you entered, we're not able to sell you "

View File

@@ -231,6 +231,13 @@
{% else %}
{{ line.price|money:event.currency }}
{% endif %}
{% if line.discount and line.line_price_gross != line.price %}
<span class="text-success discounted" data-toggle="tooltip" title="{% trans "The price of this product was reduced because of an automatic discount." %}">
<br>
<span class="fa fa-percent fa-fw" aria-hidden="true"></span>
{% trans "Discounted" %}
</span>
{% endif %}
</div>
{% else %}
<div role="cell" class="count">
@@ -285,6 +292,13 @@
{% else %}
{{ line.price|money:event.currency }}
{% endif %}
{% if line.discount and line.line_price_gross != line.price %}
<span class="text-success discounted" data-toggle="tooltip" title="{% trans "The price of this product was reduced because of an automatic discount." %}">
<br>
<span class="fa fa-percent fa-fw" aria-hidden="true"></span>
{% trans "Discounted" %}
</span>
{% endif %}
</div>
{% endif %}
<div role="cell" class="totalprice price">