From fe00c4da90022204e186245ad46bfb47099ad79f Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Tue, 1 Jul 2025 12:28:47 -0300 Subject: [PATCH] =?UTF-8?q?refactor:=20remo=C3=A7=C3=A3o=20do=20htmx=20do?= =?UTF-8?q?=20excluir=20item=20da=20comanda=20|=20feedback=20da=20exclus?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/htmx_views.cpython-312.pyc | Bin 4882 -> 5016 bytes .../comandas/__pycache__/urls.cpython-312.pyc | Bin 1871 -> 1872 bytes gestaoRaul/comandas/htmx_views.py | 14 +- .../comandas/templates/viewcomanda.html | 20 +-- gestaoRaul/comandas/urls.py | 2 +- gestaoRaul/db.sqlite3 | Bin 356352 -> 356352 bytes .../htmx_list_products_in_comanda.html | 142 +++++++++--------- gestaoRaul/templates/static/base.css | 7 +- .../static/comandas/css/viewcomanda.css | 94 ------------ .../static/comandas/js/viewcomanda.js | 61 +++++++- 10 files changed, 151 insertions(+), 189 deletions(-) diff --git a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-312.pyc b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-312.pyc index 6c5f6336a3d15278b898e5855457f00e56248d41..d3dc32f0cdc374c7ab22f959220682e327fb5938 100644 GIT binary patch delta 567 zcmbQFHbb57G%qg~0}zycNY0qgzmZRci7AeGvI)~=X4ewF$@BSSC#y5BVxCwcG5J29 z;bc~pX_Fn9;TN5deuKyJhM3F^aXBawll{oa!Yluol}$k50|OhU z!Uq9n22S3|jGXTn4JLo!l$A6Cy6hHjQEGlcYMyg`Zem_aVv!wC%y+UHmm{Oa<@@4_41^`wumIeR- delta 636 zcmbQCK1q%5G%qg~0}v>lNy^CO+sLQF#P^DcfnhpB3S$aWCSxtr{yj zO`gMIJK3GNi@CW(0?3w~e1TJBGAqk8ML1GsX%q@QU<%cY4p^U%`A?Lgy-v?gusoUYYAWN*8&QuJEWl;TN5denCFwLVE58 z28L=zCng}}#}o>p5}7hUR0&fx(?L&kPI#wIDIhTBZjaJd@iw-f?YysG8cBt7PQ6CTia&wUzi0}XrzCfZF zq!Q=_5P*0CW`96pQF3NtPEi0*LEK~&!5*MLHVVozYJ&nF?7Je6)4=j88H%hxY_JD7 pY;yBcN^?@}isB~!6msO3VdVYH%)q4jfeFa^=rGw+*qa5U8UP;bl!E{O diff --git a/gestaoRaul/comandas/__pycache__/urls.cpython-312.pyc b/gestaoRaul/comandas/__pycache__/urls.cpython-312.pyc index b0a2808edba2a54cafce37ceb1f82ee41fc76b21..60191b4a72a70c92f0dcfa46d14261a6ba04167e 100644 GIT binary patch delta 70 zcmX@lcY%-hG%qg~0}zNxCuf*!e*wtH=upWmj0rC;ws#1pww47x4f9 delta 69 zcmcb>cb<>;G%qg~0}$*yk(6P)k=KSrRHrC4H@_@3peR43G`Yk%KQ}QiC2?~+OD_|@ Y`3|Y;mJt^%BQC_3USTPl{F^Nl02>P!`2YX_ diff --git a/gestaoRaul/comandas/htmx_views.py b/gestaoRaul/comandas/htmx_views.py index 3c5a7ee..1787fee 100644 --- a/gestaoRaul/comandas/htmx_views.py +++ b/gestaoRaul/comandas/htmx_views.py @@ -53,12 +53,22 @@ def removeProductComanda(request, productComanda_id): 'id':order.id, 'speak': f'Pedido cancelado! {order.id_product.name}.' }) - asyncio.run(enviar_mensagem(msg)) + # asyncio.run(enviar_mensagem(msg)) # order.delete() + consumo = ProductComanda.objects.filter(comanda=comanda) + valores = somar(consumo,comanda) else: product_comanda.delete() + consumo = ProductComanda.objects.filter(comanda=comanda) + valores = somar(consumo,comanda) - return render(request, "htmx_components/comandas/htmx_list_products_in_comanda.html",{'config':config, 'valores': valores,'parcials':parcial,'consumo': consumo, 'comanda':comanda}) + return render(request, + "htmx_components/comandas/htmx_list_products_in_comanda.html", + {'config':config, + 'valores': valores, + 'parcials':parcial, + 'consumo': consumo, + 'comanda':comanda}) else: pass diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index 6af1eb6..04d886a 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -103,7 +103,7 @@ Detalhes {{comanda.name}} {% for item in consumo%} - + {{item.product.name}} @@ -131,13 +131,12 @@ Detalhes {{comanda.name}} {% if comanda.status != 'OPEN'%} {% else %} + + > {% endif %} @@ -180,30 +179,21 @@ Detalhes {{comanda.name}} - - - -
- + -