From bce47032aba2cf810a9c4214d8a2ca353787ed5f Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 23 Sep 2018 13:03:47 +0200 Subject: [PATCH] Handle generic payment separately in order_detail.html --- .../datacenterlight/order_detail.html | 127 +++++++++++------- 1 file changed, 78 insertions(+), 49 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/order_detail.html b/datacenterlight/templates/datacenterlight/order_detail.html index 49347ba2..82b5aaae 100644 --- a/datacenterlight/templates/datacenterlight/order_detail.html +++ b/datacenterlight/templates/datacenterlight/order_detail.html @@ -47,61 +47,82 @@

{% trans "Order summary" %}

-

- {% trans "Product" %}:  - {{ request.session.template.name }} -

-
-
-

- {% trans "Cores" %}: - {{vm.cpu|floatformat}} -

-

- {% trans "Memory" %}: - {{vm.memory|intcomma}} GB -

-

- {% trans "Disk space" %}: - {{vm.disk_size|intcomma}} GB -

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

+ {% trans "Amount" %}: + CHF {{generic_payment_details.amount|floatformat:2|intcomma}} +

+

+ {% trans "Description" %}: + {{generic_payment_details.description}} +

+ {% if generic_payment_details.recurring %}

- {% 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 + {% trans "Recurring" %}: + Yes

{% endif %}
-
-
+ {% else %} +

+ {% trans "Product" %}:  + {{ request.session.template.name }} +

+
+
+

+ {% trans "Cores" %}: + {{vm.cpu|floatformat}} +

+

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

+

+ {% trans "Disk space" %}: + {{vm.disk_size|intcomma}} 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" %} + {{vm.total_price|floatformat:2|intcomma}} CHF +

+
{% endif %} -
-

- {% trans "Total" %} - {{vm.total_price|floatformat:2|intcomma}} CHF -

-
-

@@ -109,7 +130,15 @@ {% csrf_token %}
-
{% blocktrans with vm_total_price=vm.total_price|floatformat:2|intcomma %}By clicking "Place order" this plan will charge your credit card account with {{vm_total_price}} CHF/month{% endblocktrans %}.
+ {% if generic_payment_details %} + {% if generic_payment_details.recurring %} +
{% blocktrans with total_price=generic_payment_details.amount|floatformat:2|intcomma %}By clicking "Place order" this plan will charge your credit card account with {{total_price}} CHF/month{% endblocktrans %}.
+ {% else %} +
{% blocktrans with total_price=generic_payment_details.amount|floatformat:2|intcomma %}By clicking "Place order" this payment will charge your credit card account with a one time amount of {{total_price}} CHF{% endblocktrans %}.
+ {% endif %} + {% else %} +
{% blocktrans with vm_total_price=vm.total_price|floatformat:2|intcomma %}By clicking "Place order" this plan will charge your credit card account with {{vm_total_price}} CHF/month{% endblocktrans %}.
+ {% endif %}