From 48cc2b49394c97433ed2d435490b38edc908b1f2 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 29 Jan 2020 16:19:48 +0530 Subject: [PATCH] Fix discount amount calculation after VAT --- utils/hosting_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py index 85829d05..e20e9b16 100644 --- a/utils/hosting_utils.py +++ b/utils/hosting_utils.py @@ -115,7 +115,7 @@ def get_vm_price_for_given_vat(cpu, memory, ssd_size, hdd_size=0, discount = { 'name': discount_name, 'amount': discount_amount, - 'amount_with_vat': round(discount_amount * vat_rate * 0.01, 2) + 'amount_with_vat': round(discount_amount * (1 + vat_rate * 0.01), 2) } return (round(float(price), 2), round(float(vat), 2), round(float(vat_percent), 2), discount)