From aed3b906a4679328fad74521fa7bfd7c3841f345 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Fri, 20 Dec 2024 10:11:50 -0300 Subject: [PATCH] feat: update status comanda for PAYING --- .../__pycache__/htmx_views.cpython-310.pyc | Bin 1347 -> 1557 bytes .../comandas/__pycache__/urls.cpython-310.pyc | Bin 697 -> 763 bytes .../__pycache__/views.cpython-310.pyc | Bin 1362 -> 1362 bytes gestaoRaul/comandas/htmx_views.py | 10 ++++++++- gestaoRaul/comandas/templates/comandas.html | 8 ++++++- .../comandas/templates/viewcomanda.html | 20 ++++++++++++++++-- gestaoRaul/comandas/urls.py | 3 +-- gestaoRaul/comandas/views.py | 3 ++- gestaoRaul/db.sqlite3 | Bin 192512 -> 192512 bytes 9 files changed, 37 insertions(+), 7 deletions(-) diff --git a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc index 26484d608779ae13ff429fb52eb1195b8887a2bd..914d6bbf106881103f24cd102d99eaea0b173387 100644 GIT binary patch delta 287 zcmX@iHI;`qpO=@50SHvGQ`7%WYQ&d*KEOGzx&WGi9;N)&N}2#~XGu@#pjmXsD3NrFVY zK~`xp7x98P93VmjMDW820U+xZPjXIvajG-KNO_=0F-R#NGaDlZ5Eg-4>8Hsvc?(Mf f8^}LJDwBCx)r9zfOaTS~CLTr(W)4;kE*?$*-S9Jr delta 76 zcmbQrbC`=apO=@50SMB{6Vury^2#!LOw{&d31-mb-q=vb%&0l}Kl3(r1)u^yP43C{ ctPzX~lkc*s3Ge_#1Q-OEco;dDIaqnP0FQ4D!TlIQNQ-o5Pvv^X3Q`mc% z(^;Z;Q#n$3%^9LNQbd9oG(|V=QDiizl1xI&pqj*v|QhCf7qBv57 uf*CZ0H=a^tWcJhKoh;21GP#6Fl#L&#xQKspKa(G$#N>NS;w&tGcsKzQX%u(> diff --git a/gestaoRaul/comandas/__pycache__/views.cpython-310.pyc b/gestaoRaul/comandas/__pycache__/views.cpython-310.pyc index 6bb1871f228a664eb163928b7414100af7038e75..6d10ef0c0db52725d9bfac318538bae2c5f176b7 100644 GIT binary patch delta 22 ccmcb_b%~2NpO=@50SK07rKV?X<{9 diff --git a/gestaoRaul/comandas/htmx_views.py b/gestaoRaul/comandas/htmx_views.py index 658a6d8..6aa19c7 100644 --- a/gestaoRaul/comandas/htmx_views.py +++ b/gestaoRaul/comandas/htmx_views.py @@ -26,4 +26,12 @@ def removeProductComanda(request, productComanda_id): total = 0 for produto in consumo: total += produto.product.price - return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total}) \ No newline at end of file + return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total}) + +def closeComanda(request, comanda_id): + # id = request.POST.get('id-comanda') + # comanda_id = int(id) + comanda = Comanda.objects.get(id=comanda_id) + comanda.status = "PAYING" + comanda.save() + return redirect('comandas') \ No newline at end of file diff --git a/gestaoRaul/comandas/templates/comandas.html b/gestaoRaul/comandas/templates/comandas.html index 67f4798..201c60b 100644 --- a/gestaoRaul/comandas/templates/comandas.html +++ b/gestaoRaul/comandas/templates/comandas.html @@ -20,7 +20,13 @@ Comandas
-
{{comanda.name}} | {{comanda.mesa}}

+
{{comanda.name}} | {{comanda.mesa}}

Aberta ás: {{comanda.dt_open|date:"H:i"}}

diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index 3bb8ae1..45a0bd4 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -21,8 +21,24 @@ Detalhes {{comanda.name}}
- - + + + + + + diff --git a/gestaoRaul/comandas/urls.py b/gestaoRaul/comandas/urls.py index 2e2f6dd..3501964 100644 --- a/gestaoRaul/comandas/urls.py +++ b/gestaoRaul/comandas/urls.py @@ -19,8 +19,7 @@ htmx_urlpatterns = [ path('listProduct//', htmx_views.listProduct, name='listProduct'), path('addProduct//', htmx_views.addProduct, name='addProduct'), path('removeProductComanda/', htmx_views.removeProductComanda, name='removeProductComanda'), - # path('removeProduct/', views.removeProduct, name='removeProduct'), - + path('closeComanda/', htmx_views.closeComanda, name='closeComanda'), ] urlpatterns += htmx_urlpatterns \ No newline at end of file diff --git a/gestaoRaul/comandas/views.py b/gestaoRaul/comandas/views.py index 6941869..bdba303 100644 --- a/gestaoRaul/comandas/views.py +++ b/gestaoRaul/comandas/views.py @@ -33,4 +33,5 @@ def createComanda(request): comanda = Comanda(name=name, mesa=mesa) comanda.save() - return redirect('comandas') \ No newline at end of file + return redirect('comandas') + diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index d6555ad98cc717b4debd99064cfdc7b71e5ee540..710ba1ea68c0ecaa74fcd851b48e463228cefdf1 100644 GIT binary patch delta 104 zcmZp8z}@hGdxA9M|A{irjQ<-GS`!$zCNM43=j6Z0z{6X{z+1MR%YZ3|ms_8alfjWe zl7W*`a{7f^jA8=jCI-f7r8$Xt`2miRo__Azm)kOFF>y06Fz7?niGtN_|76d^w*dfQ CtQ}VX delta 74 zcmV-Q0JZ;s;0u7@3y>QD{*fF*0settg<{93=O9M57D;@Fam51lTZ*b gx2HV02u%Y2^E)tJpv%N{67K&uybw|0ssI2