From 156930ab26418f260967cf5cf60f250cb27f81ba Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 24 Jan 2020 15:24:46 +0530 Subject: [PATCH] Add price_after_discount explicitly for showing in template --- datacenterlight/templates/datacenterlight/order_detail.html | 2 +- datacenterlight/views.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 80e35914..c2b97556 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -138,7 +138,7 @@ {% endif %}

{% trans "Subtotal" %} - {{vm.price - vm.discount.amount|floatformat:2|intcomma}} CHF + {{vm.price_after_discount}} CHF

{% trans "VAT for" %} {{vm.vat_country}} ({{vm.vat_percent}}%) : diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 92c65681..8c1fe504 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -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"])