diff --git a/gestaoRaul/balcao/templates/viewBalcao.html b/gestaoRaul/balcao/templates/viewBalcao.html index f927cd8..f9b3e89 100644 --- a/gestaoRaul/balcao/templates/viewBalcao.html +++ b/gestaoRaul/balcao/templates/viewBalcao.html @@ -1,13 +1,12 @@ {% extends "base.html" %} {% load static %} - {% block 'title' %} + {{comanda.name}} + {% endblock %} - - {% block 'head' %} {% endblock %} @@ -16,117 +15,85 @@ {% block 'body' %} -
+
-

Venda Balcão

-
+

Venda Balcão

+
- + - + -
+
- - - - - - - {% for item in consumo%} - - - - - - - - - - {% endfor %} - +
ProdutoPreço
{{item.product.name}}R$ {{item.product.price}}
- + + - - + {% for item in consumo%} + + + + + - + + {% endfor %} + + + + + + + +
Total R$ {{total}}ProdutoPreço
{{item.product.name}}R$ {{item.product.price}}
Total R$ {{total}}
-
- -
-

Buscar Produto

-
- -
-
-
- {% for product in products %} + +

Buscar Produto

+
+ +
+
+
+ {% for product in products %} + {% if forloop.counter0 == 0 %} - {% if forloop.counter0 == 0 %} +
+ + + {{product.name}}
+

+ R$ {{product.price}} +
-
- - - {{product.name}}

- R$ {{product.price}} -
+ {% else %} - {% else %} +
+ {{product.name}}
+ R$ {{product.price}} +
-
- {{product.name}}
- R$ {{product.price}} -
+ {% endif %} - {% endif %} + {% endfor %} +
- {% endfor %} -
- -
+
@@ -134,26 +101,28 @@
- + + + - + diff --git a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-313.pyc b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-313.pyc index a6f9329..4583203 100644 Binary files a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-313.pyc and b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-313.pyc differ diff --git a/gestaoRaul/comandas/htmx_views.py b/gestaoRaul/comandas/htmx_views.py index 15b24c8..15c1ad3 100644 --- a/gestaoRaul/comandas/htmx_views.py +++ b/gestaoRaul/comandas/htmx_views.py @@ -61,4 +61,4 @@ def paymentComanda(request, comanda_id): pagamento.save() comanda.status = 'CLOSED' comanda.save() - return redirect('comandas') + return redirect('/comandas') diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index e50ae26..5f5b3f1 100644 Binary files a/gestaoRaul/db.sqlite3 and b/gestaoRaul/db.sqlite3 differ diff --git a/gestaoRaul/templates/base.html b/gestaoRaul/templates/base.html index 9befc85..d07e3bf 100644 --- a/gestaoRaul/templates/base.html +++ b/gestaoRaul/templates/base.html @@ -43,13 +43,13 @@
- +
diff --git a/gestaoRaul/templates/static/comandas/js/viewbalcao.js b/gestaoRaul/templates/static/comandas/js/viewbalcao.js index a5c59fb..f1e837f 100644 --- a/gestaoRaul/templates/static/comandas/js/viewbalcao.js +++ b/gestaoRaul/templates/static/comandas/js/viewbalcao.js @@ -2,14 +2,26 @@ function modal_payment_comanda() { document.getElementById('payment-comanda').style.display = 'block'; + recebido = document.getElementById('recebido') + recebido.focus() +} + +function troco(){ + recebido = document.getElementById('recebido').value + total = document.getElementById('first-total').innerHTML + resultado = document.getElementById('troco') + total = total.replace('R$ ','') + total = total.replace(',','.') + result = recebido - total + resultado.innerHTML = 'Troco: R$ '+result } function close_modal_payment_comanda() { document.getElementById('payment-comanda').style.display = 'none'; + document.getElementById('search-product').focus() } - function imprimirFichas() { const element = document.getElementById("list-products-balcao"); const style = `