From 94586c854a47f7569f3ef35371e50fec9d589414 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 3 Apr 2019 22:48:23 +0200 Subject: [PATCH] Add invoice detail --- hosting/templates/hosting/invoice_detail.html | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 hosting/templates/hosting/invoice_detail.html diff --git a/hosting/templates/hosting/invoice_detail.html b/hosting/templates/hosting/invoice_detail.html new file mode 100644 index 00000000..ff6ec31d --- /dev/null +++ b/hosting/templates/hosting/invoice_detail.html @@ -0,0 +1,235 @@ +{% extends "hosting/base_short.html" %} +{% load staticfiles bootstrap3 humanize i18n custom_tags %} + + +{% block content %} +
+ {% if messages %} +
+ {% for message in messages %} + {{ message }} + {% endfor %} +
+ {% endif %} + {% if not error %} +
+

+ {% + blocktrans with page_header_text=page_header_text|default:"Invoice" + %}{{page_header_text}}{% endblocktrans %} +

+ {% if invoice %} +
+ + +
+ {% endif %} +
+
+ {% if invoice %} +

+ {% trans "Invoice #" %} {{invoice.invoice_number}} +

+ {% endif %} +

+ {% trans "Date" %}: + + {% if invoice %} + {{invoice.paid_at|date:'Y-m-d h:i a'}} + {% else %} + {% now "Y-m-d h:i a" %} + {% endif %} + +

+ {% if invoice and vm %} +

+ {% trans "Status" %}: + + {% if vm.terminated_at %} + {% trans "Terminated" %} + {% elif invoice.order.status == 'Approved' %} + {% trans "Approved" %} + {% else %} + {% trans "Declined" %} + {% endif %} + +

+ {% endif %} +
+
+
+

{% trans "Billed to" %}:

+

+ {% if invoice.order %} + {{user.name}}
+ {{invoice.order.billing_address.street_address}}, + {{invoice.order.billing_address.postal_code}}
+ {{invoice.order.billing_address.city}}, + {{invoice.order.billing_address.country}} + {% endif %} +

+
+
+
+
+

{% trans "Payment method" %}:

+

+ {% if invoice.order %} + {{invoice.order.cc_brand}} {% trans "ending in" %} **** + {{invoice.order.last4}}
+ {{user.email}} + {% endif %} +

+
+
+
+

{% trans "Invoice summary" %}

+ {% if vm %} +

+ {% trans "Product" %}:  + {% if vm.name %} + {{ vm.name }} + {% endif %} +

+
+
+ {% if period_start %} +

+ {% trans "Period" %}: + + {{ period_start|date:'Y-m-d h:i a' }} - {{ period_end|date:'Y-m-d h:i a' }} + +

+ {% endif %} +

+ {% trans "Cores" %}: + {% if vm.cores %} + {{vm.cores|floatformat}} + {% else %} + {{vm.cpu|floatformat}} + {% endif %} +

+

+ {% trans "Memory" %}: + {{vm.memory}} GB +

+

+ {% trans "Disk space" %}: + {{vm.disk_size}} GB +

+
+
+
+
+ {% if vm.vat > 0 or vm.discount.amount > 0 %} +
+
+ {% if vm.vat > 0 %} +

+ {% trans "Subtotal" %} + {{vm.price|floatformat:2|intcomma}} + CHF +

+

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

+ {% endif %} + {% if vm.discount.amount > 0 %} +

+ {%trans "Discount" as discount_name %} + {{ vm.discount.name|default:discount_name + }} + - {{ vm.discount.amount + }} CHF +

+ {% endif %} +
+
+
+
+
+ {% endif %} +
+

+ {% trans "Total" %} + {% if vm.total_price + %}{{vm.total_price|floatformat:2|intcomma}}{% else + %}{{vm.price|floatformat:2|intcomma}}{% endif %} + CHF +

+
+
+ {% else %} +

+ {% trans "Product" %}:  + {{ product_name }} +

+
+
+

+ {% trans "Amount" %}: + {{total_in_chf|floatformat:2|intcomma}} + CHF +

+ {% if invoice.order.generic_payment_description %} +

+ {% trans "Description" %}: + {{invoice.order.generic_payment_description}} +

+ {% endif %} + {% if invoice.order.subscription_id %} +

+ {% trans "Recurring" %}: + {{invoice.order.created_at|date:'d'|ordinal}} + {% trans "of every month" %} +

+ {% endif %} +
+
+ {% endif %} +
+
+
+ + {% endif %} +
+ +
+ {% trans + "BACK TO LIST" %} +
+ + +{%endblock%} + +{% block js_extra %} +{% if invoice.order %} + + + + +{% endif %} +{% endblock js_extra %}