mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
terminado hasta gramaje de cubierta
This commit is contained in:
@ -11,7 +11,7 @@ services:
|
|||||||
MYSQL_USER: imprimelibros_user
|
MYSQL_USER: imprimelibros_user
|
||||||
MYSQL_PASSWORD: om91irrDctd
|
MYSQL_PASSWORD: om91irrDctd
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3309:3306"
|
||||||
volumes:
|
volumes:
|
||||||
- db_data:/var/lib/mysql
|
- db_data:/var/lib/mysql
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@ -85,11 +85,13 @@
|
|||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-test</artifactId>
|
<artifactId>spring-security-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@ -33,9 +33,6 @@ public class PresupuestadorItems {
|
|||||||
|
|
||||||
public ImagenPresupuesto getImpresionColor(Locale locale) {
|
public ImagenPresupuesto getImpresionColor(Locale locale) {
|
||||||
|
|
||||||
String clave = "presupuesto.color"; // ✅
|
|
||||||
String texto = messageSource.getMessage(clave, null, locale);
|
|
||||||
System.out.println("Clave: " + clave + " => Texto: " + texto);
|
|
||||||
return new ImagenPresupuesto(
|
return new ImagenPresupuesto(
|
||||||
"color",
|
"color",
|
||||||
"/assets/images/imprimelibros/presupuestador/color.png",
|
"/assets/images/imprimelibros/presupuestador/color.png",
|
||||||
@ -64,6 +61,17 @@ public class PresupuestadorItems {
|
|||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImagenPresupuesto getPapelOffsetBlancoVolumen(Locale locale) {
|
||||||
|
|
||||||
|
return new ImagenPresupuesto(
|
||||||
|
"offset-blanco-volumen",
|
||||||
|
"/assets/images/imprimelibros/presupuestador/offset-blanco.png",
|
||||||
|
"",
|
||||||
|
messageSource.getMessage("presupuesto.offset-blanco-volumen", null, locale),
|
||||||
|
Map.of("sk-id", "7"),
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
|
||||||
public ImagenPresupuesto getPapelOffsetAhuesado(Locale locale) {
|
public ImagenPresupuesto getPapelOffsetAhuesado(Locale locale) {
|
||||||
|
|
||||||
return new ImagenPresupuesto(
|
return new ImagenPresupuesto(
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import com.imprimelibros.erp.service.PresupuestoService;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -17,10 +18,10 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import com.imprimelibros.erp.config.Presupuestador.ImagenPresupuesto;
|
||||||
|
|
||||||
import com.imprimelibros.erp.config.validation.PresupuestoValidationGroups;
|
import com.imprimelibros.erp.config.validation.PresupuestoValidationGroups;
|
||||||
import com.imprimelibros.erp.entity.Presupuesto;
|
import com.imprimelibros.erp.entity.Presupuesto;
|
||||||
|
import com.imprimelibros.erp.externalApi.skApiClient;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/presupuesto")
|
@RequestMapping("/presupuesto")
|
||||||
@ -29,6 +30,9 @@ public class PresupuestoController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected PresupuestoService presupuestoService;
|
protected PresupuestoService presupuestoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected skApiClient apiClient;
|
||||||
|
|
||||||
@PostMapping("/public/validar/datos-generales")
|
@PostMapping("/public/validar/datos-generales")
|
||||||
public ResponseEntity<?> validarDatosGenerales(
|
public ResponseEntity<?> validarDatosGenerales(
|
||||||
@Validated(PresupuestoValidationGroups.DatosGenerales.class) Presupuesto presupuesto,
|
@Validated(PresupuestoValidationGroups.DatosGenerales.class) Presupuesto presupuesto,
|
||||||
@ -48,6 +52,19 @@ public class PresupuestoController {
|
|||||||
|
|
||||||
// opciones color
|
// opciones color
|
||||||
Map<String, Object> resultado = presupuestoService.obtenerOpcionesColor(presupuesto, locale);
|
Map<String, Object> resultado = presupuestoService.obtenerOpcionesColor(presupuesto, locale);
|
||||||
|
List<ImagenPresupuesto> opcionesColor = (List<ImagenPresupuesto>) resultado.get("opciones_color");
|
||||||
|
if (opcionesColor != null && !opcionesColor.isEmpty()) {
|
||||||
|
Presupuesto.TipoImpresion colorActual = presupuesto.getTipoImpresion();
|
||||||
|
if (!opcionesColor.stream().anyMatch(opcion -> opcion.getId().equals(colorActual.name()))) {
|
||||||
|
String idSeleccionado = opcionesColor.get(0).getId();
|
||||||
|
try {
|
||||||
|
Presupuesto.TipoImpresion tipo = Presupuesto.TipoImpresion.valueOf(idSeleccionado);
|
||||||
|
presupuesto.setTipoImpresion(tipo);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
System.err.println("Tipo de impresión no válido: " + idSeleccionado);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// opciones papel interior
|
// opciones papel interior
|
||||||
resultado.putAll(presupuestoService.obtenerOpcionesPapelInterior(presupuesto, locale));
|
resultado.putAll(presupuestoService.obtenerOpcionesPapelInterior(presupuesto, locale));
|
||||||
@ -57,7 +74,6 @@ public class PresupuestoController {
|
|||||||
return ResponseEntity.ok(resultado);
|
return ResponseEntity.ok(resultado);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/public/validar/interior")
|
@PostMapping("/public/validar/interior")
|
||||||
public ResponseEntity<?> validarInterior(
|
public ResponseEntity<?> validarInterior(
|
||||||
@Validated(PresupuestoValidationGroups.Interior.class) Presupuesto presupuesto,
|
@Validated(PresupuestoValidationGroups.Interior.class) Presupuesto presupuesto,
|
||||||
@ -74,9 +90,42 @@ public class PresupuestoController {
|
|||||||
if (!errores.isEmpty()) {
|
if (!errores.isEmpty()) {
|
||||||
return ResponseEntity.badRequest().body(errores);
|
return ResponseEntity.badRequest().body(errores);
|
||||||
}
|
}
|
||||||
return ResponseEntity.ok(Collections.singletonMap("success", true));
|
Map<String, Object> resultado = new HashMap<>();
|
||||||
|
resultado.put("solapas", apiClient.getMaxSolapas(presupuestoService.toSkApiRequest(presupuesto)));
|
||||||
|
return ResponseEntity.ok(resultado);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/public/get-papel-interior")
|
||||||
|
public ResponseEntity<?> getPapelInterior(
|
||||||
|
@Validated(PresupuestoValidationGroups.Interior.class) Presupuesto presupuesto,
|
||||||
|
BindingResult result, Locale locale) {
|
||||||
|
|
||||||
|
Map<String, String> errores = new HashMap<>();
|
||||||
|
|
||||||
|
// errores de campos individuales
|
||||||
|
result.getFieldErrors().forEach(error -> errores.put(error.getField(), error.getDefaultMessage()));
|
||||||
|
|
||||||
|
if (!errores.isEmpty()) {
|
||||||
|
return ResponseEntity.badRequest().body(errores);
|
||||||
|
}
|
||||||
|
|
||||||
|
// opciones color
|
||||||
|
Map<String, Object> resultado = presupuestoService.obtenerOpcionesPapelInterior(presupuesto, locale);
|
||||||
|
|
||||||
|
// opciones gramaje interior
|
||||||
|
resultado.putAll(presupuestoService.obtenerOpcionesGramajeInterior(presupuesto));
|
||||||
|
List<String> opciones = (List<String>) resultado.get("opciones_gramaje_interior");
|
||||||
|
|
||||||
|
if (opciones != null && !opciones.isEmpty()) {
|
||||||
|
String gramajeActual = presupuesto.getGramajeInterior().toString();
|
||||||
|
if (!opciones.contains(gramajeActual)) {
|
||||||
|
presupuesto.setGramajeInterior(Integer.parseInt(opciones.get(0))); // Asignar primera opción
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resultado.put("solapas", apiClient.getMaxSolapas(presupuestoService.toSkApiRequest(presupuesto)));
|
||||||
|
return ResponseEntity.ok(resultado);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/public/get-gramaje-interior")
|
@PostMapping("/public/get-gramaje-interior")
|
||||||
public ResponseEntity<?> getGramajeInterior(
|
public ResponseEntity<?> getGramajeInterior(
|
||||||
@ -93,6 +142,34 @@ public class PresupuestoController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> resultado = presupuestoService.obtenerOpcionesGramajeInterior(presupuesto);
|
Map<String, Object> resultado = presupuestoService.obtenerOpcionesGramajeInterior(presupuesto);
|
||||||
|
List<String> opciones = (List<String>) resultado.get("opciones_gramaje_interior");
|
||||||
|
|
||||||
|
if (opciones != null && !opciones.isEmpty()) {
|
||||||
|
String gramajeActual = presupuesto.getGramajeInterior().toString();
|
||||||
|
if (!opciones.contains(gramajeActual)) {
|
||||||
|
presupuesto.setGramajeInterior(Integer.parseInt(opciones.get(0))); // Asignar primera opción
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resultado.put("solapas", apiClient.getMaxSolapas(presupuestoService.toSkApiRequest(presupuesto)));
|
||||||
|
return ResponseEntity.ok(resultado);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/public/get-max-solapas")
|
||||||
|
public ResponseEntity<?> getMaxSolapas(
|
||||||
|
@Validated(PresupuestoValidationGroups.Interior.class) Presupuesto presupuesto,
|
||||||
|
BindingResult result) {
|
||||||
|
|
||||||
|
Map<String, String> errores = new HashMap<>();
|
||||||
|
|
||||||
|
// errores de campos individuales
|
||||||
|
result.getFieldErrors().forEach(error -> errores.put(error.getField(), error.getDefaultMessage()));
|
||||||
|
|
||||||
|
if (!errores.isEmpty()) {
|
||||||
|
return ResponseEntity.badRequest().body(errores);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> resultado = new HashMap<>();
|
||||||
|
resultado.put("solapas", apiClient.getMaxSolapas(presupuestoService.toSkApiRequest(presupuesto)));
|
||||||
return ResponseEntity.ok(resultado);
|
return ResponseEntity.ok(resultado);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +178,42 @@ public class PresupuestoController {
|
|||||||
Presupuesto presupuesto,
|
Presupuesto presupuesto,
|
||||||
BindingResult result, Locale locale) {
|
BindingResult result, Locale locale) {
|
||||||
|
|
||||||
Map<String, Object> resultado = presupuestoService.obtenerOpcionesPapelCubierta(presupuesto, locale);
|
Map<String, Object> resultado = new HashMap<>();
|
||||||
|
Map<String, Object> papelesCubierta = presupuestoService.obtenerOpcionesPapelCubierta(presupuesto, locale);
|
||||||
|
List<ImagenPresupuesto> opciones = (List<ImagenPresupuesto>) presupuestoService
|
||||||
|
.obtenerOpcionesPapelCubierta(presupuesto, locale)
|
||||||
|
.get("opciones_papel_cubierta");
|
||||||
|
|
||||||
|
if (opciones != null && opciones.stream().noneMatch(
|
||||||
|
o -> o.getExtra_data().get("sk-id").equals(String.valueOf(presupuesto.getPapelCubiertaId())))) {
|
||||||
|
presupuesto.setPapelCubiertaId(Integer.valueOf(opciones.get(0).getExtra_data().get("sk-id")));
|
||||||
|
}
|
||||||
|
resultado.putAll(papelesCubierta);
|
||||||
|
|
||||||
|
resultado.putAll(presupuestoService.obtenerOpcionesGramajeCubierta(presupuesto));
|
||||||
|
List<String> gramajesCubierta = (List<String>) resultado.get("opciones_gramaje_cubierta");
|
||||||
|
if (gramajesCubierta != null && !gramajesCubierta.isEmpty()) {
|
||||||
|
String gramajeActual = presupuesto.getGramajeCubierta().toString();
|
||||||
|
if (!gramajesCubierta.contains(gramajeActual)) {
|
||||||
|
presupuesto.setGramajeCubierta(Integer.parseInt(gramajesCubierta.get(0))); // Asignar primera opción
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ResponseEntity.ok(resultado);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/public/get-gramaje-cubierta")
|
||||||
|
public ResponseEntity<?> getGramajeCubierta(
|
||||||
|
Presupuesto presupuesto,
|
||||||
|
BindingResult result) {
|
||||||
|
|
||||||
|
Map<String, Object> resultado = presupuestoService.obtenerOpcionesGramajeCubierta(presupuesto);
|
||||||
|
List<String> gramajesCubierta = (List<String>) resultado.get("opciones_gramaje_cubierta");
|
||||||
|
if (gramajesCubierta != null && !gramajesCubierta.isEmpty()) {
|
||||||
|
String gramajeActual = presupuesto.getGramajeCubierta().toString();
|
||||||
|
if (!gramajesCubierta.contains(gramajeActual)) {
|
||||||
|
presupuesto.setGramajeCubierta(Integer.parseInt(gramajesCubierta.get(0))); // Asignar primera opción
|
||||||
|
}
|
||||||
|
}
|
||||||
return ResponseEntity.ok(resultado);
|
return ResponseEntity.ok(resultado);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,10 +7,15 @@ import jakarta.persistence.*;
|
|||||||
import com.imprimelibros.erp.config.validation.PresupuestoValidationGroups;
|
import com.imprimelibros.erp.config.validation.PresupuestoValidationGroups;
|
||||||
import com.imprimelibros.erp.config.validation.Tamanio;
|
import com.imprimelibros.erp.config.validation.Tamanio;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.imprimelibros.erp.config.validation.ConsistentTiradas;
|
import com.imprimelibros.erp.config.validation.ConsistentTiradas;
|
||||||
import com.imprimelibros.erp.config.validation.Par;
|
import com.imprimelibros.erp.config.validation.Par;
|
||||||
|
|
||||||
|
|
||||||
@ConsistentTiradas(groups = PresupuestoValidationGroups.DatosGenerales.class)
|
@ConsistentTiradas(groups = PresupuestoValidationGroups.DatosGenerales.class)
|
||||||
@Tamanio(groups = PresupuestoValidationGroups.DatosGenerales.class)
|
@Tamanio(groups = PresupuestoValidationGroups.DatosGenerales.class)
|
||||||
@Entity
|
@Entity
|
||||||
@ -25,8 +30,8 @@ public class Presupuesto {
|
|||||||
negro, negrohq, color, colorhq
|
negro, negrohq, color, colorhq
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TipoCubierta{
|
public enum TipoCubierta {
|
||||||
tapaBlanda, tapaDuraLomoRecto, tapaDuraLomoRedondo
|
tapaBlanda, tapaDura, tapaDuraLomoRedondo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@ -97,7 +102,7 @@ public class Presupuesto {
|
|||||||
|
|
||||||
@NotNull(message = "{presupuesto.errores.gramaje-interior}", groups = PresupuestoValidationGroups.Interior.class)
|
@NotNull(message = "{presupuesto.errores.gramaje-interior}", groups = PresupuestoValidationGroups.Interior.class)
|
||||||
@Column(name = "gramaje_interior")
|
@Column(name = "gramaje_interior")
|
||||||
private Integer gramejeInterior;
|
private Integer gramajeInterior;
|
||||||
|
|
||||||
@NotNull(message = "{presupuesto.errores.tipo-cubierta}", groups = PresupuestoValidationGroups.Cubierta.class)
|
@NotNull(message = "{presupuesto.errores.tipo-cubierta}", groups = PresupuestoValidationGroups.Cubierta.class)
|
||||||
@Column(name = "tipo_cubierta")
|
@Column(name = "tipo_cubierta")
|
||||||
@ -179,7 +184,7 @@ public class Presupuesto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Integer[] getTiradas() {
|
public Integer[] getTiradas() {
|
||||||
return new Integer[]{tirada1, tirada2, tirada3, tirada4};
|
return new Integer[] { tirada1, tirada2, tirada3, tirada4 };
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTirada4(Integer tirada4) {
|
public void setTirada4(Integer tirada4) {
|
||||||
@ -282,12 +287,12 @@ public class Presupuesto {
|
|||||||
this.papelInteriorId = papelInteriorId;
|
this.papelInteriorId = papelInteriorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getGramejeInterior() {
|
public Integer getGramajeInterior() {
|
||||||
return gramejeInterior;
|
return gramajeInterior;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGramejeInterior(Integer gramejeInterior) {
|
public void setGramajeInterior(Integer gramajeInterior) {
|
||||||
this.gramejeInterior = gramejeInterior;
|
this.gramajeInterior = gramajeInterior;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TipoCubierta getTipoCubierta() {
|
public TipoCubierta getTipoCubierta() {
|
||||||
@ -370,6 +375,4 @@ public class Presupuesto {
|
|||||||
this.gramajeCubierta = gramajeCubierta;
|
this.gramajeCubierta = gramajeCubierta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package com.imprimelibros.erp.service;
|
package com.imprimelibros.erp.service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -12,6 +15,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import com.imprimelibros.erp.config.Presupuestador.ImagenPresupuesto;
|
import com.imprimelibros.erp.config.Presupuestador.ImagenPresupuesto;
|
||||||
import com.imprimelibros.erp.config.Presupuestador.PresupuestadorItems;
|
import com.imprimelibros.erp.config.Presupuestador.PresupuestadorItems;
|
||||||
import com.imprimelibros.erp.entity.Presupuesto;
|
import com.imprimelibros.erp.entity.Presupuesto;
|
||||||
|
import com.imprimelibros.erp.entity.Presupuesto.TipoCubierta;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class PresupuestoService {
|
public class PresupuestoService {
|
||||||
@ -92,8 +96,15 @@ public class PresupuestoService {
|
|||||||
List<ImagenPresupuesto> opciones = new ArrayList<>();
|
List<ImagenPresupuesto> opciones = new ArrayList<>();
|
||||||
|
|
||||||
opciones.add(this.presupuestadorItems.getPapelOffsetBlanco(locale));
|
opciones.add(this.presupuestadorItems.getPapelOffsetBlanco(locale));
|
||||||
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
||||||
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
||||||
|
opciones.add(this.presupuestadorItems.getPapelOffsetBlancoVolumen(locale));
|
||||||
|
}
|
||||||
opciones.add(this.presupuestadorItems.getPapelOffsetAhuesado(locale));
|
opciones.add(this.presupuestadorItems.getPapelOffsetAhuesado(locale));
|
||||||
opciones.add(this.presupuestadorItems.getPapelOffsetAhuesadoVolumen(locale));
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
||||||
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
||||||
|
opciones.add(this.presupuestadorItems.getPapelOffsetAhuesadoVolumen(locale));
|
||||||
|
}
|
||||||
opciones.add(this.presupuestadorItems.getPapelEstucadoMate(locale));
|
opciones.add(this.presupuestadorItems.getPapelEstucadoMate(locale));
|
||||||
|
|
||||||
for (ImagenPresupuesto imagenPresupuesto : opciones) {
|
for (ImagenPresupuesto imagenPresupuesto : opciones) {
|
||||||
@ -126,25 +137,38 @@ public class PresupuestoService {
|
|||||||
List<String> gramajes = new ArrayList<>();
|
List<String> gramajes = new ArrayList<>();
|
||||||
|
|
||||||
final int BLANCO_OFFSET_ID = 3;
|
final int BLANCO_OFFSET_ID = 3;
|
||||||
|
final int BLANCO_OFFSET_VOLUMEN_ID = 7;
|
||||||
final int AHUESADO_OFFSET_ID = 4;
|
final int AHUESADO_OFFSET_ID = 4;
|
||||||
final int AHUESADO_OFFSET_VOLUMEN_ID = 6;
|
final int AHUESADO_OFFSET_VOLUMEN_ID = 6;
|
||||||
final int ESTUCADO_MATE_ID = 2;
|
final int ESTUCADO_MATE_ID = 2;
|
||||||
|
|
||||||
if (presupuesto.getPapelInteriorId() != null && presupuesto.getPapelInteriorId() == BLANCO_OFFSET_ID) {
|
if (presupuesto.getPapelInteriorId() != null && presupuesto.getPapelInteriorId() == BLANCO_OFFSET_ID) {
|
||||||
|
|
||||||
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
gramajes.add("80");
|
||||||
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
|
||||||
gramajes.add("80");
|
|
||||||
}
|
|
||||||
gramajes.add("90");
|
gramajes.add("90");
|
||||||
} else if (presupuesto.getPapelInteriorId() != null && presupuesto.getPapelInteriorId() == AHUESADO_OFFSET_ID) {
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negrohq ||
|
||||||
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.colorhq) {
|
||||||
|
gramajes.add("100");
|
||||||
|
gramajes.add("120");
|
||||||
|
gramajes.add("150");
|
||||||
|
gramajes.add("170");
|
||||||
|
}
|
||||||
|
} else if (presupuesto.getPapelInteriorId() != null
|
||||||
|
&& presupuesto.getPapelInteriorId() == BLANCO_OFFSET_VOLUMEN_ID) {
|
||||||
|
|
||||||
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
||||||
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
||||||
gramajes.add("80");
|
gramajes.add("80");
|
||||||
}
|
}
|
||||||
gramajes.add("150");
|
|
||||||
gramajes.add("170");
|
} else if (presupuesto.getPapelInteriorId() != null && presupuesto.getPapelInteriorId() == AHUESADO_OFFSET_ID) {
|
||||||
|
|
||||||
|
gramajes.add("80");
|
||||||
|
gramajes.add("90");
|
||||||
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negrohq ||
|
||||||
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.colorhq) {
|
||||||
|
gramajes.add("100");
|
||||||
|
}
|
||||||
|
|
||||||
} else if (presupuesto.getPapelInteriorId() != null
|
} else if (presupuesto.getPapelInteriorId() != null
|
||||||
&& presupuesto.getPapelInteriorId() == AHUESADO_OFFSET_VOLUMEN_ID) {
|
&& presupuesto.getPapelInteriorId() == AHUESADO_OFFSET_VOLUMEN_ID) {
|
||||||
@ -152,21 +176,31 @@ public class PresupuestoService {
|
|||||||
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
||||||
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
||||||
gramajes.add("70");
|
gramajes.add("70");
|
||||||
|
gramajes.add("80");
|
||||||
}
|
}
|
||||||
gramajes.add("90");
|
|
||||||
gramajes.add("100");
|
|
||||||
gramajes.add("150");
|
|
||||||
gramajes.add("170");
|
|
||||||
|
|
||||||
} else if (presupuesto.getPapelInteriorId() != null && presupuesto.getPapelInteriorId() == ESTUCADO_MATE_ID) {
|
} else if (presupuesto.getPapelInteriorId() != null && presupuesto.getPapelInteriorId() == ESTUCADO_MATE_ID) {
|
||||||
|
|
||||||
gramajes.add("90");
|
if (presupuesto.getTipoImpresion() != Presupuesto.TipoImpresion.color) {
|
||||||
gramajes.add("100");
|
gramajes.add("90");
|
||||||
gramajes.add("115");
|
}
|
||||||
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negrohq ||
|
||||||
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.colorhq) {
|
||||||
|
gramajes.add("100");
|
||||||
|
gramajes.add("115");
|
||||||
|
}
|
||||||
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negro ||
|
||||||
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.color) {
|
||||||
gramajes.add("120");
|
gramajes.add("120");
|
||||||
}
|
}
|
||||||
gramajes.add("135");
|
if (presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.negrohq ||
|
||||||
|
presupuesto.getTipoImpresion() == Presupuesto.TipoImpresion.colorhq) {
|
||||||
|
gramajes.add("125");
|
||||||
|
gramajes.add("135");
|
||||||
|
gramajes.add("150");
|
||||||
|
gramajes.add("170");
|
||||||
|
gramajes.add("200");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> response = new HashMap<>();
|
Map<String, Object> response = new HashMap<>();
|
||||||
@ -190,21 +224,136 @@ public class PresupuestoService {
|
|||||||
String.valueOf(presupuesto.getPapelCubiertaId())));
|
String.valueOf(presupuesto.getPapelCubiertaId())));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean opcionSeleccionada = opciones.stream()
|
|
||||||
.findFirst()
|
|
||||||
.map(opcion -> {
|
|
||||||
opcion.setSelected(true);
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.orElse(false);
|
|
||||||
if (!opcionSeleccionada) {
|
|
||||||
opciones.get(0).setSelected(true);
|
|
||||||
presupuesto.setPapelInteriorId(Integer.parseInt(opciones.get(0).getExtra_data().get("sk-id")));
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> response = new HashMap<>();
|
Map<String, Object> response = new HashMap<>();
|
||||||
response.put("opciones_papel_cubierta", opciones);
|
response.put("opciones_papel_cubierta", opciones);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> obtenerOpcionesGramajeCubierta(Presupuesto presupuesto) {
|
||||||
|
|
||||||
|
List<String> gramajes = new ArrayList<>();
|
||||||
|
|
||||||
|
final int CARTULINA_GRAFICA_ID = 3;
|
||||||
|
final int ESTUCADO_MATE_ID = 2;
|
||||||
|
|
||||||
|
if (presupuesto.getPapelCubiertaId() != null && presupuesto.getPapelCubiertaId() == CARTULINA_GRAFICA_ID) {
|
||||||
|
gramajes.add("240");
|
||||||
|
gramajes.add("270");
|
||||||
|
gramajes.add("300");
|
||||||
|
gramajes.add("350");
|
||||||
|
} else if (presupuesto.getPapelCubiertaId() != null && presupuesto.getPapelCubiertaId() == ESTUCADO_MATE_ID) {
|
||||||
|
if(presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaBlanda) {
|
||||||
|
|
||||||
|
gramajes.add("250");
|
||||||
|
gramajes.add("300");
|
||||||
|
gramajes.add("350");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
gramajes.add("170");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Object> response = new HashMap<>();
|
||||||
|
response.put("opciones_gramaje_cubierta", gramajes);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Map<String, Object> toSkApiRequest(Presupuesto presupuesto) {
|
||||||
|
|
||||||
|
final int SK_CLIENTE_ID = 1284;
|
||||||
|
final int SK_PAGINAS_CUADERNILLO = 32;
|
||||||
|
|
||||||
|
Map<String, Object> tamanio = Map.of(
|
||||||
|
"ancho", presupuesto.getAncho(),
|
||||||
|
"alto", presupuesto.getAlto());
|
||||||
|
Map<String, Object> interior = Map.of(
|
||||||
|
"papelInterior", presupuesto.getPapelInteriorId(),
|
||||||
|
"gramajeInterior", presupuesto.getGramajeInterior());
|
||||||
|
Map<String, Object> cubierta = Map.of(
|
||||||
|
"tipoCubierta", presupuesto.getTipoCubierta().name(),
|
||||||
|
"papelCubierta", presupuesto.getPapelCubiertaId(),
|
||||||
|
"gramajeCubierta", presupuesto.getGramajeCubierta(),
|
||||||
|
"carasImpresion", presupuesto.getCubiertaCaras(),
|
||||||
|
"solapas", presupuesto.getSolapasCubierta() ? presupuesto.getTamanioSolapasCubierta() : 0,
|
||||||
|
"acabado", 0, //// Añadir acabados
|
||||||
|
"cabezada", presupuesto.getCabezada(),
|
||||||
|
"lomoRedondo", presupuesto.getTipoCubierta() == TipoCubierta.tapaDuraLomoRedondo ? 1 : 0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Map<String, Object> sobrecubierta = new HashMap<>();
|
||||||
|
* sobrecubierta.put("papel", "2");
|
||||||
|
* sobrecubierta.put("gramaje", 170);
|
||||||
|
* sobrecubierta.put("solapas", 80);
|
||||||
|
* sobrecubierta.put("acabado", null);
|
||||||
|
*
|
||||||
|
* Map<String, Object> servicios = Map.of(
|
||||||
|
* "retractilado", 0,
|
||||||
|
* "retractilado5", 0,
|
||||||
|
* "ferro", 0,
|
||||||
|
* "ferroDigital", 0,
|
||||||
|
* "marcapaginas", 0,
|
||||||
|
* "prototipo", 0);
|
||||||
|
*/
|
||||||
|
Map<String, Object> body = new HashMap<>();
|
||||||
|
body.put("tipo_impresion_id", this.getTipoImpresionId(presupuesto));
|
||||||
|
body.put("tirada", Arrays.stream(presupuesto.getTiradas())
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList()));
|
||||||
|
body.put("tamanio", tamanio);
|
||||||
|
body.put("tipo", presupuesto.getTipoEncuadernacion());
|
||||||
|
body.put("clienteId", SK_CLIENTE_ID);
|
||||||
|
body.put("isColor", presupuesto.getTipoImpresion().name().contains("color") ? 1 : 0);
|
||||||
|
body.put("isHq", presupuesto.getTipoImpresion().name().contains("hq") ? 1 : 0);
|
||||||
|
body.put("paginas", presupuesto.getPaginasNegro() + presupuesto.getPaginasColor());
|
||||||
|
body.put("paginasColor", presupuesto.getPaginasColor());
|
||||||
|
body.put("paginasCuadernillo", SK_PAGINAS_CUADERNILLO);
|
||||||
|
body.put("interior", interior);
|
||||||
|
body.put("cubierta", cubierta);
|
||||||
|
// body.put("sobrecubierta", sobrecubierta);
|
||||||
|
body.put("guardas", null);
|
||||||
|
body.put("faja", false);
|
||||||
|
// body.put("servicios", servicios);
|
||||||
|
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTipoImpresionId(Presupuesto presupuesto) {
|
||||||
|
|
||||||
|
if (presupuesto.getTipoEncuadernacion() == Presupuesto.TipoEncuadernacion.fresado) {
|
||||||
|
if (presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDura ||
|
||||||
|
presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDuraLomoRedondo) {
|
||||||
|
return 1; // Fresado tapa dura
|
||||||
|
} else {
|
||||||
|
return 2; // Fresado tapa blanda
|
||||||
|
}
|
||||||
|
} else if (presupuesto.getTipoEncuadernacion() == Presupuesto.TipoEncuadernacion.cosido) {
|
||||||
|
if (presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDura ||
|
||||||
|
presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDuraLomoRedondo) {
|
||||||
|
return 3; // Cosido tapa dura
|
||||||
|
} else {
|
||||||
|
return 4; // Cosido tapa blanda
|
||||||
|
}
|
||||||
|
} else if (presupuesto.getTipoEncuadernacion() == Presupuesto.TipoEncuadernacion.espiral) {
|
||||||
|
if (presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDura ||
|
||||||
|
presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDuraLomoRedondo) {
|
||||||
|
return 5; // Espiral tapa dura
|
||||||
|
} else {
|
||||||
|
return 6; // Espiral tapa blanda
|
||||||
|
}
|
||||||
|
} else if (presupuesto.getTipoEncuadernacion() == Presupuesto.TipoEncuadernacion.wireo) {
|
||||||
|
if (presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDura ||
|
||||||
|
presupuesto.getTipoCubierta() == Presupuesto.TipoCubierta.tapaDuraLomoRedondo) {
|
||||||
|
return 7; // Wireo tapa dura
|
||||||
|
} else {
|
||||||
|
return 8; // Wireo tapa blanda
|
||||||
|
}
|
||||||
|
} else if (presupuesto.getTipoEncuadernacion() == Presupuesto.TipoEncuadernacion.grapado) {
|
||||||
|
return 21; // Grapado
|
||||||
|
} else {
|
||||||
|
return 0; // Default case, no valid type
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,10 +4,14 @@ logging.level.org.springframework.security=DEBUG
|
|||||||
logging.level.root=WARN
|
logging.level.root=WARN
|
||||||
logging.level.org.springframework=ERROR
|
logging.level.org.springframework=ERROR
|
||||||
|
|
||||||
spring.datasource.url=jdbc:mysql://localhost:3306/imprimelibros
|
spring.datasource.url=jdbc:mysql://localhost:3309/imprimelibros
|
||||||
spring.datasource.username=imprimelibros_user
|
spring.datasource.username=imprimelibros_user
|
||||||
spring.datasource.password=om91irrDctd
|
spring.datasource.password=om91irrDctd
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
|
||||||
|
safekat.api.url=http://localhost:8000/
|
||||||
|
safekat.api.email=imnavajas@coit.es
|
||||||
|
safekat.api.password"=Safekat2024
|
||||||
|
|
||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
spring.jpa.show-sql=true
|
spring.jpa.show-sql=true
|
||||||
@ -48,6 +48,7 @@ presupuesto.blanco-negro-premium= Blanco y negro Premium
|
|||||||
presupuesto.color=Color
|
presupuesto.color=Color
|
||||||
presupuesto.color-premium=Color Premium
|
presupuesto.color-premium=Color Premium
|
||||||
presupuesto.offset-blanco=Offset Blanco
|
presupuesto.offset-blanco=Offset Blanco
|
||||||
|
presupuesto.offset-blanco-volumen=Offset Blanco Volumen
|
||||||
presupuesto.offset-ahuesado=Offset Ahuesado
|
presupuesto.offset-ahuesado=Offset Ahuesado
|
||||||
presupuesto.offset-ahuesado-volumen=Offset Ahuesado Volumen
|
presupuesto.offset-ahuesado-volumen=Offset Ahuesado Volumen
|
||||||
presupuesto.estucado-mate=Estucado Mate
|
presupuesto.estucado-mate=Estucado Mate
|
||||||
@ -85,7 +86,8 @@ presupuesto.gramaje-cubierta=Gramaje cubierta
|
|||||||
presupuesto.gramaje-cubierta-descripcion=Seleccione el gramaje para la cubierta
|
presupuesto.gramaje-cubierta-descripcion=Seleccione el gramaje para la cubierta
|
||||||
presupuesto.volver-interior=Volver a diseño interior
|
presupuesto.volver-interior=Volver a diseño interior
|
||||||
presupuesto.continuar-extras-libro=Continuar a extras del libro
|
presupuesto.continuar-extras-libro=Continuar a extras del libro
|
||||||
|
presupuesto.offset=Offset
|
||||||
|
presupuesto.estucado=Estucado
|
||||||
|
|
||||||
# Errores
|
# Errores
|
||||||
presupuesto.errores-title=Corrija los siguientes errores:
|
presupuesto.errores-title=Corrija los siguientes errores:
|
||||||
|
|||||||
@ -92,4 +92,5 @@
|
|||||||
.animate-fadeInUpBounce {
|
.animate-fadeInUpBounce {
|
||||||
animation: fadeInUpBounce 0.6s ease-out both;
|
animation: fadeInUpBounce 0.6s ease-out both;
|
||||||
animation-delay: 0.1s;
|
animation-delay: 0.1s;
|
||||||
|
will-change: transform;
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@ class PresupuestoCliente {
|
|||||||
interior: {
|
interior: {
|
||||||
tipoImpresion: 'negro',
|
tipoImpresion: 'negro',
|
||||||
papelInteriorId: 3,
|
papelInteriorId: 3,
|
||||||
gramajeInterior: 9,
|
gramajeInterior: 80,
|
||||||
},
|
},
|
||||||
cubierta: {
|
cubierta: {
|
||||||
tipoCubierta: 'tapaBlanda',
|
tipoCubierta: 'tapaBlanda',
|
||||||
@ -86,6 +86,21 @@ class PresupuestoCliente {
|
|||||||
this.#initInterior();
|
this.#initInterior();
|
||||||
this.#initCubierta();
|
this.#initCubierta();
|
||||||
|
|
||||||
|
$(document).on('change', 'input[min][max]', function () {
|
||||||
|
const $input = $(this);
|
||||||
|
let valor = parseFloat($input.val());
|
||||||
|
const min = parseFloat($input.attr('min'));
|
||||||
|
const max = parseFloat($input.attr('max'));
|
||||||
|
|
||||||
|
if (isNaN(valor)) return;
|
||||||
|
|
||||||
|
if (valor < min) {
|
||||||
|
$input.val(min);
|
||||||
|
} else if (valor > max) {
|
||||||
|
$input.val(max);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const stored = sessionStorage.getItem("formData");
|
const stored = sessionStorage.getItem("formData");
|
||||||
if (stored) {
|
if (stored) {
|
||||||
this.formData = JSON.parse(stored);
|
this.formData = JSON.parse(stored);
|
||||||
@ -114,6 +129,7 @@ class PresupuestoCliente {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#addGramaje(contenedor, gramaje, name) {
|
#addGramaje(contenedor, gramaje, name) {
|
||||||
|
|
||||||
const id = `gramaje-${gramaje}`;
|
const id = `gramaje-${gramaje}`;
|
||||||
|
|
||||||
// Crear input
|
// Crear input
|
||||||
@ -126,7 +142,7 @@ class PresupuestoCliente {
|
|||||||
|
|
||||||
// Crear label
|
// Crear label
|
||||||
const label = document.createElement('label');
|
const label = document.createElement('label');
|
||||||
label.className = 'btn btn-outline-primary material-shadow gramaje-radio';
|
label.className = 'btn btn-outline-primary material-shadow gramaje-radio gramaje-interior';
|
||||||
label.setAttribute('for', id);
|
label.setAttribute('for', id);
|
||||||
label.textContent = gramaje;
|
label.textContent = gramaje;
|
||||||
|
|
||||||
@ -383,28 +399,109 @@ class PresupuestoCliente {
|
|||||||
this.#cacheFormData();
|
this.#cacheFormData();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.papel-interior', (e) => {
|
|
||||||
|
|
||||||
this.divGramajeInterior.removeClass('animate-fadeInUpBounce');
|
$(document).on('click', '.opcion-color', (e) => {
|
||||||
|
|
||||||
const data = this.#getPresupuestoData();
|
const data = this.#getPresupuestoData();
|
||||||
|
|
||||||
|
this.divPapelInterior.empty();
|
||||||
|
this.divGramajeInterior.empty();
|
||||||
|
|
||||||
|
this.divPapelInterior.removeClass('animate-fadeInUpBounce');
|
||||||
|
this.divGramajeInterior.removeClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/presupuesto/public/get-papel-interior',
|
||||||
|
type: 'POST',
|
||||||
|
data: data,
|
||||||
|
success: (data) => {
|
||||||
|
|
||||||
|
this.divPapelInterior.addClass('animate-fadeInUpBounce');
|
||||||
|
this.divGramajeInterior.addClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
|
const opciones_papel_interior = data.opciones_papel_interior;
|
||||||
|
for (let i = 0; i < opciones_papel_interior.length; i++) {
|
||||||
|
const opcion = opciones_papel_interior[i];
|
||||||
|
const item = new imagen_presupuesto(opcion);
|
||||||
|
item.extraClass = 'interior-data papel-interior';
|
||||||
|
if (opcion.id === this.formData.interior.papelInteriorId) {
|
||||||
|
item.setSelected(true);
|
||||||
|
}
|
||||||
|
this.divPapelInterior.append(item.render());
|
||||||
|
}
|
||||||
|
|
||||||
|
const gramajes = data.opciones_gramaje_interior;
|
||||||
|
|
||||||
|
const maxSolapas = data.solapas ?? 120;
|
||||||
|
$('.solapas-presupuesto').attr('max', maxSolapas);
|
||||||
|
$('.max-solapa-text').text(function (_, textoActual) {
|
||||||
|
return textoActual.replace(/\d+/, maxSolapas);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.#addGramajesInterior(gramajes);
|
||||||
|
},
|
||||||
|
error: (xhr, status, error) => {
|
||||||
|
|
||||||
|
console.error("Error al obtener los papeles de interior: ", xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.papel-interior', (e) => {
|
||||||
|
|
||||||
|
const data = this.#getPresupuestoData();
|
||||||
|
|
||||||
|
this.divGramajeInterior.removeClass('animate-fadeInUpBounce');
|
||||||
|
this.divGramajeInterior.empty();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/presupuesto/public/get-gramaje-interior',
|
url: '/presupuesto/public/get-gramaje-interior',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
}).done((data) => {
|
}).done((data) => {
|
||||||
|
|
||||||
this.divGramajeInterior.empty();
|
|
||||||
const gramajes = data.opciones_gramaje_interior;
|
const gramajes = data.opciones_gramaje_interior;
|
||||||
this.#addGramajesInterior(gramajes);
|
this.#addGramajesInterior(gramajes);
|
||||||
this.divGramajeInterior.addClass('animate-fadeInUpBounce');
|
this.divGramajeInterior.addClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
|
const maxSolapas = data.solapas ?? 120;
|
||||||
|
$('.solapas-presupuesto').attr('max', maxSolapas);
|
||||||
|
$('.max-solapa-text').text(function (_, textoActual) {
|
||||||
|
return textoActual.replace(/\d+/, maxSolapas);
|
||||||
|
});
|
||||||
|
|
||||||
const dataInterior = this.#getInteriorData();
|
const dataInterior = this.#getInteriorData();
|
||||||
this.#updateInteriorData(dataInterior);
|
this.#updateInteriorData(dataInterior);
|
||||||
this.#cacheFormData();
|
this.#cacheFormData();
|
||||||
|
|
||||||
}).fail((xhr, status, error) => {
|
}).fail((xhr, status, error) => {
|
||||||
|
console.error("Error al obtener los gramajes de interior: ", xhr.responseText);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.gramaje-interior', (e) => {
|
||||||
|
|
||||||
|
const inputId = $(e.currentTarget).attr('for');
|
||||||
|
const gramaje = parseInt($('#' + inputId).data('gramaje'));
|
||||||
|
this.formData.interior.gramajeInterior = gramaje;
|
||||||
|
this.#cacheFormData();
|
||||||
|
|
||||||
|
const data = this.#getPresupuestoData();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/presupuesto/public/get-max-solapas',
|
||||||
|
type: 'POST',
|
||||||
|
data: data,
|
||||||
|
}).done((data) => {
|
||||||
|
|
||||||
|
const maxSolapas = data.solapas ?? 120;
|
||||||
|
$('.solapas-presupuesto').attr('max', maxSolapas);
|
||||||
|
$('.max-solapa-text').text(function (_, textoActual) {
|
||||||
|
return textoActual.replace(/\d+/, maxSolapas);
|
||||||
|
});
|
||||||
|
|
||||||
|
}).fail((xhr, status, error) => {
|
||||||
|
console.error("Error al obtener los gramajes de interior: ", xhr.responseText);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -418,10 +515,15 @@ class PresupuestoCliente {
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: data,
|
data: data,
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
if( id === 'btn-prev-interior') {
|
if (id === 'btn-prev-interior') {
|
||||||
|
|
||||||
this.#changeTab('pills-general-data');
|
this.#changeTab('pills-general-data');
|
||||||
} else {
|
} else {
|
||||||
|
const maxSolapas = data.solapas ?? 120;
|
||||||
|
$('.solapas-presupuesto').attr('max', maxSolapas);
|
||||||
|
$('.max-solapa-text').text(function (_, textoActual) {
|
||||||
|
return textoActual.replace(/\d+/, maxSolapas);
|
||||||
|
});
|
||||||
$('.tapa-cubierta.selected').trigger('click');
|
$('.tapa-cubierta.selected').trigger('click');
|
||||||
this.#changeTab('pills-cover');
|
this.#changeTab('pills-cover');
|
||||||
}
|
}
|
||||||
@ -459,7 +561,7 @@ class PresupuestoCliente {
|
|||||||
for (let i = 0; i < opciones_color.length; i++) {
|
for (let i = 0; i < opciones_color.length; i++) {
|
||||||
const opcion = opciones_color[i];
|
const opcion = opciones_color[i];
|
||||||
const item = new imagen_presupuesto(opcion);
|
const item = new imagen_presupuesto(opcion);
|
||||||
item.extraClass = 'interior-data';
|
item.extraClass = 'interior-data opcion-color';
|
||||||
if ((this.formData.interior.color === '' && i === 0) ||
|
if ((this.formData.interior.color === '' && i === 0) ||
|
||||||
this.formData.interior.color === opcion.id) {
|
this.formData.interior.color === opcion.id) {
|
||||||
item.setSelected(true);
|
item.setSelected(true);
|
||||||
@ -491,9 +593,9 @@ class PresupuestoCliente {
|
|||||||
this.#addGramaje(this.divGramajeInterior, gramaje, 'gramaje-interior');
|
this.#addGramaje(this.divGramajeInterior, gramaje, 'gramaje-interior');
|
||||||
|
|
||||||
// Seleccionar el gramaje por defecto
|
// Seleccionar el gramaje por defecto
|
||||||
if (this.formData.interior.gramaje === '' && i === 0) {
|
if (this.formData.interior.gramajeInterior === '' && i === 0) {
|
||||||
$(`#gramaje-${gramaje}`).prop('checked', true);
|
$(`#gramaje-${gramaje}`).prop('checked', true);
|
||||||
} else if (this.formData.interior.gramaje === gramaje) {
|
} else if (this.formData.interior.gramajeInterior == gramaje) {
|
||||||
$(`#gramaje-${gramaje}`).prop('checked', true);
|
$(`#gramaje-${gramaje}`).prop('checked', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -507,11 +609,11 @@ class PresupuestoCliente {
|
|||||||
|
|
||||||
const tipoImpresion = $('#div-opciones-color .image-container.selected').attr('id') || 'negro';
|
const tipoImpresion = $('#div-opciones-color .image-container.selected').attr('id') || 'negro';
|
||||||
const papelInteriorId = $('#div-papel-interior .image-container.selected').data('sk-id') || 3;
|
const papelInteriorId = $('#div-papel-interior .image-container.selected').data('sk-id') || 3;
|
||||||
const gramejeInterior = $('input[name="gramaje-interior"]:checked').data('gramaje') || 90;
|
const gramajeInterior = $('input[name="gramaje-interior"]:checked').data('gramaje') || 90;
|
||||||
return {
|
return {
|
||||||
tipoImpresion: tipoImpresion,
|
tipoImpresion: tipoImpresion,
|
||||||
papelInteriorId: papelInteriorId,
|
papelInteriorId: papelInteriorId,
|
||||||
gramejeInterior: gramejeInterior
|
gramajeInterior: gramajeInterior
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -519,7 +621,7 @@ class PresupuestoCliente {
|
|||||||
|
|
||||||
this.formData.interior.tipoImpresion = data.tipoImpresion;
|
this.formData.interior.tipoImpresion = data.tipoImpresion;
|
||||||
this.formData.interior.papelInteriorId = data.papelInteriorId;
|
this.formData.interior.papelInteriorId = data.papelInteriorId;
|
||||||
this.formData.interior.gramejeInterior = data.gramejeInterior;
|
this.formData.interior.gramajeInterior = data.gramajeInterior;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -566,33 +668,34 @@ class PresupuestoCliente {
|
|||||||
|
|
||||||
$(document).on('click', '.tapa-cubierta', (e) => {
|
$(document).on('click', '.tapa-cubierta', (e) => {
|
||||||
|
|
||||||
|
const prevTargetisTapaDura = !$('.tapa-dura-options').hasClass('d-none');
|
||||||
|
|
||||||
$('.tapa-dura-options').eq(0).removeClass('animate-fadeInUpBounce');
|
$('.tapa-dura-options').eq(0).removeClass('animate-fadeInUpBounce');
|
||||||
$('.tapa-blanda-options').eq(0).removeClass('animate-fadeInUpBounce');
|
$('.tapa-blanda-options').eq(0).removeClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
if(e.currentTarget.id === 'tapaBlanda') {
|
if (e.currentTarget.id === 'tapaBlanda') {
|
||||||
|
$('.tapa-blanda-options').eq(0).addClass('animate-fadeInUpBounce');
|
||||||
$('.tapa-dura-options').addClass('d-none');
|
$('.tapa-dura-options').addClass('d-none');
|
||||||
$('.tapa-blanda-options').removeClass('d-none');
|
$('.tapa-blanda-options').removeClass('d-none');
|
||||||
$('.tapa-blanda-options').eq(0).addClass('animate-fadeInUpBounce');
|
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
|
$('.tapa-dura-options').eq(0).addClass('animate-fadeInUpBounce');
|
||||||
$('.tapa-blanda-options').addClass('d-none');
|
$('.tapa-blanda-options').addClass('d-none');
|
||||||
$('.tapa-dura-options').removeClass('d-none');
|
$('.tapa-dura-options').removeClass('d-none');
|
||||||
$('.tapa-dura-options').eq(0).addClass('animate-fadeInUpBounce');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#getPapelesCubierta(e.currentTarget.id);
|
if (!(e.currentTarget.id !== 'tapaBlanda' && prevTargetisTapaDura)) {
|
||||||
|
|
||||||
const dataToStore = this.#getCubiertaData();
|
this.#getPapelesCubierta(e.currentTarget.id);
|
||||||
this.#updateCubiertaData(dataToStore);
|
}
|
||||||
this.#cacheFormData();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.solapas-cubierta', (e) => {
|
$(document).on('click', '.solapas-cubierta', (e) => {
|
||||||
|
|
||||||
if(e.currentTarget.id === 'sin-solapas') {
|
if (e.currentTarget.id === 'sin-solapas') {
|
||||||
this.divSolapasCubierta.addClass('d-none');
|
this.divSolapasCubierta.addClass('d-none');
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.divSolapasCubierta.removeClass('d-none');
|
this.divSolapasCubierta.removeClass('d-none');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -600,58 +703,112 @@ class PresupuestoCliente {
|
|||||||
this.#updateCubiertaData(dataToStore);
|
this.#updateCubiertaData(dataToStore);
|
||||||
this.#cacheFormData();
|
this.#cacheFormData();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.papel-cubierta', (e) => {
|
||||||
|
|
||||||
|
const data = this.#getPresupuestoData();
|
||||||
|
|
||||||
|
this.divGramajeCubierta.removeClass('animate-fadeInUpBounce');
|
||||||
|
this.divGramajeCubierta.empty();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/presupuesto/public/get-gramaje-cubierta',
|
||||||
|
type: 'POST',
|
||||||
|
data: data,
|
||||||
|
}).done((data) => {
|
||||||
|
|
||||||
|
const gramajes = data.opciones_gramaje_cubierta;
|
||||||
|
this.#addGramajesCubierta(gramajes);
|
||||||
|
this.divGramajeCubierta.addClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
|
const dataCubierta = this.#getCubiertaData();
|
||||||
|
this.#updateCubiertaData(dataCubierta);
|
||||||
|
this.#cacheFormData();
|
||||||
|
|
||||||
|
}).fail((xhr, status, error) => {
|
||||||
|
console.error("Error al obtener los gramajes de interior: ", xhr.responseText);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#getPapelesCubierta(tapa_id) {
|
#getPapelesCubierta(tapa_id) {
|
||||||
|
|
||||||
this.divPapelCubierta.removeClass('animate-fadeInUpBounce');
|
new Promise((resolve) => {
|
||||||
|
this.divPapelCubierta.empty();
|
||||||
|
this.divGramajeCubierta.empty();
|
||||||
|
setTimeout(resolve, 250);
|
||||||
|
}).then(() => {
|
||||||
|
this.divPapelCubierta.removeClass('animate-fadeInUpBounce');
|
||||||
|
this.divGramajeCubierta.removeClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
return $.ajax({
|
$.ajax({
|
||||||
url: '/presupuesto/public/get-papel-cubierta',
|
url: '/presupuesto/public/get-papel-cubierta',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: {
|
data: {
|
||||||
tipoCubierta: tapa_id,
|
tipoCubierta: tapa_id,
|
||||||
papelCubiertaId: this.formData.cubierta.papelCubiertaId,
|
papelCubiertaId: this.formData.cubierta.papelCubiertaId,
|
||||||
gramajeCubierta: this.formData.cubierta.gramajeCubierta,
|
gramajeCubierta: this.formData.cubierta.gramajeCubierta,
|
||||||
},
|
},
|
||||||
success: (data) => {
|
success: (data) => {
|
||||||
|
this.divPapelCubierta.addClass('animate-fadeInUpBounce');
|
||||||
|
this.divGramajeCubierta.addClass('animate-fadeInUpBounce');
|
||||||
|
|
||||||
this.divPapelCubierta.empty();
|
const papelesCubierta = data.opciones_papel_cubierta;
|
||||||
this.divGramajeCubierta.empty();
|
for (let i = 0; i < papelesCubierta.length; i++) {
|
||||||
|
const papel = papelesCubierta[i];
|
||||||
const papelesCubierta = data.opciones_papel_cubierta;
|
const item = new imagen_presupuesto(papel);
|
||||||
for (let i = 0; i < papelesCubierta.length; i++) {
|
item.extraClass = 'cubierta-data papel-cubierta';
|
||||||
const papel = papelesCubierta[i];
|
if (item.extraData["sk-id"] == this.formData.cubierta.papelCubiertaId) {
|
||||||
const item = new imagen_presupuesto(papel);
|
item.setSelected(true);
|
||||||
item.extraClass = 'cubierta-data papel-cubierta';
|
}
|
||||||
if (papel.id === this.formData.cubierta.papelCubiertaId) {
|
this.divPapelCubierta.append(item.render());
|
||||||
item.setSelected(true);
|
|
||||||
}
|
}
|
||||||
this.divPapelCubierta.append(item.render());
|
|
||||||
|
if (this.divPapelCubierta.find('.image-container.selected').length === 0) {
|
||||||
|
this.divPapelCubierta.find('.image-container').first().addClass('selected');
|
||||||
|
this.formData.cubierta.papelCubiertaId =
|
||||||
|
this.divPapelCubierta.find('.image-container').first().data('sk-id') || 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
const gramajesCubierta = data.opciones_gramaje_cubierta;
|
||||||
|
for (let i = 0; i < gramajesCubierta.length; i++) {
|
||||||
|
const gramaje = gramajesCubierta[i];
|
||||||
|
this.#addGramaje(this.divGramajeCubierta, gramaje, 'gramaje-cubierta');
|
||||||
|
|
||||||
|
if (this.formData.cubierta.gramajeCubierta === '' && i === 0) {
|
||||||
|
$(`#gramaje-${gramaje}`).prop('checked', true);
|
||||||
|
} else if (this.formData.cubierta.gramajeCubierta == gramaje) {
|
||||||
|
$(`#gramaje-${gramaje}`).prop('checked', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.divGramajeCubierta.find('input[type="radio"]:checked').length === 0) {
|
||||||
|
this.divGramajeCubierta.find('input[type="radio"]').first().prop('checked', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dataToStore = this.#getCubiertaData();
|
||||||
|
this.#updateCubiertaData(dataToStore);
|
||||||
|
this.#cacheFormData();
|
||||||
|
},
|
||||||
|
error: (xhr, status, error) => {
|
||||||
|
console.error("Error al obtener los papeles de cubierta: ", xhr.responseText);
|
||||||
|
$(window).scrollTop(0);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
this.divPapelCubierta.addClass('animate-fadeInUpBounce');
|
|
||||||
},
|
|
||||||
error: (xhr, status, error) => {
|
|
||||||
|
|
||||||
console.error("Error al obtener los papeles de cubierta: ", xhr.responseText);
|
|
||||||
$(window).scrollTop(0);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#getCubiertaData() {
|
#getCubiertaData() {
|
||||||
|
|
||||||
const tipoCubierta = $('.cubierta-data.tapa.selected').attr('id') || 'tapaBlanda';
|
const tipoCubierta = $('.tapa-cubierta.selected').attr('id') || 'tapaBlanda';
|
||||||
const solapas = parseInt($('#div-solapas-cubierta input[type="radio"]:checked').val()) || 0;
|
const solapas = $('.solapas-cubierta.selected').id == 'sin-solapas' ? 0 : 1 || 0;
|
||||||
const tamanioSolapas = $('#tamanio-solapas-cubierta').val() || '80';
|
const tamanioSolapas = $('#tamanio-solapas-cubierta').val() || '80';
|
||||||
const cubiertaCaras = parseInt($('#cubierta-caras').val()) || 2;
|
const cubiertaCaras = parseInt($('#cubierta-caras').val()) || 2;
|
||||||
const guardasPapel = parseInt($('#guardas-papel').val()) || 3;
|
const guardasPapel = parseInt($('#guardas-papel').val()) || 3;
|
||||||
const guardasGramaje = parseInt($('#guardas-gramaje').val()) || 170;
|
const guardasGramaje = parseInt($('#guardas-gramaje').val()) || 170;
|
||||||
const guardasImpresas = parseInt($('#guardas-impresas').val()) || 0;
|
const guardasImpresas = parseInt($('#guardas-impresas').val()) || 0;
|
||||||
const cabezada = $('#cabezada').val() || 'WHI';
|
const cabezada = $('#cabezada').val() || 'WHI';
|
||||||
const papelCubiertaId = $('#papel-cubierta-id').val() || 3;
|
const papelCubiertaId = $('#div-papel-cubierta .image-container.selected').data('sk-id') || 3;
|
||||||
const gramajeCubierta = $('#gramaje-cubierta').val() || 170;
|
const gramajeCubierta = $('input[name="gramaje-cubierta"]:checked').data('gramaje') || 240;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tipoCubierta: tipoCubierta,
|
tipoCubierta: tipoCubierta,
|
||||||
@ -680,6 +837,25 @@ class PresupuestoCliente {
|
|||||||
this.formData.cubierta.papelCubiertaId = data.papelCubiertaId;
|
this.formData.cubierta.papelCubiertaId = data.papelCubiertaId;
|
||||||
this.formData.cubierta.gramajeCubierta = data.gramajeCubierta;
|
this.formData.cubierta.gramajeCubierta = data.gramajeCubierta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#addGramajesCubierta(gramajes) {
|
||||||
|
|
||||||
|
for (let i = 0; i < gramajes.length; i++) {
|
||||||
|
const gramaje = gramajes[i];
|
||||||
|
this.#addGramaje(this.divGramajeCubierta, gramaje, 'gramaje-cubierta');
|
||||||
|
|
||||||
|
// Seleccionar el gramaje por defecto
|
||||||
|
if (this.formData.interior.gramajeCubierta === '' && i === 0) {
|
||||||
|
$(`#gramaje-${gramaje}`).prop('checked', true);
|
||||||
|
} else if (this.formData.interior.gramajeCubierta == gramaje) {
|
||||||
|
$(`#gramaje-${gramaje}`).prop('checked', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.divGramajeCubierta.find('input[type="radio"]:checked').length === 0) {
|
||||||
|
// If not, select the first one by default
|
||||||
|
this.divGramajeCubierta.find('input[type="radio"]').first().prop('checked', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
/******************************
|
/******************************
|
||||||
* END CUBIERTA
|
* END CUBIERTA
|
||||||
******************************/
|
******************************/
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="tapaDuraLomoRecto" class="tapa-cubierta image-container imagen-selector">
|
<div id="tapaDura" class="tapa-cubierta image-container imagen-selector">
|
||||||
<img class="image-presupuesto"
|
<img class="image-presupuesto"
|
||||||
src="/assets/images/imprimelibros/presupuestador/tapa-dura-lomo-recto.png" alt="">
|
src="/assets/images/imprimelibros/presupuestador/tapa-dura-lomo-recto.png" alt="">
|
||||||
<label class="form-label" th:text="#{presupuesto.tapa-dura}">
|
<label class="form-label" th:text="#{presupuesto.tapa-dura}">
|
||||||
@ -46,60 +46,85 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row justify-content-center align-items-center mt-3 imagen-container-group tapa-blanda-options">
|
|
||||||
|
|
||||||
<div id="sin-solapas" class="image-container imagen-selector solapas-cubierta selected">
|
<div class="row justify-content-center mt-4 imagen-container-group tapa-blanda-options">
|
||||||
<img class="image-presupuesto"
|
<div class="col-auto">
|
||||||
src="/assets/images/imprimelibros/presupuestador/sinSolapasCubierta.png" alt="">
|
<div class="d-flex flex-wrap align-items-center gap-4 ">
|
||||||
<label class="form-label" th:text="#{presupuesto.sin-solapas}">
|
|
||||||
Sin solapas
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="con-solapas" class="image-container imagen-selector solapas-cubierta">
|
<!-- Bloque de solapas -->
|
||||||
<img class="image-presupuesto"
|
<div class="d-flex gap-3">
|
||||||
src="/assets/images/imprimelibros/presupuestador/conSolapasCubierta.png" alt="">
|
<div id="sin-solapas" class="image-container imagen-selector solapas-cubierta selected">
|
||||||
<label class="form-label" th:text="#{presupuesto.con-solapas}">
|
<img class="image-presupuesto"
|
||||||
Con solapas
|
src="/assets/images/imprimelibros/presupuestador/sinSolapasCubierta.png" alt="">
|
||||||
</label>
|
<label class="form-label text-center d-block" th:text="#{presupuesto.sin-solapas}">
|
||||||
</div>
|
Sin solapas
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="con-solapas" class="image-container imagen-selector solapas-cubierta">
|
||||||
|
<img class="image-presupuesto"
|
||||||
|
src="/assets/images/imprimelibros/presupuestador/conSolapasCubierta.png" alt="">
|
||||||
|
<label class="form-label text-center d-block" th:text="#{presupuesto.con-solapas}">
|
||||||
|
Con solapas
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Inputs -->
|
||||||
|
<div class="d-flex flex-column flex-md-row align-items-start gap-3">
|
||||||
|
<!-- Impresión cubierta -->
|
||||||
|
<div>
|
||||||
|
<label for="impresion-cubierta" class="form-label"
|
||||||
|
th:text="#{presupuesto.impresion-cubierta}">Impresión de cubierta</label>
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<select class="form-select select2" id="impresion-cubierta">
|
||||||
|
<option value="2" th:text="#{presupuesto.una-cara}">Una cara</option>
|
||||||
|
<option value="4" th:text="#{presupuesto.dos-caras}">Dos caras</option>
|
||||||
|
</select>
|
||||||
|
<button
|
||||||
|
class="btn btn-outline-primary btn-icon waves-effect waves-light material-shadow-none"
|
||||||
|
type="button" id="impresion-cubierta-help">
|
||||||
|
<i class="ri-questionnaire-line"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tamaño solapa -->
|
||||||
|
<div id="div-solapas-cubierta" class="d-none">
|
||||||
|
<label for="tamanio-solapas-cubierta" class="form-label"
|
||||||
|
th:text="#{presupuesto.tamanio-solapa}">Tamaño solapa</label>
|
||||||
|
<input type="number" class="form-control form-control-sm solapas-presupuesto"
|
||||||
|
id="tamanio-solapas-cubierta" min="60" max="120" value="80" step="1">
|
||||||
|
<div class="form-text">
|
||||||
|
<p class="mb-0">min: 60 mm</p>
|
||||||
|
<p class="max-solapa-text">max: 120 mm</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-auto mb-3">
|
|
||||||
<label for="impresion-cubierta" class="form-label"
|
|
||||||
th:text="#{presupuesto.impresion-cubierta}">Impresión de cubierta</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<select class="form-select select2" id="impresion-cubierta">
|
|
||||||
<option value="2" th:text="#{presupuesto.una-cara}">Una cara</option>
|
|
||||||
<option value="4" th:text="#{presupuesto.dos-caras}">Dos cara</option>
|
|
||||||
</select>
|
|
||||||
<button class="btn btn-outline-primary btn-icon waves-effect waves-light material-shadow-none"
|
|
||||||
type="button" id="impresion-cubierta-help">
|
|
||||||
<i class="ri-questionnaire-line"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="div-solapas-cubierta" class="col-auto mb-3 d-none">
|
|
||||||
<label for="tamanio-solapas-cubierta" class="form-label"
|
|
||||||
th:text="#{presupuesto.tamanio-solapa}">Tamaño solapa</label>
|
|
||||||
<input type="number" class="form-control" id="tamanio-solapas-cubierta" value="80" step="1">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row justify-content-center align-items-center mt-3 imagen-container-group tapa-dura-options d-none">
|
|
||||||
|
<div
|
||||||
|
class="row justify-content-center align-items-center mt-3 imagen-container-group tapa-dura-options d-none">
|
||||||
|
|
||||||
<div class="col-auto mb-3">
|
<div class="col-auto mb-3">
|
||||||
<label for="papel-guardas" class="form-label" th:text="#{presupuesto.papel-guardas}">Papel de
|
<label for="papel-guardas" class="form-label" th:text="#{presupuesto.papel-guardas}">Papel de
|
||||||
guardas</label>
|
guardas</label>
|
||||||
<select class="form-select select2" id="papel-guardas">
|
<select class="form-select select2" id="papel-guardas">
|
||||||
<option value="1" data-papel-id="3" data-gramaje="170"
|
<optgroup th:label="#{presupuesto.offset}">
|
||||||
th:text="#{presupuesto.offset-blanco} + ' 170 gr'" selected>Offset blanco 170 gr</option>
|
<option value="1" data-papel-id="3" data-gramaje="170"
|
||||||
<option value="2" data-papel-id="4" data-gramaje="170"
|
th:text="#{presupuesto.offset-blanco} + ' 170 gr'" selected>Offset blanco 170 gr
|
||||||
th:text="#{presupuesto.offset-ahuesado} + ' 170 gr'">Offset ahuesado 170 gr</option>
|
</option>
|
||||||
<option value="3" data-papel-id="2" data-gramaje="170"
|
<option value="2" data-papel-id="4" data-gramaje="170"
|
||||||
th:text="#{presupuesto.estucado-mate} + ' 170 gr'">Estucado mate 170 gr</option>
|
th:text="#{presupuesto.offset-ahuesado} + ' 170 gr'">Offset ahuesado 170 gr</option>
|
||||||
|
</optgroup>
|
||||||
|
<optgroup th:label="#{presupuesto.estucado}">
|
||||||
|
<option value="3" data-papel-id="2" data-gramaje="170"
|
||||||
|
th:text="#{presupuesto.estucado-mate} + ' 170 gr'">Estucado mate 170 gr</option>
|
||||||
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto mb-3">
|
<div class="col-auto mb-3">
|
||||||
@ -135,7 +160,7 @@
|
|||||||
|
|
||||||
<div class="ribbon-content mt-4">
|
<div class="ribbon-content mt-4">
|
||||||
|
|
||||||
<div id="div-papel-cubierta" class="row justify-content-center imagen-container-group">a
|
<div id="div-papel-cubierta" class="row justify-content-center imagen-container-group">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -36,37 +36,6 @@
|
|||||||
|
|
||||||
<div id="div-papel-interior" class="row justify-content-center imagen-container-group">
|
<div id="div-papel-interior" class="row justify-content-center imagen-container-group">
|
||||||
|
|
||||||
<div id="offset-blanco" data-sk-id="3" class="image-container imagen-selector selected">
|
|
||||||
<img class="image-presupuesto" src="/assets/images/imprimelibros/presupuestador/offset-blanco.png"
|
|
||||||
alt="">
|
|
||||||
<label for="titulo" class="form-label" th:text="#{presupuesto.offset-blanco}">
|
|
||||||
Offset Blanco
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="offset-ahuesado" data-sk-id="4" class="image-container imagen-selector">
|
|
||||||
<img class="image-presupuesto" src="/assets/images/imprimelibros/presupuestador/offset-ahuesado.png"
|
|
||||||
alt="">
|
|
||||||
<label class="form-label" th:text="#{presupuesto.offset-ahuesado}">
|
|
||||||
Offset Ahuesado
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="offset-ahuesado-volumen" data-sk-id="6" class="image-container imagen-selector">
|
|
||||||
<img class="image-presupuesto"
|
|
||||||
src="/assets/images/imprimelibros/presupuestador/offset-ahuesado-volumen.png" alt="">
|
|
||||||
<label class="form-label" th:text="#{presupuesto.offset-ahuesado-volumen}">
|
|
||||||
Offset Ahuesado Volumen
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="estucado-mate" data-sk-id="2" class="image-container imagen-selector">
|
|
||||||
<img class="image-presupuesto" src="/assets/images/imprimelibros/presupuestador/estucado-mate.png"
|
|
||||||
alt="">
|
|
||||||
<label class="form-label" th:text="#{presupuesto.estucado-mate}">
|
|
||||||
Estucado Mate
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -83,32 +52,7 @@
|
|||||||
|
|
||||||
<div class="ribbon-content mt-4">
|
<div class="ribbon-content mt-4">
|
||||||
<div id="div-gramaje-interior" class="hstack gap-2 justify-content-center flex-wrap">
|
<div id="div-gramaje-interior" class="hstack gap-2 justify-content-center flex-wrap">
|
||||||
<input type="radio" class="btn-check" data-gramaje="70" id="gramaje-70" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-70">70</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="80" id="gramaje-80" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-80">80</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="90" id="gramaje-90" checked name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-90">90</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="100" id="gramaje-100" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-100">100</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="115" id="gramaje-115" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-115">115</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="120" id="gramaje-120" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-120">120</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="135" id="gramaje-135" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-135">135</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="150" id="gramaje-150" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-150">150</label>
|
|
||||||
|
|
||||||
<input type="radio" class="btn-check" data-gramaje="170" id="gramaje-170" name="gramaje-interior">
|
|
||||||
<label class="btn btn-outline-primary material-shadow gramaje-radio" for="gramaje-170">170</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
package com.imprimelibros.erp;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
class ErpApplicationTests {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void contextLoads() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user