{% 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 %} {{invoice.customer.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}}
{{invoice.customer.user.email}} {% endif %}


{% trans "Invoice summary" %}

{% if vm %} {% if line_items %} {% for line_item in line_items %} {% endfor %}
ProductPeriodQtyUnit PriceTotal
{% if line_item.description|length > 0 %}{{line_item.description}}{% elif line_item.stripe_plan.stripe_plan_name|length > 0 %}{{line_item.stripe_plan.stripe_plan_name}}{% else %}{{line_item.get_item_detail_str|safe}}{% endif %}{{ line_item.period_start | date:'Y-m-d' }} — {{ line_item.period_end | date:'Y-m-d' }}{{line_item.quantity}}{{line_item.unit_amount_in_chf}}{{line_item.amount_in_chf|floatformat:2}}
Grand Total{{total_in_chf|floatformat:2}}
{% else %}

{% 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

{% endif %} {% 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" %}: {% if invoice.order.generic_product.product_subscription_interval == 'year' %} {{invoice.order.created_at|date:'d'|ordinal}} {% trans "of" %} {{invoice.order.created_at|date:'M'}} {% trans "each year" %} {% else %} {{invoice.order.created_at|date:'d'|ordinal}} {% trans "of every month" %} {% endif %}

{% endif %}
{% endif %}

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