COTIZADOR DE LETREROS – LETREROS CAPERUSO COTIZADOR DE LETREROS
PRECIOS DE MATERIALES
CLIENTE |
---|
${clienteNombre} |
EMPRESÁ: | ${info.empresa || »} |
`);
ventanaImpresion.document.close();
ventanaImpresion.print();
}
document.getElementById('exportarCotizacion').addEventListener('click', () => exportarEImprimirCotizacion(false));
document.getElementById('exportarAnalisis').addEventListener('click', () => exportarEImprimirCotizacion(true));function generarAnalisisDetallado() {
const clienteInfo = JSON.parse(localStorage.getItem('clienteInfo')) || {};
let content = `
ANÁLISIS DETALLADOANÁLISIS DETALLADO
INFORMACIÓN DE CLIENTE
NOMBRE | ${clienteInfo.nombre || 'NO INGRESADO'} |
---|
CORREO | ${clienteInfo.correo || 'NO INGRESADO'} |
---|
ITEMS EN EL CARRITO (${carrito.length})
`;
let subtotal = 0;
let totalHorasDiseno = 0;
let totalHorasFabricacion = 0;
let materiales = {
placas: {},
adhesivos: {},
laminados: {},
areaImpresion: 0
};carrito.forEach((item, index) => {
const dims = item.dimensiones.split('x').map(dim => parseFloat(dim) / 100);
const area = dims[0] * dims[1];
totalHorasDiseno += calcularAnalisisMateriales(item).horasDiseno;
totalHorasFabricacion += calcularAnalisisMateriales(item).horasFabricacion;
subtotal += item.precio;if (item.detalles.placa.tipo !== 'SIN PLACA') {
materiales.placas[item.detalles.placa.tipo] = (materiales.placas[item.detalles.placa.tipo] || 0) + area * item.cantidad;
}
materiales.adhesivos[item.detalles.adhesivo.tipo] = (materiales.adhesivos[item.detalles.adhesivo.tipo] || 0) + area * item.cantidad;
materiales.laminados[item.detalles.laminado.tipo] = (materiales.laminados[item.detalles.laminado.tipo] || 0) + area * item.cantidad;
materiales.areaImpresion += area * item.cantidad;// Detailed item analysis
content += `
ITEM ${index + 1}: ${item.nombre.toUpperCase()} (${item.dimensiones})
DETALLE | VALOR |
---|
CANTIDAD | ${item.cantidad} |
AREA UNITARIA | ${item.detalles.area.toFixed(2)} M² |
TOTAL AREA | ${(item.detalles.area * item.cantidad).toFixed(2)} M² |
PRECIO UNITARIO | ${formatPrecio(Math.round(item.precio / item.cantidad))} |
PRECIO TOTAL | ${formatPrecio(item.precio)} |
DESGLOSE DE COSTOS
COMPONENTE | VALOR |
---|
PLACA | ${formatPrecio(item.detalles.placa.costo)} |
ADHESIVO | ${formatPrecio(item.detalles.adhesivo.costo)} |
LAMINADO | ${formatPrecio(item.detalles.laminado.costo)} |
IMPRESIÓN | ${formatPrecio(item.detalles.impresion.costo)} |
SERVICIOS | ${formatPrecio(item.detalles.servicios.diseno.costo + item.detalles.servicios.fabricacion.costo)} |
TOTAL COSTO | ${formatPrecio(item.detalles.costoTotalPorUnidad)} |
`;
});// Total summary
content += `
RESUMEN TOTAL
TOTAL | CANTIDAD |
---|
TOTAL DÍAS DE FABRICACIÓN | ${Math.ceil(totalHorasFabricacion / 8)} DÍAS |
PRECIO TOTAL | ${formatPrecio(subtotal)} |
IVA (19%) | ${formatPrecio(subtotal * 0.19)} |
TOTAL A PAGAR | ${formatPrecio(subtotal * 1.19)} |
`;content += `
`;return content;
}function generarPOS80mmCotizacion() {
const infoCliente = JSON.parse(localStorage.getItem('clienteInfo')) || {};
let content = `
================================
LETREROS CAPERUSO
COTIZACIÓN N° ${infoCliente.numeroPedido || 'XXXX'}
================================FECHA: ${new Date().toLocaleDateString()}=== DATOS CLIENTE ===
NOMBRE: ${infoCliente.nombre || 'NO INGRESADO'}
EMPRESA: ${infoCliente.empresa || 'NO INGRESADO'}
RUT: ${infoCliente.rut || 'NO INGRESADO'}
TELÉFONO: ${infoCliente.telefono || 'NO INGRESADO'}
CORREO: ${infoCliente.correo || 'NO INGRESADO'}
DIRECCIÓN: ${infoCliente.direccion || 'NO INGRESADO'}
GIRO: ${infoCliente.giro || 'NO INGRESADO'}=== DETALLES ENVÍO ===
TIPO: ${infoCliente.shippingType === 'retiro' ?
'RETIRA EN TALLER (SIN COSTO)' :
infoCliente.shippingType === 'privado' ? 'ENVÍO PRIVADO' :
infoCliente.shippingType === 'starkenSucursal' ? 'STARKEN A SUCURSAL' :
infoCliente.shippingType === 'starkenDomicilio' ? 'STARKEN A DOMICILIO' : 'NO ESPECIFICADO'}
PAGO: ${infoCliente.shippingPayment === 'empresa' ? 'PAGA EMPRESA' :
infoCliente.shippingPayment === 'clienteAntes' ? 'PAGA CLIENTE ANTES' :
infoCliente.shippingPayment === 'contraEntrega' ? 'CONTRA ENTREGA' : 'NO APLICA'}
COSTO: $${formatPrecio(infoCliente.costoEnvio || 0)}=== DETALLES INSTALACIÓN ===
TIPO: ${infoCliente.installationType === 'con' ? 'CON INSTALACIÓN' : 'SIN INSTALACIÓN'}
${infoCliente.installationType === 'con' ? 'COSTO: $' + formatPrecio(infoCliente.costoInstalacion || 0) : ''}=== ITEMS (${carrito.length}) ===
`;
carrito.forEach((item, index) => {
content += `
${index+1}. ${item.nombre.toUpperCase()}
${item.cantidad} x ${item.dimensiones}
PLACA: ${item.detalles.placa.tipo}
ADH: ${item.detalles.adhesivo.tipo}
LAM: ${item.detalles.laminado.tipo}
ANCLA: ${item.detalles.anclaje.tipo}
V/U: $${formatPrecio(Math.round(item.precio / item.cantidad))}
TOTAL: $${formatPrecio(item.precio)}
--------------------------------
`;
});
const subtotal = carrito.reduce((sum, item) => sum + item.precio, 0);
const envio = infoCliente.costoEnvio || 0;
const instalacion = infoCliente.costoInstalacion || 0;
content += `
================================
SUBTOTAL: $${formatPrecio(subtotal)}
ENVÍO: $${formatPrecio(envio)}
INSTALACIÓN: $${formatPrecio(instalacion)}
IVA 19%: $${formatPrecio((subtotal + envio + instalacion) * 0.19)}
TOTAL: $${formatPrecio(Math.round((subtotal + envio + instalacion) * 1.19))}
================================
`;
content += `
=== PLAZOS ===
DÍAS FABRICACIÓN: ${parseInt(document.getElementById('diasFabricacionManuales').value) || Math.ceil(carrito.reduce((sum, item) => sum + calcularAnalisisMateriales(item).horasFabricacion, 0) / 8)}
`;
content += `
=== DATOS EMPRESA ===
76.491.931-9
ELISEO SALAZAR DISEÑO INDUSTRIAL EIRL
FABRICACIÓN DE LETREROS Y SEÑÁLETICAS
AV 18 SEPTIEMBRE 1350, PAINE, RM
TEL:(+56) 9 8999 ies.cl
.c
`;
const pos = window.open('_blank');
pos.document.write(`
${content}
`);
pos.document.close();
}document.getElementById('exportarPOSCotizacion').addEventListener('click', generarPOS80mmCotizacion);function generarAnalisisPOS80mm() {
let content = '-- ANÁLISIS POS80 ---\n';
content += 'Tot res\n';
content += `${carrito.length} items\n`;let total = 0;
let totalHorasDiseno = 0;
let totalHorasFabricacion = 0;
let materiales = {};carrito.forEach((item, index) => {
const dims = item.dimensiones.split('x').map(dim => parseFloat(dim) / 100);
const area = dims[0] * dims[1];
totalHorasDiseno += calcularAnalisisMateriales(item).horasDiseno;
totalHorasFabricacion += calcularAnalisisMateriales(item).horasFabricacion;content += `* ${item.cantidad}x ${item.nombre} (${item.dimensiones})\n`;
});content += `\n==== Total \n`;
content += `Total Horas Diseño: ${totalHorasDiseno} horas\n`;
content += `Total Horas Fabricación: ${totalHorasFabricacion} horas\n`;
content += `Total Días Fabricación: ${Math.ceil(totalHorasFabricacion / 8)} días\n`;const analPos = window.open('', '_blank');
analPos.document.write(`
${content}
`);
analPos.document.close();
}document.getElementById('exportarAnalisis_POS').addEventListener('click', generarAnalisisPOS80mm);