Show VAT details in hosting/order_details if it is set

This commit is contained in:
PCoder 2018-04-16 04:39:21 +02:00
parent 6cc40cb67f
commit 731fef8ad9
2 changed files with 7 additions and 0 deletions

View file

@ -127,6 +127,12 @@
<span>{% trans "Disk space" %}: </span> <span>{% trans "Disk space" %}: </span>
<span class="pull-right">{{vm.disk_size}} GB</span> <span class="pull-right">{{vm.disk_size}} GB</span>
</p> </p>
{% if vm.vat > 0 %}
<p>
<span>{% trans "VAT" %}: </span>
<span class="pull-right">{{vm.vat|floatformat:2|intcomma}} CHF</span>
</p>
{% endif %}
<p> <p>
<span>{% trans "Total" %}</span> <span>{% trans "Total" %}</span>
<span class="pull-right">{{vm.price|intcomma}} CHF</span> <span class="pull-right">{{vm.price|intcomma}} CHF</span>

View file

@ -756,6 +756,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView):
pricing_name=(obj.vm_pricing.name pricing_name=(obj.vm_pricing.name
if obj.vm_pricing else 'default') if obj.vm_pricing else 'default')
) )
context['vm']['vat'] = vat
context['vm']['price'] = price + vat context['vm']['price'] = price + vat
context['subscription_end_date'] = vm_detail.end_date() context['subscription_end_date'] = vm_detail.end_date()
except VMDetail.DoesNotExist: except VMDetail.DoesNotExist: