Update script.js
Browse files
script.js
CHANGED
|
@@ -175,11 +175,11 @@ function gestionarMesa(index) {
|
|
| 175 |
app.appendChild(finalizarButton);
|
| 176 |
}
|
| 177 |
|
| 178 |
-
// Generación del QR y ticket
|
| 179 |
function generarTicket(index, total) {
|
| 180 |
const mesa = mesas[index];
|
| 181 |
let qrContent = `Mesa ${mesa.numero}\n`;
|
| 182 |
-
|
| 183 |
mesa.pedidos.forEach(pedido => {
|
| 184 |
qrContent += `${pedido.item} (${pedido.opcion || ''}) x${pedido.cantidad} - €${(pedido.precio * pedido.cantidad).toFixed(2)}\n`;
|
| 185 |
});
|
|
@@ -193,8 +193,8 @@ function generarTicket(index, total) {
|
|
| 193 |
qrContainer.className = 'text-center';
|
| 194 |
app.appendChild(qrContainer);
|
| 195 |
|
| 196 |
-
// Generación del QR
|
| 197 |
-
|
| 198 |
text: qrContent,
|
| 199 |
width: 256,
|
| 200 |
height: 256,
|
|
|
|
| 175 |
app.appendChild(finalizarButton);
|
| 176 |
}
|
| 177 |
|
| 178 |
+
// Generación del QR y ticket usando QRCode.js
|
| 179 |
function generarTicket(index, total) {
|
| 180 |
const mesa = mesas[index];
|
| 181 |
let qrContent = `Mesa ${mesa.numero}\n`;
|
| 182 |
+
|
| 183 |
mesa.pedidos.forEach(pedido => {
|
| 184 |
qrContent += `${pedido.item} (${pedido.opcion || ''}) x${pedido.cantidad} - €${(pedido.precio * pedido.cantidad).toFixed(2)}\n`;
|
| 185 |
});
|
|
|
|
| 193 |
qrContainer.className = 'text-center';
|
| 194 |
app.appendChild(qrContainer);
|
| 195 |
|
| 196 |
+
// Generación del QR usando qrcode.js
|
| 197 |
+
new QRCode(qrContainer, {
|
| 198 |
text: qrContent,
|
| 199 |
width: 256,
|
| 200 |
height: 256,
|