Update counters and some views

This commit is contained in:
Skia
2016-07-21 20:03:31 +02:00
parent 724f3d8d6f
commit 1f3e186e27
10 changed files with 60 additions and 32 deletions

View File

@ -25,6 +25,7 @@
<h5>{% trans %}Customer{% endtrans %}</h5>
<p>{{ customer.user.get_display_name() }}, {{ customer.amount }} €</p>
</div>
{% if counter.type == 'BAR' %}
<div>
<h5>{% trans %}Refilling{% endtrans %}</h5>
<form method="post" action="{{ url('counter:click', counter_id=counter.id, user_id=customer.user.id) }}">
@ -34,6 +35,7 @@
<input type="submit" value="{% trans %}Go{% endtrans %}" />
</form>
</div>
{% endif %}
<div>
<h5>{% trans %}Selling{% endtrans %}</h5>
{% if request.session['not_enough'] %}
@ -47,7 +49,7 @@
</form>
<p>{% trans %}Basket: {% endtrans %}</p>
<ul>
{% for id,infos in request.session['basket'].items() %}
{% for id,infos in request.session['basket']|dictsort %}
{% set product = counter.products.filter(id=id).first() %}
{% set s = infos['qty'] * infos['price'] / 100 %}
<li>{{ del_product(id, '-') }} {{ infos['qty'] }} {{ add_product(id, '+') }} {{ product.name }}: {{ "%0.2f"|format(s) }} €</li>

View File

@ -38,6 +38,7 @@
<p>{% trans %}Please, login{% endtrans %}</p>
{% endif %}
</div>
{% if counter.type == 'BAR' %}
<div>
<h3>{% trans %}Barman: {% endtrans %}</h3>
<ul>
@ -51,6 +52,7 @@
<p><input type="submit" value="{% trans %}login{% endtrans %}" /></p>
</form>
</div>
{% endif %}
{% endblock %}