📊 Configurar Google Sheets
Cada vez que generes un PDF, el pedido se registra automáticamente en tu hoja de cálculo.
Paso 1 — Crea el Apps Script
En tu Google Sheet: Extensiones → Apps Script → pega este código y despliégalo como Web App:
function doPost(e) {
var data = JSON.parse(e.postData.contents);
var ss = SpreadsheetApp.openById(data.sheetId);
var sheet = ss.getSheetByName("Cotizaciones") ||
ss.insertSheet("Cotizaciones");
if (sheet.getLastRow() === 0) {
sheet.appendRow(["Fecha","Ref","Florista","Empresa","WA",
"Evento","Fecha Evento","Ship Out","Venue","Total $","Productos","Nota"]);
}
sheet.appendRow([
data.fecha, data.ref, data.florista, data.empresa, data.wa,
data.evento, data.fechaEvento, data.fechaEntrega,
data.venue, data.total, data.productos, data.nota
]);
return ContentService.createTextOutput("ok");
}
Paso 2 — Pega la URL del Web App
Paso 3 — ID de tu Google Sheet