From b1acd3f25b716851ea4f0fd01a60af70f5756c9a Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Feb 2020 09:02:17 +0530 Subject: [PATCH] Convert VAT percent to CHF before calculations --- datacenterlight/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 8da3e5c5..943c3565 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -680,10 +680,10 @@ class OrderConfirmationView(DetailView, FormView): vm_specs["total_price"] = round(price + vm_specs["vat"] - discount['amount_with_vat'], 2) vm_specs["vat_country"] = user_vat_country - vm_specs["price_with_vat"] = round(price * (1 + vm_specs["vat_percent"]), 2) + vm_specs["price_with_vat"] = round(price * (1 + vm_specs["vat_percent"] * 0.01), 2) vm_specs["price_after_discount"] = round(price - discount['amount'], 2) - vm_specs["price_after_discount_with_vat"] = round((price - discount['amount']) * (1 + vm_specs["vat_percent"]), 2) - discount["amount_with_vat"] = vm_specs["price_with_vat"] - vm_specs["price_after_discount_with_vat"] + vm_specs["price_after_discount_with_vat"] = round((price - discount['amount']) * (1 + vm_specs["vat_percent"] * 0.01), 2) + discount["amount_with_vat"] = round(vm_specs["price_with_vat"] - vm_specs["price_after_discount_with_vat"], 2) vm_specs["discount"] = discount request.session['specs'] = vm_specs