macao-pos/templates/sell.html

37 lines
1.1 KiB
HTML
Raw Normal View History

2017-03-21 11:26:25 +01:00
{% extends 'base.html' %}
{% block main %}
<div id="products">
{% for product in products %}
<button type="button"
onclick="addProduct({{ product.uid }})">
<span class="name">{{ product.name }}</span>
<span class="price">
€ {{ '{0:.02f}'.format(product.price / 100.0) }}
</span>
2017-03-21 11:26:25 +01:00
</button>
{% endfor %}
</div>
<div id="summary">
<div id="basket"></div>
<form id="sell" action="/sell" method="POST">
2017-03-21 11:26:25 +01:00
{% for product in products %}
<input type="hidden"
id="prod_{{ product.uid }}"
name="{{ product.uid }}"
data-name="{{ product.name }}"
data-price="{{ '{0:.02f}'.format(product.price / 100.0) }}"
value="0">
2017-03-21 11:26:25 +01:00
{% endfor %}
<p>Total: € <span id="total">0.00</span></p>
<button type="submit">Print</input>
2017-03-21 11:26:25 +01:00
</form>
</div>
2017-03-26 21:17:07 +02:00
<script type="text/javascript" src="{{ url_for('static', filename='js/sell.js') }}">
2017-03-21 11:26:25 +01:00
<script type="text/javascript">
{%- for product in products %}
2017-03-26 21:17:07 +02:00
document.getElementById('prod_{{ product.uid }}').value = 0
{%- endfor %}
2017-03-21 11:26:25 +01:00
</script>
{% endblock %}