2 Commits
Author SHA1 Message Date
nikolark 8a94db2675 Reciept updates 2012-08-22 19:32:06 +02:00
nikolark 6b2dc28ea3 Reciept 2012-08-16 19:56:33 +02:00
5 changed files with 40 additions and 3 deletions

No files matched your search

+1
View File
@@ -13,4 +13,5 @@ urlpatterns = patterns('main.views',
url(r'^stats/products/(?P<product>[0-9]+)/$', 'stats_products', name='stats-product'),
url(r'^products/(?P<product_id>[0-9]+)/$', 'products', name='json-product'),
url(r'^products/$', 'products', name='json-products'),
url(r'^order/(?P<order>[0-9]+)/$', 'order_reciept', name='order_reciept'),
)
+9
View File
@@ -263,3 +263,12 @@ def users_format_js(users):
users_js = u"[{0}]".format(u",".join(users_js))
return users_js
def order_reciept(request, order):
order = Order.objects.get(pk=order)
orderlines = OrderLine.objects.filter(order=order)
for line in orderlines:
line.tot = line.amount * line.unit_price
print order.order_sum
return render_to_response('order_reciept.html', locals(), context_instance=RequestContext(request))
+1 -1
View File
@@ -41,7 +41,7 @@
<td>{% for line in order.orderline_set.all %}
<span class="amount">{{ line.amount}}</span> <a href="#" class="product" title="{{ line.unit_price}} per">{{ line.product }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
<td>{{ order.order_sum }}</td>
<td>{% include "modal-delete-order.html" with order=order %}<a class="btn btn-danger" data-toggle="modal" href="#modal-order-{{order.id}}"><i class="icon-trash icon-white"></i> Slett</a></td>
<td><a class="btn btn-info" data-toggle="modal" href="{% url order_reciept order=order.id %} "><i class="icon-list-alt icon-white"></i> Kvittering</a> {% include "modal-delete-order.html" with order=order %}<a class="btn btn-danger" data-toggle="modal" href="#modal-order-{{order.id}}"><i class="icon-trash icon-white"></i> Slett</a></td>
</tr>
{% endfor %}
</tbody>
+2 -2
View File
@@ -7,11 +7,11 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a href="/" class="brand">Biceps Bar System - BBS</a>
<a href="/" class="brand">KAKtoffelbodens flotte campingkasse [BBS]</a>
<div class="nav-collapse">
<ul class="nav">
{% if active %}
<li class="{% if active = "register" %}active{% endif %}"><a href="/register"><i class="icon-home icon-white"></i> Kjøp drikke</a></li>
<li class="{% if active = "register" %}active{% endif %}"><a href="/register"><i class="icon-home icon-white"></i> Kjøp</a></li>
<li class="{% if active = "deposit" %}active{% endif %}"><a href="/deposit">Sett inn penger</a></li>
<li class="{% if active = "log" %}active{% endif %}"><a href="/log"> Vis logg</a></li>
<li class="{% if active = "stats" %}active{% endif %}"><a href="/stats"> Vis statistikk</a></li>
+27
View File
@@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block content %}
<section id="reciept" class="row-fluid">
<section class="row-fluid">
<div class="span6">
<h2>KAKtoffelboden</h2>
<p>
Dato: {{ order.created }}<br />
Kvitteringsid: {{ order.pk }}
</p>
<h4>Ordre</h4>
<ul>
{% for line in orderlines %}
<li>
{{line.product }} {{line.amount}} stk * {{line.unit_price}} = {{line.tot}}
</li>
{% endfor %}
</ul>
<br />
<strong>Totalt: {{order.order_sum }}</strong>
<p>Slemdalsveien 15, 0369 OSLO<br />
Telefon: 48105885</p>
</div>
</section>
{% endblock %}