Refactor PRE_EU_VAT_RATE + fix >= for first_vm_id_after_eu_vat
This commit is contained in:
parent
744e76c5df
commit
a6695a103f
2 changed files with 14 additions and 7 deletions
|
@ -727,7 +727,9 @@ AUTH_SEED = env('AUTH_SEED')
|
||||||
AUTH_REALM = env('AUTH_REALM')
|
AUTH_REALM = env('AUTH_REALM')
|
||||||
OTP_SERVER = env('OTP_SERVER')
|
OTP_SERVER = env('OTP_SERVER')
|
||||||
OTP_VERIFY_ENDPOINT = env('OTP_VERIFY_ENDPOINT')
|
OTP_VERIFY_ENDPOINT = env('OTP_VERIFY_ENDPOINT')
|
||||||
|
|
||||||
FIRST_VM_ID_AFTER_EU_VAT = int_env('FIRST_VM_ID_AFTER_EU_VAT')
|
FIRST_VM_ID_AFTER_EU_VAT = int_env('FIRST_VM_ID_AFTER_EU_VAT')
|
||||||
|
PRE_EU_VAT_RATE = float(env('PRE_EU_VAT_RATE'))
|
||||||
|
|
||||||
|
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
|
|
@ -859,8 +859,8 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView):
|
||||||
if obj.vm_pricing else 'default'),
|
if obj.vm_pricing else 'default'),
|
||||||
vat_rate= (
|
vat_rate= (
|
||||||
user_country_vat_rate * 100
|
user_country_vat_rate * 100
|
||||||
if obj.vm_id > settings.FIRST_VM_ID_AFTER_EU_VAT
|
if obj.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT
|
||||||
else 7.7
|
else settings.PRE_EU_VAT_RATE
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
context['vm']["after_eu_vat_intro"] = (
|
context['vm']["after_eu_vat_intro"] = (
|
||||||
|
@ -893,8 +893,8 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView, FormView):
|
||||||
if obj.vm_pricing else 'default'),
|
if obj.vm_pricing else 'default'),
|
||||||
vat_rate=(
|
vat_rate=(
|
||||||
user_country_vat_rate * 100
|
user_country_vat_rate * 100
|
||||||
if obj.vm_id > settings.FIRST_VM_ID_AFTER_EU_VAT
|
if obj.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT
|
||||||
else 7.7
|
else settings.PRE_EU_VAT_RATE
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
context['vm']["after_eu_vat_intro"] = (
|
context['vm']["after_eu_vat_intro"] = (
|
||||||
|
@ -1293,8 +1293,8 @@ class InvoiceDetailView(LoginRequiredMixin, DetailView):
|
||||||
if obj.order.vm_pricing else 'default'),
|
if obj.order.vm_pricing else 'default'),
|
||||||
vat_rate=(
|
vat_rate=(
|
||||||
user_country_vat_rate * 100
|
user_country_vat_rate * 100
|
||||||
if obj.order.vm_id > settings.FIRST_VM_ID_AFTER_EU_VAT
|
if obj.order.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT
|
||||||
else 7.7
|
else settings.PRE_EU_VAT_RATE
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
context['vm']["after_eu_vat_intro"] = (
|
context['vm']["after_eu_vat_intro"] = (
|
||||||
|
@ -1322,7 +1322,12 @@ class InvoiceDetailView(LoginRequiredMixin, DetailView):
|
||||||
ssd_size=context['vm']['disk_size'],
|
ssd_size=context['vm']['disk_size'],
|
||||||
memory=context['vm']['memory'],
|
memory=context['vm']['memory'],
|
||||||
pricing_name=(obj.order.vm_pricing.name
|
pricing_name=(obj.order.vm_pricing.name
|
||||||
if obj.order.vm_pricing else 'default')
|
if obj.order.vm_pricing else 'default'),
|
||||||
|
vat_rate=(
|
||||||
|
user_country_vat_rate * 100
|
||||||
|
if obj.order.vm_id >= settings.FIRST_VM_ID_AFTER_EU_VAT
|
||||||
|
else settings.PRE_EU_VAT_RATE
|
||||||
|
)
|
||||||
)
|
)
|
||||||
context['vm']['vat'] = vat
|
context['vm']['vat'] = vat
|
||||||
context['vm']['price'] = price
|
context['vm']['price'] = price
|
||||||
|
|
Loading…
Reference in a new issue