Add price_after_discount explicitly for showing in template

This commit is contained in:
PCoder 2020-01-24 15:24:46 +05:30
parent 112f3e17a9
commit 156930ab26
2 changed files with 2 additions and 1 deletions

View file

@ -138,7 +138,7 @@
{% endif %}
<p>
<strong class="text-lg">{% trans "Subtotal" %} </strong>
<strong class="pull-right">{{vm.price - vm.discount.amount|floatformat:2|intcomma}} CHF</strong>
<strong class="pull-right">{{vm.price_after_discount}} CHF</strong>
</p>
<p>
<small>{% trans "VAT for" %} {{vm.vat_country}} ({{vm.vat_percent}}%) : </small>

View file

@ -642,6 +642,7 @@ class OrderConfirmationView(DetailView, FormView):
vat_rate=user_country_vat_rate * 100
)
vm_specs["price"] = price
vm_specs["price_after_discount"] = price - discount
vat_number = request.session.get('billing_address_data').get("vat_number")
billing_address = BillingAddress.objects.get(id=request.session["billing_address_id"])