diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index f01d705..228a0d4 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -47,7 +47,6 @@ Detalhes {{comanda.name}} {{item.product.name}} R$ {{item.product.price}} - diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index 81dda6f..26fb02c 100644 Binary files a/gestaoRaul/db.sqlite3 and b/gestaoRaul/db.sqlite3 differ diff --git a/gestaoRaul/templates/static/comandas/js/viewcomanda.js b/gestaoRaul/templates/static/comandas/js/viewcomanda.js index 0d17f08..b4d641b 100644 --- a/gestaoRaul/templates/static/comandas/js/viewcomanda.js +++ b/gestaoRaul/templates/static/comandas/js/viewcomanda.js @@ -18,12 +18,28 @@ function removeCloseModal() { function imprimirFichas() { const element = document.getElementById("list-products-comanda"); + const style = ``; + const agora = new Date(); + var dateString = agora.getDay() + '/' + agora.getMonth() + '/' + agora.getFullYear() + ' - ' + agora.getHours() + ':' + agora.getMinutes()+' - Raul Rock Bar & Café'; + if (element) { var content = element.innerHTML; - console.log(content); + // console.log(content); content = content.replace(/]*>(?:(?!<\/button>)[\s\S])*<\/button>/gi,''); - const printWindow = window.open('', '_blank'); - printWindow.document.write(''+content+'
'); + content = content.replace(/]*>(?:(?!<\/th>)[\s\S])*<\/th>/gi,''); + content = content.replace(/<\/tr>/g,''+dateString+''); + console.log(content); + + var printWindow = window.open('', '_blank'); + printWindow.document.write(''+content+'
'+style); printWindow.document.close(); printWindow.print(); printWindow.close();