arreglado grapado

This commit is contained in:
2024-10-25 13:42:09 +02:00
parent eb806621c6
commit adcf2fbec3
4 changed files with 85 additions and 74 deletions

View File

@ -728,6 +728,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
'servicios' => $reqData['servicios'] ?? [],
);
$datos_presupuesto['id'] = $id;
$resultado_presupuesto = $this->calcular_presupuesto($datos_presupuesto, $selected_tirada, true);
if (isset($resultado_presupuesto['errors'])) {
@ -1402,7 +1404,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
if ($interior == -1) {
$errorModel = new ErrorPresupuesto();
$errorModel->insertError(
$datos_entrada['id'],
$datos_entrada['id']==0?null:$datos_entrada['id'],
auth()->user()->id,
'
No se puede obtener el interior',

View File

@ -125,7 +125,7 @@ class Direcciones {
validators: {
callback: {
callback: () => {
const div = $('#divErrorEnvios'); // Selecciona el div
/* const div = $('#divErrorEnvios'); // Selecciona el div
div.find('.fv-plugins-message-container').remove();
@ -149,6 +149,8 @@ class Direcciones {
</div>
`);
return false;
*/
return true;
},
}

View File

@ -439,7 +439,11 @@ class PresupuestoCliente {
}
}
else {
popSuccessAlert(response.message);
if(response.error){
popErrorAlert("No se ha podido guardar el presupuesto. Por favor, póngase en contacto con el departamento comercial.");
}
else
popSuccessAlert(response.message);
}
},
() => { $('#loader').modal('hide'); }

View File

@ -11,10 +11,14 @@ class previewFormas {
this.alto = datos.alto;
this.lomo = datos.lomo;
if(datos.solapas == undefined || datos.solapas == null || datos.solapas == false)
if (datos.solapas == undefined || datos.solapas == null || datos.solapas == false) {
this.solapa = 0;
else
this.offsetSolapa = 0.0;
}
else {
this.solapa = datos.solapas;
this.offsetSolapa = 3.0;
}
this.lomoRedondo = datos.lomoRedondo;
}
@ -237,14 +241,14 @@ class previewFormas {
let styleCotas = { size: 12, family: 'Public Sans' };
let sangradoTexto = "Sangrado 20 mm";
let sangradoValor = parseFloat(20); // mm
if(this.ancho >= 210 || this.alto >= 297){
if (this.ancho >= 210 || this.alto >= 297) {
sangradoValor = parseFloat(15); // mm
sangradoTexto = "Sangrado 15 mm";
}
let anchoPliegue = parseFloat(7); // mm cajo
let altoPliegue = parseFloat(7); // mm
let anchoCarton = parseFloat(6); // mm
if(this.lomoRedondo)
if (this.lomoRedondo)
anchoCarton += parseFloat(6); // mm
// Definicion de los parametros del Esquema de Cubierta (EC)
if (this.size == "thumbnail") {
@ -358,7 +362,7 @@ class previewFormas {
previewEC.makeText((this.lomo + anchoCarton).toFixed(1) + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas);
previewEC.makeText((this.ancho + anchoPliegue).toFixed(1) + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText((this.ancho + anchoPliegue).toFixed(1) + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText((this.alto + altoPliegue).toFixed(1)+ " mm", origenEC.x + (lomoLibro / 2) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText((this.alto + altoPliegue).toFixed(1) + " mm", origenEC.x + (lomoLibro / 2) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText((this.alto + (2 * sangradoValor) + altoPliegue).toFixed(1) + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro) + 55, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText((2 * this.ancho) + this.lomo + (2 * sangradoValor) + +(2 * anchoPliegue) + anchoCarton + " mm",
origenEC.x,
@ -586,7 +590,6 @@ class previewFormas {
let styleCotas = { size: 12, family: 'Public Sans' };
let sangradoTexto = "Sangrado 5 mm";
let sangradoValor = parseFloat(5); // mm
let offsetSolapaValor = parseFloat(0); // mm
// Definicion de los parametros del Esquema de Cubierta (EC)
if (this.solapa == 0) {
@ -739,11 +742,11 @@ class previewFormas {
previewEC.makeText(sangradoTexto, origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
previewEC.makeText(sangradoTexto, origenEC.x - (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
// Cotas
previewEC.makeText((anchoLibro + offsetSolapaValor).toFixed(1) + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText((anchoLibro + offsetSolapaValor).toFixed(1) + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(altoLibro.toFixed(1) + " mm", origenEC.x + (lomoLibro / 2) + 25, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText(altoLibro.toFixed(1) + (2 * sangradoValor) + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText(((2 * anchoLibro) + (2 * (anchoSolapa + offsetSolapaValor)) + lomoLibro + (2 * sangradoValor)).toFixed(1) + " mm",
previewEC.makeText((this.ancho + this.offsetSolapa).toFixed(1) + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText((this.ancho + this.offsetSolapa).toFixed(1) + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(this.alto.toFixed(1) + " mm", origenEC.x + (lomoLibro / 2) + 25, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText(this.alto.toFixed(1) + (2 * sangradoValor) + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText(((2 * anchoLibro) + (2 * (this.solapa + this.offsetSolapa)) + this.lomo + (2 * sangradoValor)).toFixed(1) + " mm",
origenEC.x,
origenEC.y + (altoLibro / 2) + 50,
styleCotas);