fiz um monte de coisa e criei um bug

This commit is contained in:
2025-01-15 11:04:27 -03:00
parent a2fd5d12e3
commit 43d9cd9c5b
20 changed files with 83 additions and 19 deletions

View File

@@ -5,6 +5,7 @@ from django.db.models import Count, F
from comandas.models import Comanda, ProductComanda
from mesas.models import Mesa
from products.models import Product
from payments.models import Payments
from typePay.models import TypePay
@@ -66,7 +67,12 @@ def removeProductBalcao(request, productComanda_id):
def paymentBalcao(request, comanda_id):
typePayment = TypePay.objects.get(id=1)
consumo = ProductComanda.objects.filter(comanda=comanda_id)
vendasBalcao = Comanda.objects.get(name='VENDAS BALCAO')
try:
vendasBalcao = Comanda.objects.get(name='VENDAS BALCAO')
except:
mesa = Mesa.objects.get(id=1)
vendasBalcao = Comanda(name='VENDAS BALCAO', mesa=mesa, user=request.user, status='CLOSED')
vendasBalcao.save()
comanda = Comanda.objects.get(name='VENDA BALCÃO')
total = 0
for produto in consumo:
@@ -77,3 +83,7 @@ def paymentBalcao(request, comanda_id):
pagamento.save()
return redirect('viewBalcao')
#"GET /balcao/addProductBalcaoTeclado83/1/1/ HTTP/1.1" 200 747
#"GET /balcao/addProductBalcaoTeclado83/13/1/ HTTP/1.1" 500 133103