From 731fef8ad9c8735f3b746a5e9caeacd63192ae93 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 16 Apr 2018 04:39:21 +0200 Subject: [PATCH] Show VAT details in hosting/order_details if it is set --- hosting/templates/hosting/order_detail.html | 6 ++++++ hosting/views.py | 1 + 2 files changed, 7 insertions(+) diff --git a/hosting/templates/hosting/order_detail.html b/hosting/templates/hosting/order_detail.html index f5ee80b6..099aaab8 100644 --- a/hosting/templates/hosting/order_detail.html +++ b/hosting/templates/hosting/order_detail.html @@ -127,6 +127,12 @@ {% trans "Disk space" %}: {{vm.disk_size}} GB

+ {% if vm.vat > 0 %} +

+ {% trans "VAT" %}: + {{vm.vat|floatformat:2|intcomma}} CHF +

+ {% endif %}

{% trans "Total" %} {{vm.price|intcomma}} CHF diff --git a/hosting/views.py b/hosting/views.py index 56f9386a..1f531784 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -756,6 +756,7 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView): pricing_name=(obj.vm_pricing.name if obj.vm_pricing else 'default') ) + context['vm']['vat'] = vat context['vm']['price'] = price + vat context['subscription_end_date'] = vm_detail.end_date() except VMDetail.DoesNotExist: