mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
redirect quando cria uma comanda
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -200,7 +200,7 @@ Detalhes {{comanda.name}}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p>Recebido:</p> <input id="recebido" type="number">
|
||||
<p>Recebido:</p> <input id="recebido" oninput="troco()" name="recebido" type="number">
|
||||
<h4 id="troco">Troco: </h4>
|
||||
</div>
|
||||
<footer>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from decimal import Decimal
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
|
||||
from django.http import JsonResponse
|
||||
@@ -69,7 +70,7 @@ def createComanda(request):
|
||||
mesa = Mesa.objects.get(id=mesa_id)
|
||||
comanda = Comanda(name=name, mesa=mesa, user=request.user)
|
||||
comanda.save()
|
||||
return redirect('comandas')
|
||||
return redirect(reverse('viewcomanda') + f'?parametro={comanda.id}')
|
||||
|
||||
@group_required(groupName='Garçom')
|
||||
def editComanda(request):
|
||||
|
||||
Binary file not shown.
@@ -176,20 +176,20 @@ function troco(){
|
||||
}
|
||||
|
||||
|
||||
document.onkeydown = teclado
|
||||
// document.onkeydown = teclado
|
||||
|
||||
function teclado(event){
|
||||
if (document.getElementById('payment-comanda').style.display == 'block'){
|
||||
if (event.keyCode == 13){
|
||||
troco()
|
||||
}else{
|
||||
console.log(event.keyCode)
|
||||
}
|
||||
}else{
|
||||
console.log('')
|
||||
}
|
||||
// function teclado(event){
|
||||
// if (document.getElementById('payment-comanda').style.display == 'block'){
|
||||
// if (event.keyCode == 13){
|
||||
// troco()
|
||||
// }else{
|
||||
// console.log(event.keyCode)
|
||||
// }
|
||||
// }else{
|
||||
// console.log('')
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
function addOrder(){
|
||||
obs = document.getElementById('obs').value
|
||||
var id = document.getElementById('id-temp').value
|
||||
|
||||
Reference in New Issue
Block a user