mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: obs from orders print
This commit is contained in:
Binary file not shown.
@@ -86,7 +86,8 @@ Detalhes {{comanda.name}}
|
||||
<td id="id-for-print-{{item.id}}">
|
||||
{{item.product.name}}
|
||||
{% if item.product.cuisine == True %}
|
||||
<span data-tooltip="Observações para preparo." data-flow="top">
|
||||
<input hidden id="{{item.id}}-obsOrder" type="order" value="{{item.id | obsOrder}}">
|
||||
<span data-tooltip="{{item.id | obsOrder}}" data-flow="top">
|
||||
|
||||
<img
|
||||
onclick="openModalObs({{item.id}})"
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
from decimal import Decimal
|
||||
from django import template
|
||||
from orders.models import Order
|
||||
|
||||
from comandas.models import Comanda, ProductComanda
|
||||
from clients.models import Client
|
||||
@@ -53,4 +54,16 @@ def viewClient(clientId):
|
||||
|
||||
@register.filter(name='groupUser')
|
||||
def has_group(user, group_name):
|
||||
return user.groups.filter(name=group_name).exists()
|
||||
return user.groups.filter(name=group_name).exists()
|
||||
|
||||
|
||||
@register.filter(name='obsOrder')
|
||||
def obsOrder(id):
|
||||
product_comanda_obj = ProductComanda.objects.get(pk=id) # Supondo que você tenha o ID do ProductComanda
|
||||
|
||||
produto_associado = product_comanda_obj.product
|
||||
|
||||
pedidos_relacionados = Order.objects.filter(id_product=produto_associado)
|
||||
pedido = pedidos_relacionados[0]
|
||||
|
||||
return pedido.obs
|
||||
@@ -48,6 +48,7 @@ def viewComanda(request):
|
||||
comanda_id = int(id)
|
||||
comanda = Comanda.objects.get(id=comanda_id)
|
||||
consumo = ProductComanda.objects.filter(comanda=comanda_id)
|
||||
# consumo[0].product.
|
||||
parcial = Payments.objects.filter(comanda=comanda_id)
|
||||
mesas = Mesa.objects.all()
|
||||
clients = Client.objects.filter(active=True)
|
||||
@@ -63,6 +64,7 @@ def viewComanda(request):
|
||||
if p.name == produto['nome'] and p.active == True:
|
||||
products_ordenados.append(p)
|
||||
valores = somar(consumo,comanda)
|
||||
|
||||
return render(request, 'viewcomanda.html', {'config':config, 'valores':valores,'parcials':parcial,'clients':clients,'comanda': comanda, 'consumo': consumo, 'products': products_ordenados,'mesas':mesas})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user