diff --git a/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc b/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc index 408ff84..c462304 100644 Binary files a/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc and b/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc differ diff --git a/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc b/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc index ce1761e..1553fbe 100644 Binary files a/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc and b/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc differ diff --git a/gestaoRaul/balcao/templates/viewBalcao.html b/gestaoRaul/balcao/templates/viewBalcao.html index b4bc083..238fee7 100644 --- a/gestaoRaul/balcao/templates/viewBalcao.html +++ b/gestaoRaul/balcao/templates/viewBalcao.html @@ -18,7 +18,6 @@

Venda Balcão

-
+
+ + + + + + + + + + {% for client in clients %} + + + + + + + + + {% endfor %} + +
ClienteDébitoContatoAções
{{client.name}}R$ {{client.debt}}{{client.contact}} +
+ + + + + + +
+ {% csrf_token %} + + + + + + + +
+
+
+
+ + + + +
+
+ + {% csrf_token %} +

Cadastro Cliente

+ + + + + Ativo + + +
+ + + +
+
+ +
+
+ + + + + + + + {% endblock %} \ No newline at end of file diff --git a/gestaoRaul/clients/urls.py b/gestaoRaul/clients/urls.py index 3c1b828..1c0705f 100644 --- a/gestaoRaul/clients/urls.py +++ b/gestaoRaul/clients/urls.py @@ -4,6 +4,8 @@ from . import views urlpatterns = [ path('', views.clients, name='clients'), + path('createClient', views.createClient, name='createClient'), + path('payDebt', views.payDebt, name='payDebt'), diff --git a/gestaoRaul/clients/views.py b/gestaoRaul/clients/views.py index 17f5bf0..814cafe 100644 --- a/gestaoRaul/clients/views.py +++ b/gestaoRaul/clients/views.py @@ -1,8 +1,31 @@ -from django.shortcuts import render +from django.shortcuts import render, redirect from django.contrib.auth.models import User from gestaoRaul.decorators import group_required +from clients.models import Client + +@group_required(groupName='Gerente') def clients(request): - return render(request, 'clients.html') \ No newline at end of file + clients = Client.objects.all() + return render(request, 'clients.html', {'clients': clients}) + + +@group_required(groupName='Gerente') +def createClient(request): + name = request.POST.get('name') + contact = request.POST.get('contact') + active = True if request.POST.get('active') else False + # debt = request.POST.get('debt') + client = Client(name=name, contact=contact,debt=0, active=active) + client.save() + return redirect('/clients') + +def payDebt(request): + # id = request.POST.get('id-client') + # client_id = int(id) + # client = Client.objects.get(id=client_id) + # client.debt = client.debt - 1 + # client.save() + return redirect('/clients') \ No newline at end of file diff --git a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc index a98cb76..41682de 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/__pycache__/urls.cpython-310.pyc b/gestaoRaul/comandas/__pycache__/urls.cpython-310.pyc index abe55cc..2ff3b70 100644 Binary files a/gestaoRaul/comandas/__pycache__/urls.cpython-310.pyc and b/gestaoRaul/comandas/__pycache__/urls.cpython-310.pyc differ diff --git a/gestaoRaul/comandas/__pycache__/views.cpython-310.pyc b/gestaoRaul/comandas/__pycache__/views.cpython-310.pyc index 2d275c6..39c8da5 100644 Binary files a/gestaoRaul/comandas/__pycache__/views.cpython-310.pyc and b/gestaoRaul/comandas/__pycache__/views.cpython-310.pyc differ diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index 0c65e75..c852116 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -65,7 +65,7 @@ Detalhes {{comanda.name}}
Nome: {{comanda.name}} | - Mesa: {{comanda.mesa}} + Local: {{comanda.mesa}}