{% 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 order %}
{% endif %}
{% if order %}

{% trans "Order #" %} {{order.id}}

{% endif %}

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

{% if order and vm %}

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

{% endif %}

{% trans "Billed to" %}:

{% if order %} {{user.name}}
{{order.billing_address.street_address}}, {{order.billing_address.postal_code}}
{{order.billing_address.city}}, {{order.billing_address.country}} {% if order.billing_address.vat_number %}
{% trans "VAT Number" %} {{order.billing_address.vat_number}} {% endif %} {% else %} {% with request.session.billing_address_data as billing_address %} {{billing_address.cardholder_name}}
{{billing_address.street_address}}, {{billing_address.postal_code}}
{{billing_address.city}}, {{billing_address.country}} {% if billing_address.vat_number %}
{% trans "VAT Number" %} {{billing_address.vat_number}} {% endif %} {% endwith %} {% endif %}


{% trans "Payment method" %}:

{% if order %} {{order.cc_brand}} {% trans "ending in" %} **** {{order.last4}}
{{user.email}} {% else %} {{cc_brand|default:_('Credit Card')}} {% trans "ending in" %} ****{{cc_last4}}
{% trans "Expiry" %} {{cc_exp_year}}/{{cc_exp_month}}
{% if request.user.is_authenticated %} {{request.user.email}} {% else %} {{request.session.user.email}} {% endif %} {% endif %}


{% trans "Order summary" %}

{% if vm %}

{% trans "Product" %}:  {% if vm.name %} {{ vm.name }} {% else %} {{ request.session.template.name }} {% endif %}

{% if vm.created_at %}

{% trans "Period" %}: {{ vm.created_at|date:'Y-m-d h:i a' }} - {{ subscription_end_date|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

{% if vm.after_eu_vat_intro %} {% trans "VAT for" %} {{vm.vat_country}} ({{vm.vat_percent}}%) : {% else %} {% trans "VAT" %} ({{ vm.vat_percent|floatformat:2|intcomma }}%) {% endif %} {{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" %}: {{order.price|floatformat:2|intcomma}} CHF

{% if order.generic_payment_description %}

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

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

{% trans "Recurring" %}: {% if order.generic_product.product_subscription_interval == 'year' %} {{order.created_at|date:'d'|ordinal}} {% trans "of" %} {{order.created_at|date:'b'|title}} {% trans "each year" %} {% else %} {{order.created_at|date:'d'|ordinal}} {% trans "of every month" %} {% endif %}

{% endif %}
{% endif %}

{% if not order %} {% block submit_btn %}
{% csrf_token %}
{% blocktrans with vm_price=vm.total_price|floatformat:2|intcomma %}By clicking "Place order" you agree to our Terms of Service and this plan will charge your credit card account with {{ vm_price }} CHF/month.{% endblocktrans %}.
{% endblock submit_btn %} {% else %} {% endif %} {% endif %}
{% if order %}
{% trans "BACK TO LIST" %}
{% endif %} {% if not order %} {% endif %} {%endblock%} {% block js_extra %} {% if order %} {% endif %} {% endblock js_extra %}