From fcc671a7072ebafc09aaac185b0a9a874f936325 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 9 Dec 2019 18:07:19 +0530 Subject: [PATCH] Fix >= for first_vm_id_after_eu_vat --- hosting/views.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index e196d91f..bd5d1889 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -864,7 +864,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView): ) ) context['vm']["after_eu_vat_intro"] = ( - True if obj.vm_id > settings.FIRST_VM_ID_AFTER_EU_VAT + True if obj.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT else False ) context['vm']["price"] = price @@ -898,7 +898,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView): ) ) context['vm']["after_eu_vat_intro"] = ( - True if obj.vm_id > settings.FIRST_VM_ID_AFTER_EU_VAT + True if obj.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT else False ) context['vm']["price"] = price @@ -1298,7 +1298,7 @@ class InvoiceDetailView(LoginRequiredMixin, DetailView): ) ) context['vm']["after_eu_vat_intro"] = ( - True if obj.order.vm_id > settings.FIRST_VM_ID_AFTER_EU_VAT + True if obj.order.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT else False ) context['vm']["price"] = price @@ -1329,12 +1329,9 @@ class InvoiceDetailView(LoginRequiredMixin, DetailView): else settings.PRE_EU_VAT_RATE ) ) - context['vm']['vat'] = vat - context['vm']['price'] = price - context['vm']['discount'] = discount - context['vm']['vat_percent'] = vat_percent - context['vm']['total_price'] = ( - price + vat - discount['amount'] + context['vm']["after_eu_vat_intro"] = ( + True if obj.order.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT + else False ) except TypeError: logger.error("Type error. Probably we "