diff --git a/gestaoRaul/balcao/templates/viewBalcao.html b/gestaoRaul/balcao/templates/viewBalcao.html index 7dd83b1..5d1958e 100644 --- a/gestaoRaul/balcao/templates/viewBalcao.html +++ b/gestaoRaul/balcao/templates/viewBalcao.html @@ -36,15 +36,15 @@ - - + + {% for item in consumo%} - + {% endfor %} diff --git a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc index c2f15ee..6eb2beb 100644 Binary files a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc and b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc differ diff --git a/gestaoRaul/comandas/htmx_views.py b/gestaoRaul/comandas/htmx_views.py index 849a4f6..7a4c1b8 100644 --- a/gestaoRaul/comandas/htmx_views.py +++ b/gestaoRaul/comandas/htmx_views.py @@ -27,7 +27,7 @@ def listProduct(request, comanda_id): for p in allProducts: if p.active == True: products.append(p) - return render(request, "htmx_components/htmx_list_products.html", {"products": products,'comanda_id':comanda_id}) + return render(request, "htmx_components/comandas/htmx_list_products.html", {"products": products,'comanda_id':comanda_id}) @group_required(groupName='Garçom') def addProduct(request, product_id, comanda_id): @@ -36,12 +36,13 @@ def addProduct(request, product_id, comanda_id): product_comanda.save() product = Product.objects.get(id=product_id) comanda = Comanda.objects.get(id=comanda_id) + parcial = Payments.objects.filter(comanda=comanda) if product.cuisine == True: order = Order(id_comanda=comanda, id_product=product, productComanda=product_comanda, obs='') order.save() consumo = ProductComanda.objects.filter(comanda=comanda_id) total = somar(consumo,comanda) - return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total, 'comanda':comanda}) + return render(request, "htmx_components/comandas/htmx_list_products_in_comanda.html",{'parcials':parcial,'consumo': consumo, 'total': total, 'comanda':comanda}) @group_required(groupName='Garçom') def editOrders(request, productComanda_id, obs): @@ -55,10 +56,11 @@ def editOrders(request, productComanda_id, obs): def removeProductComanda(request, productComanda_id): product_comanda = ProductComanda.objects.get(id=productComanda_id) comanda = Comanda.objects.get(id= product_comanda.comanda.id) + parcial = Payments.objects.filter(comanda=comanda) consumo = ProductComanda.objects.filter(comanda=comanda) product_comanda.delete() total = somar(consumo, comanda) - return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total, 'comanda':comanda}) + return render(request, "htmx_components/comandas/htmx_list_products_in_comanda.html",{'parcials':parcial,'consumo': consumo, 'total': total, 'comanda':comanda}) @group_required(groupName='Garçom') def closeComanda(request, comanda_id): diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index 0d01c21..7d84bdf 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -76,8 +76,8 @@ Detalhes {{comanda.name}}
ProdutoPreçoProdutoPreço
{{item.product.name}} R$ {{item.product.price}}
- - + + {% for item in consumo%} @@ -117,11 +117,13 @@ Detalhes {{comanda.name}} {% endif %} {% endfor %} + {% if parcials%} + + {% endif %} {% for parcial in parcials %} - - - + + {% endfor %} @@ -130,7 +132,7 @@ Detalhes {{comanda.name}} - +
ProdutoPreçoProdutoPreço
Pagamentos parciais
{{parcial.datetime}}R$ -{{parcial.value}}{{parcial.description}}{{parcial.description}} ás {{parcial.datetime|date:"H:i"}}R$ -{{parcial.value}}
Total R$ {{total}}Total R$ {{total}}
@@ -201,7 +203,7 @@ Detalhes {{comanda.name}}

Pagamento Parcial

{% csrf_token %} - +