From b103cff0a6742bea0a178914985ae7f29882e1db Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 1 Feb 2020 13:54:29 +0530 Subject: [PATCH] Dont round_up discount (is obtained from subtraction) --- datacenterlight/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index d6bfd27d..185b3e29 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -681,9 +681,10 @@ class OrderConfirmationView(DetailView, FormView): vm_specs["price_with_vat"] = round_up(price * (1 + vm_specs["vat_percent"] * 0.01), 2) vm_specs["price_after_discount"] = round_up(price - discount['amount'], 2) vm_specs["price_after_discount_with_vat"] = round_up((price - discount['amount']) * (1 + vm_specs["vat_percent"] * 0.01), 2) - discount["amount_with_vat"] = round_up(vm_specs["price_with_vat"] - vm_specs["price_after_discount_with_vat"], 2) + discount["amount_with_vat"] = round(vm_specs["price_with_vat"] - vm_specs["price_after_discount_with_vat"], 2) vm_specs["total_price"] = vm_specs["price_after_discount_with_vat"] vm_specs["discount"] = discount + logger.debug(vm_specs) request.session['specs'] = vm_specs context.update({