Make invoice for generic payment showable
This commit is contained in:
parent
d99271f71d
commit
a90bec98ec
2 changed files with 132 additions and 106 deletions
|
@ -39,7 +39,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
{% if order %}
|
{% if order and vm %}
|
||||||
<p>
|
<p>
|
||||||
<strong>{% trans "Status" %}: </strong>
|
<strong>{% trans "Status" %}: </strong>
|
||||||
<strong>
|
<strong>
|
||||||
|
@ -93,6 +93,7 @@
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
<h4>{% trans "Order summary" %}</h4>
|
<h4>{% trans "Order summary" %}</h4>
|
||||||
|
{% if vm %}
|
||||||
<p>
|
<p>
|
||||||
<strong>{% trans "Product" %}:</strong>
|
<strong>{% trans "Product" %}:</strong>
|
||||||
{% if vm.name %}
|
{% if vm.name %}
|
||||||
|
@ -164,6 +165,25 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<p>
|
||||||
|
<span>{% trans "Amount" %}: </span>
|
||||||
|
<strong class="pull-right">{{order.price|floatformat:2|intcomma}} CHF</strong>
|
||||||
|
</p>
|
||||||
|
{% if order.subscription_id %}
|
||||||
|
<p>
|
||||||
|
<span>{% trans "Recurring" %}: </span>
|
||||||
|
<strong class="pull-right">{{order.created_at|date:'d'|ordinal}} {% trans "of every month" %}</strong>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<hr class="thin-hr">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<hr class="thin-hr">
|
<hr class="thin-hr">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -862,7 +862,13 @@ class OrdersHostingDetailView(LoginRequiredMixin, DetailView):
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
if obj is not None:
|
if obj is not None:
|
||||||
|
if obj.generic_payment_id is not None:
|
||||||
|
# generic payment case
|
||||||
|
logger.debug("Generic payment case")
|
||||||
|
|
||||||
|
else:
|
||||||
# invoice for previous order
|
# invoice for previous order
|
||||||
|
logger.debug("Invoice of VM order")
|
||||||
try:
|
try:
|
||||||
vm_detail = VMDetail.objects.get(vm_id=obj.vm_id)
|
vm_detail = VMDetail.objects.get(vm_id=obj.vm_id)
|
||||||
context['vm'] = vm_detail.__dict__
|
context['vm'] = vm_detail.__dict__
|
||||||
|
|
Loading…
Reference in a new issue