// Documentos imprimibles: Resumen, Cliente, Cocina, Reparto const fmt = (n) => "$" + (Number(n) || 0).toLocaleString("es-MX", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); const fmtDate = (d) => d ? new Date(d + "T00:00").toLocaleDateString("es-MX", { day: "2-digit", month: "long", year: "numeric" }) : "—"; function DocHeader({ subtitle }) { return (
Deus Cake
ORDEN DE COMPRA || {subtitle}
); } function Row({ label, value, danger }) { return (
{label}
{value || "—"}
); } // === Resumen breve (cotización) === function DocResumen({ s, totals }) { const D = window.DEUS_DATA; const flavorName = (id) => D.flavors.find(f => f.id === id)?.name || "—"; const fillName = (id) => D.fillings.find(f => f.id === id)?.name || "—"; return (
FOLIO{s.folio}
FECHA{new Date().toLocaleDateString("es-MX")}
VÁLIDA HASTA{new Date(Date.now() + 7*86400000).toLocaleDateString("es-MX")}

Cliente

Pastel

c.id===s.cake.covering)?.name} />
{s.cake.sameForAll ? (
) : (
PisoSaborRellenoColor
{s.cake.tiers.map((t, i) => (
{i+1} {flavorName(t.flavor)} {fillName(t.filling)} {t.colorName || "—"}
))}
)}
{s.extras.items.length > 0 && (

Extras y decoraciones

{s.extras.items.map((e, i) => (
{e.qty}× {e.name} {fmt(e.qty * e.price)}
))}
)}

Entrega

Pastel base ({s.cake.people} pers.){fmt(totals.cakeBase)}
{totals.specialPct > 0 && (
Sabores/rellenos especiales (+{Math.round(totals.specialPct*100)}%){fmt(totals.specialSurcharge)}
)}
Extras y decoraciones{fmt(totals.extrasSum)}
Envío{fmt(totals.shipping)}
Subtotal{fmt(totals.subtotal)}
IVA 16%{fmt(totals.iva)}
Total{fmt(totals.total)}
{totals.advance > 0 && <>
Anticipo{fmt(totals.advance)}
Saldo a pagar{fmt(totals.balance)}
}
{s.notes && (

Comentarios

{s.notes}
)}
); } // === Cliente === function DocCliente({ s, totals }) { return (

DATOS DEL CLIENTE

DATOS DE ENTREGA

DIRECCIÓN

GENERAL MIGUEL NEGRETE 73, LOMAS DEL 5 DE MAYO, PUEBLA.
TELÉFONO: 2226282397 / TELÉFONO DE RESPALDO: 2226282397

CUENTAS

BANCO: BANCOMER
NOMBRE: MARIA TERESA SANCHEZ

TRANSFERENCIA
TARJETA: 4152 3141 6366 5766
CUENTA: 0464525922
CLABE: 012650004645259223

OXXO
OPCIÓN 1: 4152 3141 6366 5766

{s.cake.preview}

PAGO

PRECIO{fmt(totals.cakeBase + totals.specialSurcharge + totals.extrasSum)}
ENVÍO{fmt(totals.shipping)}
ADELANTO{fmt(totals.advance)}
SUBTOTAL{fmt(totals.subtotal)}
IVA{fmt(totals.iva)}
TOTAL{fmt(totals.total)}
); } // === Cocina === function DocCocina({ s }) { const D = window.DEUS_DATA; const flavorName = (id) => D.flavors.find(f => f.id === id)?.name || "—"; const fillName = (id) => D.fillings.find(f => f.id === id)?.name || "—"; return (

DATOS ESPECÍFICOS

NOMBRE SOBRE EL PASTEL

FLORES

TIPO DE MUÑECOS

ESPECIFICACIONES DE CADA PISO

{s.cake.tiers.map((t, i) => (
PISO {i+1}{i === 0 ? " / EL DE ABAJO EN LA BASE" : ""}
c.id===s.cake.covering)?.name || "").toUpperCase()} /> x.id===t.tierType)?.name || "").toUpperCase()} />
))}
{s.notes && (

COMENTARIOS

{s.notes}
)}
); } // === Reparto === function DocReparto({ s, totals }) { return (
{s.cake.preview}

DETALLES DEL PASTEL

{s.cake.tiers.map((t, i) => ( ))}
SALDO A PAGAR {fmt(totals.balance)}
{s.notes && (
COMENTARIOS
{s.notes}
)}
); } Object.assign(window, { DocResumen, DocCliente, DocCocina, DocReparto, fmt, fmtDate });