mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: gerenciamento quantidade product
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -45,6 +45,8 @@ def removeProductComanda(request, productComanda_id):
|
||||
if product_comanda.product.cuisine == True:
|
||||
order = Order.objects.get(productComanda=product_comanda)
|
||||
product_comanda.delete()
|
||||
Product.addStock(Product.objects.get(id=product_comanda.product.id), 1)
|
||||
|
||||
msg = JsonResponse({
|
||||
'type': 'broadcast',
|
||||
'message': 'Atenção! Pedido cancelado',
|
||||
@@ -59,6 +61,7 @@ def removeProductComanda(request, productComanda_id):
|
||||
valores = somar(consumo,comanda)
|
||||
else:
|
||||
product_comanda.delete()
|
||||
Product.addStock(Product.objects.get(id=product_comanda.product.id), 1)
|
||||
consumo = ProductComanda.objects.filter(comanda=comanda)
|
||||
valores = somar(consumo,comanda)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ Detalhes {{comanda.name}}
|
||||
<input hidden id="id-temp" type="number">
|
||||
<div class="grid-container" >
|
||||
<div style="display: flex;padding: 5px;gap:8px">
|
||||
<button class="btn-primary" id="openModal" onclick="openModal()"
|
||||
<button class="btn-primary" id="openModal" onclick="modalAddProduct()"
|
||||
{% if comanda.status != 'OPEN'%}
|
||||
disabled
|
||||
{% endif %}
|
||||
|
||||
Binary file not shown.
@@ -141,13 +141,13 @@ def closeComanda(request, comanda_id):
|
||||
|
||||
@group_required(groupName='Garçom')
|
||||
def addProduct(request, product_id, comanda_id):
|
||||
print('chamouuuuuuuuuuu')
|
||||
config = {
|
||||
'taxa': False
|
||||
}
|
||||
obs = request.GET.get("obs")
|
||||
product_comanda = ProductComanda(comanda_id=comanda_id, product_id=product_id)
|
||||
product_comanda.save()
|
||||
Product.subStock(Product.objects.get(id=product_id), 1)
|
||||
product = Product.objects.get(id=product_id)
|
||||
comanda = Comanda.objects.get(id=comanda_id)
|
||||
parcial = Payments.objects.filter(comanda=comanda)
|
||||
|
||||
Reference in New Issue
Block a user