mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 08:58:48 +00:00
acabando presupuesto
This commit is contained in:
@ -15,6 +15,13 @@ pdf.presupuesto.date=FECHA:
|
||||
|
||||
pdf.presupuesto.titulo=Título:
|
||||
|
||||
pdf.table.tirada=TIRADA
|
||||
pdf.table.impresion=IMPRESIÓN
|
||||
pdf.table.servicios=SERVICIOS
|
||||
pdf.table.iva-4=IVA 4%
|
||||
pdf.table.iva-21=IVA 21%
|
||||
pdf.table.precio-total=PRECIO TOTAL
|
||||
|
||||
pdf.politica-privacidad=Política de privacidad
|
||||
pdf.politica-privacidad.responsable=Responsable: Impresión Imprime Libros - CIF: B04998886 - Teléfono de contacto: 910052574
|
||||
pdf.politica-privacidad.correo-direccion=Correo electrónico: info@imprimelibros.com - Dirección postal: Calle José Picón, Nº 28 Local A, 28028, Madrid
|
||||
|
||||
@ -242,6 +242,7 @@ presupuesto.papel-gramaje=Papel y gramaje
|
||||
# Presupuesto de maquetación
|
||||
presupuesto.maquetacion=Presupuesto de maquetación
|
||||
presupuesto.maquetacion.num-caracteres=Número de caracteres
|
||||
presupuesto.maquetacion.caracteres=caracteres
|
||||
presupuesto.maquetacion.num-caracteres-descripcion=Caracteres con espacios (obtenidos desde Word)
|
||||
presupuesto.maquetacion.formato=Formato
|
||||
presupuesto.maquetacion.formato-descripcion=Seleccione el tamaño que más se aproxime
|
||||
|
||||
@ -3,7 +3,6 @@ import { formateaMoneda } from "../utils.js";
|
||||
|
||||
|
||||
$(document).on('change', '#maquetacion', function (e) {
|
||||
|
||||
e.preventDefault();
|
||||
if ($('#maquetacion').is(':checked')) {
|
||||
$.get("/presupuesto/public/maquetacion/form", function (data) {
|
||||
|
||||
@ -211,6 +211,7 @@ export default class PresupuestoWizard {
|
||||
this.#initDatosGenerales();
|
||||
|
||||
if (presupuestoId && mode !== 'public') {
|
||||
|
||||
await fetch(`/presupuesto/api/get?id=${encodeURIComponent(presupuestoId)}`, {
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
@ -218,12 +219,16 @@ export default class PresupuestoWizard {
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(dto => {
|
||||
sessionStorage.removeItem("formData");
|
||||
this.formData = dto;
|
||||
this.#cacheFormData();
|
||||
this.#loadDatosGeneralesData();
|
||||
});
|
||||
} else {
|
||||
if (stored) {
|
||||
sessionStorage.removeItem("formData");
|
||||
this.formData = JSON.parse(stored);
|
||||
this.#cacheFormData();
|
||||
this.#loadDatosGeneralesData();
|
||||
}
|
||||
}
|
||||
@ -290,8 +295,29 @@ export default class PresupuestoWizard {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Usa function() para que `this` sea el botón
|
||||
$('.btn-imprimir').on('click', (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
// obtén el id de donde lo tengas (data-attr o variable global)
|
||||
const id = this.opts.presupuestoId;
|
||||
|
||||
const url = `/api/pdf/presupuesto/${id}?mode=download`;
|
||||
|
||||
// Truco: crear <a> y hacer click
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.target = '_self'; // descarga en la misma pestaña
|
||||
// a.download = `presupuesto-${id}.pdf`; // opcional, tu server ya pone filename
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
async #guardarPresupuesto() {
|
||||
@ -1742,7 +1768,7 @@ export default class PresupuestoWizard {
|
||||
this.divExtras.append(item.render());
|
||||
}
|
||||
|
||||
if (!this.formData.servicios.servicios.includes(s => s.id === "ferro-digital")) {
|
||||
if (!this.formData.servicios.servicios.some(s => s.id === "ferro-digital")) {
|
||||
this.formData.servicios.servicios.push({
|
||||
id: "ferro-digital",
|
||||
label: "Ferro Digital",
|
||||
@ -1776,6 +1802,15 @@ export default class PresupuestoWizard {
|
||||
...result,
|
||||
};
|
||||
|
||||
if (!this.formData.servicios.servicios.some(s => s.id === "maquetacion") && result.precio > 0) {
|
||||
this.formData.servicios.servicios.push({
|
||||
id: "maquetacion",
|
||||
label: $(`label[for="maquetacion"] .service-title`).text().trim(),
|
||||
units: 1,
|
||||
price: result.precio,
|
||||
});
|
||||
}
|
||||
|
||||
this.#cacheFormData();
|
||||
});
|
||||
}
|
||||
|
||||
@ -71,72 +71,8 @@
|
||||
<!-- DATOS TÉCNICOS EN 2 COLUMNAS -->
|
||||
<div class="specs-wrapper align-with-text ">
|
||||
<div class="specs">
|
||||
<div class="col">
|
||||
<div class="block-title">Encuadernación</div>
|
||||
<div class="kv"><span>Encuadernación:</span><b th:text="${encuadernacion} ?: 'Fresado'">Fresado</b></div>
|
||||
<div class="kv"><span>Formato:</span><b>
|
||||
<span th:text="${ancho}">148</span>x<span th:text="${alto}">210</span> mm
|
||||
</b></div>
|
||||
<div class="kv"><span>Páginas:</span><b th:text="${paginasTotales} ?: 132">132</b></div>
|
||||
<div class="kv"><span>Páginas Negro:</span><b th:text="${paginasNegro} ?: 100">100</b></div>
|
||||
<div class="kv"><span>Páginas Color:</span><b th:text="${paginasColor} ?: 32">32</b></div>
|
||||
|
||||
<div class="subblock">
|
||||
<div class="block-title">Interior</div>
|
||||
<div class="kv"><span>Tipo de impresión:</span><b
|
||||
th:text="${interior?.tipoImpresion} ?: 'Color Premium'">Color
|
||||
Premium</b></div>
|
||||
<div class="kv"><span>Papel interior:</span><b th:text="${interior?.papel} ?: 'Estucado Mate'">Estucado
|
||||
Mate</b>
|
||||
</div>
|
||||
<div class="kv"><span>Gramaje interior:</span><b th:text="${interior?.gramaje} ?: 115">115</b></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="subblock">
|
||||
<div class="block-title">Cubierta</div>
|
||||
<div class="kv"><span>Tipo de cubierta:</span><b th:text="${cubierta?.tipo} ?: 'Tapa blanda'">Tapa
|
||||
blanda</b>
|
||||
</div>
|
||||
<div class="kv"><span>Solapas:</span><b th:text="${cubierta?.solapas} ?: 'Sí'">Sí</b></div>
|
||||
<div class="kv"><span>Tamaño solapas:</span><b th:text="${cubierta?.tamSolapas} ?: '80 mm'">80 mm</b></div>
|
||||
<div class="kv"><span>Impresión:</span><b th:text="${cubierta?.impresion} ?: 'Una cara'">Una cara</b></div>
|
||||
<div class="kv"><span>Papel cubierta:</span><b th:text="${cubierta?.papel} ?: 'Estucado mate'">Estucado
|
||||
mate</b>
|
||||
</div>
|
||||
<div class="kv"><span>Gramaje cubierta:</span><b th:text="${cubierta?.gramaje} ?: 250">250</b></div>
|
||||
<div class="kv"><span>Acabado:</span><b
|
||||
th:text="${cubierta?.acabado} ?: 'Plastificado Brillo 1/C'">Plastificado
|
||||
Brillo 1/C</b></div>
|
||||
</div>
|
||||
|
||||
<div class="subblock">
|
||||
<div class="block-title">Servicios Extras</div>
|
||||
<!-- Ejemplos específicos -->
|
||||
<div class="kv" th:if="${servicios != null}">
|
||||
<ul class="services">
|
||||
<li th:each="s : ${servicios}">
|
||||
<span th:text="${s.descripcion}">Ferro Digital</span>
|
||||
<span th:if="${s.precio != null}"
|
||||
th:text="${#numbers.formatDecimal(s.precio,1,'POINT',2,'COMMA')} + ' €'">0,00 €</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Bloque marcapáginas (si existe en servicios) -->
|
||||
<div class="bookmark" th:if="${marcapaginas != null}">
|
||||
<div class="bk-title">Marcapáginas</div>
|
||||
<div class="kv"><span>Tamaño:</span><b th:text="${marcapaginas.tamano} ?: '50x210'">50x210</b></div>
|
||||
<div class="kv"><span>Papel:</span><b th:text="${marcapaginas.papel} ?: 'Estucado mate 300 g'">Estucado
|
||||
mate
|
||||
300 g</b></div>
|
||||
<div class="kv"><span>Impresión:</span><b th:text="${marcapaginas.impresion} ?: 'Una cara'">Una cara</b>
|
||||
</div>
|
||||
<div class="kv"><span>Plastificado:</span><b th:text="${marcapaginas.plastificado} ?: 'Brillo 1/C'">Brillo
|
||||
1/C</b></div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:utext="${especificaciones} ?: '<em>Sin especificaciones técnicas.</em>'">
|
||||
<em>Sin especificaciones técnicas.</em>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .specs-wrapper -->
|
||||
@ -145,20 +81,22 @@
|
||||
<table class="prices">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-tirada">TIRADA</th>
|
||||
<th>IMPRESIÓN</th>
|
||||
<th>IVA</th>
|
||||
<th>TOTAL</th>
|
||||
<th>UNIDAD</th>
|
||||
<th class="text-center col-tirada" th:text="#{pdf.table.tirada}">TIRADA</th>
|
||||
<th class="text-center" th:text="#{pdf.table.impresion}">IMPRESIÓN</th>
|
||||
<th class="text-center" th:text="#{pdf.table.servicios}">SERVICIOS</th>
|
||||
<th class="text-center" th:if="${pricing.show_iva_4}" th:text="#{pdf.table.iva-4}">IVA 4%</th>
|
||||
<th class="text-center" th:if="${pricing.show_iva_21}" th:text="#{pdf.table.iva-21}">IVA 21%</th>
|
||||
<th class="text-center" th:text="#{pdf.table.precio-total}">PRECIO TOTAL</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody th:if="${pricing != null and pricing.tiradas != null}">
|
||||
<tr th:each="t, st : ${pricing.tiradas}">
|
||||
<td class="col-tirada" th:text="${t} + ' uds.'">100 uds.</td>
|
||||
<td th:text="${#numbers.formatDecimal(pricing.impresion[st.index],1,'POINT',2,'COMMA')} + '€'">152,15€</td>
|
||||
<td th:text="${#numbers.formatDecimal(pricing.iva[st.index],1,'POINT',2,'COMMA')} + '€'">7,68€</td>
|
||||
<td th:text="${#numbers.formatDecimal(pricing.total[st.index],1,'POINT',2,'COMMA')} + '€'">159,99€</td>
|
||||
<td th:text="${#numbers.formatDecimal(pricing.unidad[st.index],1,'POINT',2,'COMMA')} + '€'">1,52€</td>
|
||||
<td class="text-center col-tirada" th:text="${t}">100 uds.</td>
|
||||
<td class="text-center" th:text="${pricing.impresion[st.index]}">152,15€</td>
|
||||
<td class="text-center" th:text="${pricing.servicios[st.index]}">7,68€</td>
|
||||
<td class="text-center" th:if="${pricing.show_iva_4}" th:text="${pricing.iva_4[st.index]}">7,68€</td>
|
||||
<td class="text-center" th:if="${pricing.show_iva_21}" th:text="${pricing.iva_21[st.index]}">7,68€</td>
|
||||
<td class="text-center" th:text="${pricing.total[st.index]}">159,99€</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@ -177,7 +115,8 @@
|
||||
<div class="footer">
|
||||
<div class="privacy">
|
||||
<div class="pv-title" th:text="#{pdf.politica-privacidad}">Política de privacidad</div>
|
||||
<div class="pv-text" th:text="#{pdf.politica-privacidad.responsable}">Responsable: Impresión Imprime Libros - CIF:
|
||||
<div class="pv-text" th:text="#{pdf.politica-privacidad.responsable}">Responsable: Impresión Imprime Libros -
|
||||
CIF:
|
||||
B04998886 - Teléfono de contacto: 910052574</div>
|
||||
<div class="pv-text" th:text="#{pdf.politica-privacidad.correo-direccion}">Correo electrónico:
|
||||
info@imprimelibros.com - Dirección postal: Calle José Picón, Nº 28 Local A, 28028, Madrid</div>
|
||||
|
||||
Reference in New Issue
Block a user