mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 05:25:40 +00:00
contabilizar produtos vendidos no balcão
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -35,22 +35,14 @@ 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')
|
||||
print('ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg')
|
||||
print(f'ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg{vendasBalcao.id}')
|
||||
comanda = Comanda.objects.get(name='VENDA BALCÃO')
|
||||
total = 0
|
||||
for produto in consumo:
|
||||
total += produto.product.price
|
||||
produto.comanda = 14
|
||||
produto.comanda = vendasBalcao
|
||||
produto.save()
|
||||
# newObject = ProductComanda.objects.get(comanda=produto.id)
|
||||
# newObject.comanda= 14
|
||||
|
||||
# newObject.save()
|
||||
|
||||
|
||||
pagamento = Payments(value=total, comanda=comanda, type_pay=typePayment,description='VENDA BALCÃO')
|
||||
pagamento.save()
|
||||
# comanda.save()
|
||||
return redirect('comandas')
|
||||
return redirect('viewBalcao')
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
<ul>
|
||||
</ul>
|
||||
<footer>
|
||||
<button class="secondary" hx-get="{% url 'paymentComanda' comanda.id %} " hx-trigger="click" hx-swap="none" onclick="backPage()">
|
||||
<button class="secondary" hx-get="{% url 'paymentBalcao' comanda.id %} " hx-trigger="click" hx-swap="none" onclick="backPage()">
|
||||
Comfimar
|
||||
</button>
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ htmx_urlpatterns = [
|
||||
# path('listProduct/', htmx_views.listProduct, name='listProduct'),
|
||||
path('listProduct/<int:comanda_id>/', htmx_views.listProductBalcao, name='listProductBalcao'),
|
||||
path('addProduct<int:product_id>/<int:comanda_id>/', htmx_views.addProductBalcao, name='addProductBalcao'),
|
||||
path('removeProductComanda<int:productComanda_id>/', htmx_views.removeProductBalcao, name='removeProductBalcao'),
|
||||
path('removeProductBalcao<int:productComanda_id>/', htmx_views.removeProductBalcao, name='removeProductBalcao'),
|
||||
# path('closeComanda<int:comanda_id>/', htmx_views.closeComanda, name='closeComanda'),
|
||||
# path('reopenComanda<int:comanda_id>/', htmx_views.reopenComanda, name='reopenComanda'),
|
||||
path('paymentComanda<int:comanda_id>/', htmx_views.paymentBalcao, name='paymentBalcao'),
|
||||
path('paymentBalcao<int:comanda_id>/', htmx_views.paymentBalcao, name='paymentBalcao'),
|
||||
]
|
||||
|
||||
urlpatterns += htmx_urlpatterns
|
||||
Binary file not shown.
@@ -108,30 +108,30 @@ function teclado(event){
|
||||
if (event.keyCode == 50){
|
||||
document.getElementById('qtd-product').innerHTML = '2'
|
||||
}
|
||||
else if (event.keyCode == 73){
|
||||
imprimirFichas()
|
||||
}
|
||||
else if (event.keyCode == 51){
|
||||
document.getElementById('qtd-product').innerHTML = '3'
|
||||
}
|
||||
else if (event.keyCode == 52){
|
||||
document.getElementById('qtd-product').innerHTML = '4'
|
||||
}
|
||||
else if (event.keyCode == 53){
|
||||
document.getElementById('qtd-product').innerHTML = '5'
|
||||
}
|
||||
else if (event.keyCode == 54){
|
||||
document.getElementById('qtd-product').innerHTML = '6'
|
||||
}
|
||||
else if (event.keyCode == 55){
|
||||
document.getElementById('qtd-product').innerHTML = '7'
|
||||
}
|
||||
else if (event.keyCode == 56){
|
||||
document.getElementById('qtd-product').innerHTML = '8'
|
||||
}
|
||||
else if (event.keyCode == 57){
|
||||
document.getElementById('qtd-product').innerHTML = '9'
|
||||
}
|
||||
// else if (event.keyCode == 73){
|
||||
// imprimirFichas()
|
||||
// }
|
||||
// else if (event.keyCode == 51){
|
||||
// document.getElementById('qtd-product').innerHTML = '3'
|
||||
// }
|
||||
// else if (event.keyCode == 52){
|
||||
// document.getElementById('qtd-product').innerHTML = '4'
|
||||
// }
|
||||
// else if (event.keyCode == 53){
|
||||
// document.getElementById('qtd-product').innerHTML = '5'
|
||||
// }
|
||||
// else if (event.keyCode == 54){
|
||||
// document.getElementById('qtd-product').innerHTML = '6'
|
||||
// }
|
||||
// else if (event.keyCode == 55){
|
||||
// document.getElementById('qtd-product').innerHTML = '7'
|
||||
// }
|
||||
// else if (event.keyCode == 56){
|
||||
// document.getElementById('qtd-product').innerHTML = '8'
|
||||
// }
|
||||
// else if (event.keyCode == 57){
|
||||
// document.getElementById('qtd-product').innerHTML = '9'
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user