Show vat_percent and subtotal for vat exclusive case

This commit is contained in:
PCoder 2018-04-17 21:38:28 +02:00
commit c2513dc7c3
3 changed files with 9 additions and 4 deletions

View file

@ -67,7 +67,11 @@
</p>
{% if vm.vat > 0 %}
<p>
<span>{% trans "VAT" %}: </span>
<span>{% trans "Subtotal" %}: </span>
<span class="pull-right">{{vm.price|floatformat:2|intcomma}} CHF</span>
</p>
<p>
<span>{% trans "VAT" %} ({{ vm.vat_percent|floatformat:2|intcomma }}%): </span>
<span class="pull-right">{{vm.vat|floatformat:2|intcomma}} CHF</span>
</p>
{% endif %}

View file

@ -158,7 +158,7 @@ class IndexView(CreateView):
)
return HttpResponseRedirect(referer_url + "#order_form")
price, vat = get_vm_price_with_vat(
price, vat, vat_percent = get_vm_price_with_vat(
cpu=cores,
memory=memory,
ssd_size=storage,
@ -170,6 +170,7 @@ class IndexView(CreateView):
'disk_size': storage,
'price': price,
'vat': vat,
'vat_percent': vat_percent,
'total_price': price + vat,
'pricing_name': vm_pricing_name
}