Use round_up method
This commit is contained in:
parent
2058c660c0
commit
c43afb7c59
2 changed files with 11 additions and 5 deletions
|
|
@ -29,7 +29,7 @@ from utils.forms import (
|
|||
)
|
||||
from utils.hosting_utils import (
|
||||
get_vm_price_with_vat, get_all_public_keys, get_vat_rate_for_country,
|
||||
get_vm_price_for_given_vat
|
||||
get_vm_price_for_given_vat, round_up
|
||||
)
|
||||
from utils.stripe_utils import StripeUtils
|
||||
from utils.tasks import send_plain_email_task
|
||||
|
|
@ -678,10 +678,10 @@ class OrderConfirmationView(DetailView, FormView):
|
|||
vm_specs["vat_percent"] = vat_percent
|
||||
vm_specs["vat_validation_status"] = request.session["vat_validation_status"] if "vat_validation_status" in request.session else ""
|
||||
vm_specs["vat_country"] = user_vat_country
|
||||
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"] * 0.01), 2)
|
||||
discount["amount_with_vat"] = round(vm_specs["price_with_vat"] - vm_specs["price_after_discount_with_vat"], 2)
|
||||
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)
|
||||
vm_specs["total_price"] = vm_specs["price_after_discount_with_vat"]
|
||||
vm_specs["discount"] = discount
|
||||
request.session['specs'] = vm_specs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue