diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index ad3e629..c1a1961 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -94,23 +94,24 @@ Detalhes {{comanda.name}} - {{item.product.name}} + + {{item.product.name}} {% if item.product.cuisine == True %} - + - - + onclick="openModalObs({{item.id}})" + src="{% static 'midia/icons/note.svg' %}" + style="width: 25px; height: 35px; cursor: pointer;"> + + - - + + {% endif %} @@ -129,7 +130,7 @@ Detalhes {{comanda.name}} {% endif %} - + {% endfor %} {% if config.taxa %} @@ -155,7 +156,7 @@ Detalhes {{comanda.name}} - + {% if config.taxa %} Total R$ {{valores.totalComTaxa}} diff --git a/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc b/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc index 0fdae45..ae3a7a4 100644 Binary files a/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc and b/gestaoRaul/comandas/templatetags/__pycache__/custom_filter_tag.cpython-312.pyc differ diff --git a/gestaoRaul/comandas/templatetags/custom_filter_tag.py b/gestaoRaul/comandas/templatetags/custom_filter_tag.py index 2f29302..82eccfb 100644 --- a/gestaoRaul/comandas/templatetags/custom_filter_tag.py +++ b/gestaoRaul/comandas/templatetags/custom_filter_tag.py @@ -62,7 +62,7 @@ def obsOrder(id): try: productComanda_obj = ProductComanda.objects.get(pk=id) order = Order.objects.get(productComanda=productComanda_obj) - return order.obs + return order except: return '' diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index 70969da..f91d089 100644 Binary files a/gestaoRaul/db.sqlite3 and b/gestaoRaul/db.sqlite3 differ diff --git a/gestaoRaul/orders/__pycache__/models.cpython-312.pyc b/gestaoRaul/orders/__pycache__/models.cpython-312.pyc index 5d85a1e..1a121c1 100644 Binary files a/gestaoRaul/orders/__pycache__/models.cpython-312.pyc and b/gestaoRaul/orders/__pycache__/models.cpython-312.pyc differ diff --git a/gestaoRaul/orders/models.py b/gestaoRaul/orders/models.py index 46c008b..6744de9 100644 --- a/gestaoRaul/orders/models.py +++ b/gestaoRaul/orders/models.py @@ -1,5 +1,6 @@ from django.db import models - +from django.utils.formats import date_format + from products.models import Product from comandas.models import Comanda, ProductComanda @@ -16,4 +17,12 @@ class Order(models.Model): canceled = models.DateTimeField(null=True, blank=True) def __str__(self): - return f"Pedido {self.id} - Produto: {self.id_product} - Comanda: {self.id_comanda.name}" \ No newline at end of file + status = 'Em espera' + if self.preparing: + status = 'Preparando' + if self.finished: + status = 'Pronto' + if self.delivered: + status = 'Entregue' + + return f"{self.id_product}| {self.obs}|{status}|{self.id_comanda.name}|{self.id_comanda.mesa.name}|{date_format(self.queue, 'd/m/Y H:i')}" \ No newline at end of file diff --git a/gestaoRaul/orders/templates/orders.html b/gestaoRaul/orders/templates/orders.html index 379c914..775d088 100644 --- a/gestaoRaul/orders/templates/orders.html +++ b/gestaoRaul/orders/templates/orders.html @@ -23,7 +23,7 @@ {% block 'body' %}
-

Pedidos cozinha

+

Pedidos cozinha

{% csrf_token %}
diff --git a/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html b/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html index 1415b62..4ed56e1 100644 --- a/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html +++ b/gestaoRaul/templates/htmx_components/comandas/htmx_list_products_in_comanda.html @@ -11,17 +11,16 @@ - {{item.product.name}} + + {{item.product.name}} {% if item.product.cuisine == True %} - - td, th { - border-collapse: collapse; - padding-top: 20px; - margin: 20px; + padding-top: 10px; + margin: 10px; text-align: center; font-size: 20px;} - ${item} - ${obs} - ${cliente}${local} - ${dateString} + ${order[0]} + ${order[1]} + ${order[3]} - ${order[4]} + ${order[5]} `; var printWindow = window.open('', '_blank'); @@ -254,11 +246,11 @@ function troco(){ function addOrder(){ - obs = document.getElementById('obs') - + var obs = document.getElementById('obs') id = document.getElementById('id-temp').value var obsPrint = document.getElementById(id+'-obsOrder') - tooltipObs = document.getElementById('tooltip-id-'+id) + var order = obsPrint.value.split('|'); + var newOrder = ''; fetch(`/comandas/editOrders/${id}/${obs.value}`, { method: 'POST', @@ -270,9 +262,12 @@ function addOrder(){ .then(data => { if(data.status == 'ok'){ showToast('✅Pedido atualizado com sucesso!😁','success') - tooltipObs.dataset.tooltip = data.obs obs.value = '' - obsPrint.value = data.obs + order[1] = data.obs; + for(var i = 0; i < order.length; i++){ + newOrder += order[i] + '|'; + } + obsPrint.value = newOrder; document.getElementById('modal-obs').style.display = 'none'; } @@ -338,3 +333,8 @@ function taxa(){ } +function inforOrders(id){ + var order = document.getElementById(id+'-obsOrder').value.split('|'); + + feedback(order[2], "", order[1]+' - '+order[5]); +} \ No newline at end of file diff --git a/gestaoRaul/templates/static/orders/css/orders.css b/gestaoRaul/templates/static/orders/css/orders.css index 38497bf..2243797 100644 --- a/gestaoRaul/templates/static/orders/css/orders.css +++ b/gestaoRaul/templates/static/orders/css/orders.css @@ -4,7 +4,14 @@ color: black; } +h2 { + font-size: 18px; + justify-self: center; + margin-bottom: 0px; +} + .container { + margin-top: -50px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); padding: 0px; @@ -91,4 +98,8 @@ } + #title { + display:none; + } + } \ No newline at end of file