mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
bug: htmx page viewcomanda
This commit is contained in:
Binary file not shown.
@@ -34,7 +34,7 @@ def addProduct(request, product_id, comanda_id):
|
|||||||
total = 0
|
total = 0
|
||||||
for produto in consumo:
|
for produto in consumo:
|
||||||
total += produto.product.price
|
total += produto.product.price
|
||||||
return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total})
|
return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total, 'comanda':comanda})
|
||||||
|
|
||||||
@group_required(groupName='Garçom')
|
@group_required(groupName='Garçom')
|
||||||
def editOrders(request, productComanda_id, obs):
|
def editOrders(request, productComanda_id, obs):
|
||||||
@@ -48,12 +48,14 @@ def editOrders(request, productComanda_id, obs):
|
|||||||
@group_required(groupName='Garçom')
|
@group_required(groupName='Garçom')
|
||||||
def removeProductComanda(request, productComanda_id):
|
def removeProductComanda(request, productComanda_id):
|
||||||
product_comanda = ProductComanda.objects.get(id=productComanda_id)
|
product_comanda = ProductComanda.objects.get(id=productComanda_id)
|
||||||
consumo = ProductComanda.objects.filter(comanda=product_comanda.comanda)
|
comanda = Comanda.objects.get(id= product_comanda.comanda.id)
|
||||||
|
consumo = ProductComanda.objects.filter(comanda=comanda)
|
||||||
|
|
||||||
product_comanda.delete()
|
product_comanda.delete()
|
||||||
total = 0
|
total = 0
|
||||||
for produto in consumo:
|
for produto in consumo:
|
||||||
total += produto.product.price
|
total += produto.product.price
|
||||||
return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total})
|
return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total, 'comanda':comanda})
|
||||||
|
|
||||||
@group_required(groupName='Garçom')
|
@group_required(groupName='Garçom')
|
||||||
def closeComanda(request, comanda_id):
|
def closeComanda(request, comanda_id):
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ Detalhes {{comanda.name}}
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{item.product.name}}
|
{{item.product.name}}
|
||||||
|
|
||||||
{% if item.product.cuisine == True %}
|
{% if item.product.cuisine == True %}
|
||||||
<img
|
<img
|
||||||
onclick="openModalObs({{item.id}})"
|
onclick="openModalObs({{item.id}})"
|
||||||
@@ -96,6 +95,10 @@ Detalhes {{comanda.name}}
|
|||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>R$ {{item.product.price}}</td>
|
<td>R$ {{item.product.price}}</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% if comanda.status != 'OPEN'%}
|
{% if comanda.status != 'OPEN'%}
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Binary file not shown.
@@ -1,6 +1,5 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th style="text-align: left;">Produto</th>
|
<th style="text-align: left;">Produto</th>
|
||||||
<th style="text-align: left;">Preço</th>
|
<th style="text-align: left;">Preço</th>
|
||||||
@@ -19,9 +18,13 @@
|
|||||||
</img>
|
</img>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>R$ {{item.product.price}}</td>
|
<td>R$ {{item.product.price}}</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% if comanda.status != 'OPEN'%}
|
||||||
|
{% else %}
|
||||||
<td>
|
<td>
|
||||||
<img
|
<img
|
||||||
src="{% static 'midia/icons/delete.svg' %}"
|
src="{% static 'midia/icons/delete.svg' %}"
|
||||||
@@ -32,10 +35,9 @@
|
|||||||
hx-confirm="Tem certeza que deseja excluir o produto {{item.product.name}}?" >
|
hx-confirm="Tem certeza que deseja excluir o produto {{item.product.name}}?" >
|
||||||
</img>
|
</img>
|
||||||
</td>
|
</td>
|
||||||
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" style="text-align: center;">Total R$ {{total}}</td>
|
<td colspan="2" style="text-align: center;">Total R$ {{total}}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user