feat: button on/off products

This commit is contained in:
2024-12-29 20:02:51 -03:00
parent ac87c3a47d
commit 9cc0c72f10
17 changed files with 71 additions and 42 deletions

View File

@@ -31,10 +31,6 @@ def listProductBalcao(request, comanda_id, search_product):
return render(request, "htmx_components/htmx_list_products_balcao.html", {"products": products,'comanda_id':comanda_id})
# def listProductBalcao(request, comanda_id):
# product = request.GET.get("search-product")
# products = Product.objects.filter(name__icontains=product)
# return render(request, "htmx_components/htmx_list_products_balcao.html", {"products": products,'comanda_id':comanda_id})
def addProductBalcao(request, product_id, comanda_id, qtd):
for i in range(qtd):

View File

@@ -69,8 +69,6 @@
<div id="add-produto">
<!-- <article> -->
<form id="productForm" >
<h2 style="text-align: center;">Buscar Produto </h2>
<div class="grid-container">
@@ -128,22 +126,14 @@
{% endfor %}
</div>
</form>
<!-- </article> -->
</div>
</div>
<dialog id="payment-comanda" style="display: none;" >
<article>
<h2>Receber</h2>

View File

@@ -5,21 +5,16 @@ from balcao import htmx_views
from . import views
urlpatterns = [
# path('', views.comandas, name='comandas'),
path('', views.viewBalcao, name='viewBalcao'),
# path('createComanda/', views.createComanda, name='createComanda'),
]
htmx_urlpatterns = [
# path('listProduct/', htmx_views.listProduct, name='listProduct'),
path('listProductBalcao/<int:comanda_id>/<str:search_product>/', htmx_views.listProductBalcao, name='listProductBalcao'),
path('addProductBalcao<int:product_id>/<int:comanda_id>/<int:qtd>/', htmx_views.addProductBalcao, name='addProductBalcao'),
path('addProductBalcaoTeclado<int:product_id>/<int:comanda_id>/<int:qtd>/', htmx_views.addProductBalcaoTeclado, name='addProductBalcaoTeclado'),
path('removeProductBalcao<int:productComanda_id>/', htmx_views.removeProductBalcao, name='removeProductBalcao'),
# path('closeComanda<int:comanda_id>/', htmx_views.closeComanda, name='closeComanda'),
# path('reopenComanda<int:comanda_id>/', htmx_views.reopenComanda, name='reopenComanda'),
path('paymentBalcao<int:comanda_id>/', htmx_views.paymentBalcao, name='paymentBalcao'),
]

View File

@@ -2,7 +2,6 @@ from django.shortcuts import render, redirect
from comandas.models import Comanda, ProductComanda
from products.models import Product
from mesas.models import Mesa
from django.db.models import Count, F