Update script.js
Browse files182 unmodified lines1831841851861871881891908 unmodified lines19920020120220320420520620720820921021121221312 unmodified lines226227228229230231232182 unmodified lines// Generación del PDF con jsPDFfunction generarTicket(index, total) {// Almacenar el index de la mesaconst mesaIndex = index;const mesa = mesas[mesaIndex];// Crear un nuevo documento PDF8 unmodified lines});doc.text(`Total: €${total.toFixed(2)}`, 10, yOffset);// Mostrar el total debajo del QRconst totalText = document.createElement('p');totalText.textContent = `Total: €${total.toFixed(2)}`;totalText.className = 'text-center';app.appendChild(totalText);// Generar el PDF y descargarlodoc.save(`ticket-mesa-${mesa.numero}.pdf`);// Mostrar el QRconst qrContainer = document.createElement('div');qrContainer.className = 'text-center';12 unmodified linesconst volverButton = document.createElement('button');volverButton.textContent = '← Volver';volverButton.className = 'btn btn-outline-danger btn-block';volverButton.onclick = () => render(); // Volver a renderizar la UI principalapp.appendChild(volverButton);}182 unmodified lines1831841851861871881891908 unmodified lines19920020120220320420520620720820921021121221321421521612 unmodified lines229230231232233234235182 unmodified lines// Generación del PDF con jsPDFfunction generarTicket(index, total) {// **Almacenar el index de la mesa**const mesaIndex = index;const mesa = mesas[mesaIndex];// Crear un nuevo documento PDF8 unmodified lines});doc.text(`Total: €${total.toFixed(2)}`, 10, yOffset);// Generar el PDF y descargarlodoc.save(`ticket-mesa-${mesa.numero}.pdf`);// **Limpiar app DESPUÉS de generar el PDF**app.innerHTML = '';// Mostrar el total debajo del QRconst totalText = document.createElement('p');totalText.textContent = `Total: €${total.toFixed(2)}`;totalText.className = 'text-center';app.appendChild(totalText);// Mostrar el QRconst qrContainer = document.createElement('div');qrContainer.className = 'text-center';12 unmodified linesconst volverButton = document.createElement('button');volverButton.textContent = '← Volver';volverButton.className = 'btn btn-outline-danger btn-block';volverButton.onclick = () => render();app.appendChild(volverButton);}
script.js+9-6