Add hosting bill view, model and urls
This commit is contained in:
parent
9884eefa19
commit
2ff8b9e4a5
9 changed files with 330 additions and 3 deletions
93
hosting/templates/hosting/bill_detail.html
Normal file
93
hosting/templates/hosting/bill_detail.html
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{% extends "hosting/base_short.html" %}
|
||||
{% load staticfiles bootstrap3 %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
|
||||
<h1> {{ bill }} </h1>
|
||||
<div class="container">
|
||||
{# Adress bar #}
|
||||
<div class="row">
|
||||
<div class="invoice-title">
|
||||
<h2>{% trans "Invoice"%}</h2><h3 class="pull-right">{% trans "Order #"%} {{bill.id}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<address>
|
||||
{{bill.customer.user.name}}<br>
|
||||
{{bill.billing_address.street_address}},{{bill.billing_address.postal_code}}<br>
|
||||
{{bill.billing_address.city}}, {{bill.billing_address.country}}.
|
||||
</address>
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<address>
|
||||
{% trans "ungleich GmbH" %}<br>
|
||||
{% trans "buchhaltung@ungleich.ch" %}<br>
|
||||
{% trans "Hauptstrasse 14"%}<br>
|
||||
{% trans "CH-8775 Luchsingen"%}<br>
|
||||
{% trans "Mwst-Nummer: CHE-109.549.333 MWST"%}<br>
|
||||
|
||||
</address>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<table class="table table-bordered">
|
||||
{# Bill header #}
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Cores</th>
|
||||
<th>Memory</th>
|
||||
<th>Disk Size</th>
|
||||
<th>Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{# Bill items#}
|
||||
{% for vm in vms %}
|
||||
<tr>
|
||||
<td>{{ vm.name }}</td>
|
||||
<td>{{ vm.cores }}</td>
|
||||
<td>{{ vm.memory }}</td>
|
||||
<td>{{ vm.disk_size }}</td>
|
||||
<td>{{ vm.price }}</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{# Bill total#}
|
||||
<tr>
|
||||
<td> {% trans "Total:" %} </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> {% trans "Brutto" %} </td>
|
||||
<td> {% trans "Netto" %} </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
{# Bill Footer #}
|
||||
<div class="row">
|
||||
{% trans "Alles Preise in CHF mit 8% Mehrwertsteuer." %}
|
||||
{% trans "Betrag zahlbar innerhalb von 30 Tagen ab Rechnungseingang." %}
|
||||
{% trans "Kontoverbindung:" %}
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{% trans "IBAN:" %}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{% trans "BIC:" %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{% trans "CH02 ............" %}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{% trans "POFICHBEXXX" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
60
hosting/templates/hosting/bills.html
Normal file
60
hosting/templates/hosting/bills.html
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{% extends "hosting/base_short.html" %}
|
||||
{% load staticfiles bootstrap3 %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div>
|
||||
<div class="container orders-container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<table class="table borderless table-hover">
|
||||
<h3>{% trans "Customers"%}</h3>
|
||||
<br/>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Name"%}</th>
|
||||
<th>{% trans "Email"%}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td>{{ user.name}}</td>
|
||||
<td>{{ user.email}} CHF</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-default"><a
|
||||
href="{% url 'hosting:bills' user.id %}">{% trans "View Bill"%}</a>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if is_paginated %}
|
||||
<div class="pagination">
|
||||
<span class="page-links">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="{{ request.path }}?page={{ page_obj.previous_page_number }}">{% trans "previous"%}</a>
|
||||
{% endif %}
|
||||
<span class="page-current">
|
||||
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
|
||||
</span>
|
||||
{% if page_obj.has_next %}
|
||||
<a href="{{ request.path }}?page={{ page_obj.next_page_number }}">{% trans "next"%}</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue