{% 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" %} {{total_in_chf}} 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 %}