diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index 9875a15..f01d705 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -23,7 +23,7 @@ Detalhes {{comanda.name}}
- +
diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index f3e23f1..81dda6f 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 8f1c8de..0d17f08 100644 --- a/gestaoRaul/templates/static/comandas/js/viewcomanda.js +++ b/gestaoRaul/templates/static/comandas/js/viewcomanda.js @@ -16,7 +16,21 @@ function removeCloseModal() { document.getElementById('remove-product-comanda').style.display = 'none'; } - +function imprimirFichas() { + const element = document.getElementById("list-products-comanda"); + if (element) { + var content = element.innerHTML; + console.log(content); + content = content.replace(/]*>(?:(?!<\/button>)[\s\S])*<\/button>/gi,''); + const printWindow = window.open('', '_blank'); + printWindow.document.write(''+content+'
'); + printWindow.document.close(); + printWindow.print(); + printWindow.close(); + } else { + console.error(`Element with ID not found`); + } + } @@ -24,7 +38,7 @@ document.getElementById('openModal').addEventListener('click', openModal); document.getElementById('productForm').addEventListener('submit', function(event) { event.preventDefault(); - - }); + + \ No newline at end of file