diff --git a/ci4/app/Controllers/Configuracion/Papelesgenericos.php b/ci4/app/Controllers/Configuracion/Papelesgenericos.php
index 1792dd93..7196d9ba 100755
--- a/ci4/app/Controllers/Configuracion/Papelesgenericos.php
+++ b/ci4/app/Controllers/Configuracion/Papelesgenericos.php
@@ -314,8 +314,15 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
$tapa_dura = goSanitize($this->request->getGet('tapa_dura'))[0] ?? null;
- $menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, false, $POD);
- $menu2 = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, true, $POD);
+ $ancho = floatval($this->request->getGet('ancho') ?? 0);
+ $alto = floatval($this->request->getGet('alto') ?? 0);
+ $solapas = floatval($this->request->getGet('solapas') ?? 0);
+ $lomo = floatval($this->request->getGet('lomo') ?? 0);
+
+ $anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
+
+ $menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, false, $POD, $anchoLibro, $alto, $tirada);
+ $menu2 = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, true, $POD, $anchoLibro, $alto, $tirada);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
@@ -349,8 +356,17 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
}
$tipo = goSanitize($this->request->getGet('tipo'))[0];
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
+
+ $ancho = floatval($this->request->getGet('ancho') ?? 0);
+ $alto = floatval($this->request->getGet('alto') ?? 0);
+ $solapas = floatval($this->request->getGet('solapas') ?? 0);
+ $lomo = floatval($this->request->getGet('lomo') ?? 0);
- $items = $this->model->getPapelCliente($tipo, $cubierta, null, true, $POD);
+ $tapa_dura = $this->request->getGet('tapa_dura') ?? 0;
+
+ $anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
+
+ $items = $this->model->getPapelCliente($tipo, $cubierta, null, $tapa_dura, true, $POD, $anchoLibro, $alto, $tirada);
$items = array_map(function ($item) {
return [
'id' => $item->id,
diff --git a/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php b/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php
index 0bed7c99..377e874e 100644
--- a/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php
+++ b/ci4/app/Controllers/Presupuestos/Presupuestoadmin.php
@@ -857,7 +857,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
'ancho' => intval($reqData['ancho']) ?? 100000,
'alto' => intval($reqData['alto']) ?? 100000,
'a_favor_fibra' => $reqData['a_favor_fibra'] ?? 1,
- 'isCosido' => (new TipoPresupuestoModel())->get_isCosido($tipo_impresion_id), // JJO esto es custom por cada tipo de presupuesto
+ 'isCosido' => intval((new TipoPresupuestoModel())->get_isCosido($tipo_impresion_id)), // JJO esto es custom por cada tipo de presupuesto
);
$papel_generico = [
@@ -1062,6 +1062,13 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
$tipo_impresion_id = $this->request->getGet("tipo_impresion");
$tapa_dura = model('App\Models\Configuracion\TipoPresupuestoModel')->get_isTapaDura(intval($tipo_impresion_id));
+ $ancho = $this->request->getGet('ancho') ?? 0;
+ $alto = $this->request->getGet('alto') ?? 0;
+ $solapas = $this->request->getGet('solapas') ?? 0;
+ $lomo = $this->request->getGet('lomo') ?? 0;
+
+ $anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
+
$tipo = $this->request->getGet("tipo");
$uso = $this->request->getGet("uso") ?? 'interior';
@@ -1083,7 +1090,17 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
}
$model = model('App\Models\Configuracion\PapelGenericoModel');
- $query = $model->getPapelForComparador($tipo, $cubierta, $sobrecubierta, $rotativa, $guardas, $tapa_dura, $isPOD);
+ $query = $model->getPapelForComparador(
+ $tipo,
+ $cubierta,
+ $sobrecubierta,
+ $rotativa,
+ $guardas,
+ $tapa_dura,
+ $isPOD,
+ $anchoLibro,
+ $alto,
+ $tirada);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("lg_papel_generico.nombre", $this->request->getGet("q"))
@@ -1106,6 +1123,13 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
$tirada = $this->request->getGet("tirada");
$isPOD = intval($tirada) <= intval($POD_value);
+ $ancho = $this->request->getGet('ancho') ?? 0;
+ $alto = $this->request->getGet('alto') ?? 0;
+ $solapas = $this->request->getGet('solapas') ?? 0;
+ $lomo = $this->request->getGet('lomo') ?? 0;
+
+ $anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
+
$tipo_impresion_id = $this->request->getGet("tipo_impresion");
$tapa_dura = model('App\Models\Configuracion\TipoPresupuestoModel')->get_isTapaDura(intval($tipo_impresion_id));
@@ -1130,7 +1154,17 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
}
$model = model('App\Models\Configuracion\PapelGenericoModel');
- $query = $model->getGramajeForComparador($tipo, $papel_generico_id, $cubierta, $sobrecubierta, $rotativa, $guardas, $tapa_dura, $isPOD);
+ $query = $model->getGramajeForComparador($tipo,
+ $papel_generico_id,
+ $cubierta,
+ $sobrecubierta,
+ $rotativa,
+ $guardas,
+ $tapa_dura,
+ $isPOD,
+ $anchoLibro,
+ $alto,
+ $tirada);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("lg_papel_impresion.gramaje", $this->request->getGet("q"))
diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php
index 2a55273b..1c59d509 100755
--- a/ci4/app/Language/es/Presupuestos.php
+++ b/ci4/app/Language/es/Presupuestos.php
@@ -130,6 +130,8 @@ return [
'estucadoMate170gr' => 'Estucado mate 170 gr',
'estucadoMate200gr' => 'Estucado mate 200 gr',
+ 'acabadoNinguno' => 'Ninguno',
+
'fajaColor' => 'Imprimir faja a color',
'compInteriorPlana' => 'Interior en plana',
'compInteriorRotativa' => 'Interior en rotativa',
diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php
index 739ccf6d..b97c2c8e 100755
--- a/ci4/app/Models/Configuracion/PapelGenericoModel.php
+++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php
@@ -129,16 +129,16 @@ class PapelGenericoModel extends \App\Models\BaseModel
return empty($search)
? $builder
: $builder
- ->groupStart()
- ->like("t1.id", $search)
- ->orLike("t1.nombre", $search)
- ->orLike("t1.code", $search)
- ->orLike("t1.code_ot", $search)
- ->orLike("t1.id", $search)
- ->orLike("t1.nombre", $search)
- ->orLike("t1.code", $search)
- ->orLike("t1.code_ot", $search)
- ->groupEnd();
+ ->groupStart()
+ ->like("t1.id", $search)
+ ->orLike("t1.nombre", $search)
+ ->orLike("t1.code", $search)
+ ->orLike("t1.code_ot", $search)
+ ->orLike("t1.id", $search)
+ ->orLike("t1.nombre", $search)
+ ->orLike("t1.code", $search)
+ ->orLike("t1.code_ot", $search)
+ ->groupEnd();
}
@@ -149,7 +149,10 @@ class PapelGenericoModel extends \App\Models\BaseModel
$rotativa = false,
$is_guardas = false,
$tapa_dura = false,
- $POD = false
+ $POD = false,
+ $ancho = 0,
+ $alto = 0,
+ $tirada = 0
) {
/*
1.-> Tipo impresion
@@ -183,6 +186,8 @@ class PapelGenericoModel extends \App\Models\BaseModel
->where("t3.active", 1)
->where("t4.is_deleted", 0)
->where("t4.tipo", "impresion")
+ ->where("t4.min <= ", $tirada)
+ ->where("t4.max >= ", $tirada)
->where("t5.is_deleted", 0)
->where("t5.tipo", $tipo)
->distinct('t1.id');
@@ -196,6 +201,17 @@ class PapelGenericoModel extends \App\Models\BaseModel
->where("t3_inner.active", 1);
});
+ $builder->groupStart()
+ ->groupStart()
+ ->where("t4.ancho_impresion >", $ancho)
+ ->where("t4.alto_impresion >", $alto)
+ ->groupEnd()
+ ->orGroupStart()
+ ->where("t4.ancho_impresion >", $alto)
+ ->where("t4.alto_impresion >", $ancho)
+ ->groupEnd()
+ ->groupEnd();
+
if ($is_cubierta == true) {
$builder->where("t2.cubierta", 1);
$builder->where("t5.uso", 'cubierta');
@@ -236,7 +252,10 @@ class PapelGenericoModel extends \App\Models\BaseModel
$rotativa = false,
$is_guardas = false,
$tapa_dura = false,
- $POD = false
+ $POD = false,
+ $ancho = 0,
+ $alto = 0,
+ $tirada = 0
) {
if ($POD == true && ($tipo == 'color' || $tipo == 'negro')) {
if ($tipo == 'color')
@@ -264,6 +283,8 @@ class PapelGenericoModel extends \App\Models\BaseModel
->where("t2.isActivo", 1)
->where("t3.active", 1)
->where("t4.is_deleted", 0)
+ ->where("t4.min <= ", $tirada)
+ ->where("t4.max >= ", $tirada)
->where("t4.tipo", "impresion")
->where("t5.is_deleted", 0)
->where("t5.tipo", $tipo)
@@ -278,6 +299,17 @@ class PapelGenericoModel extends \App\Models\BaseModel
->where("t3_inner.active", 1);
});
+ $builder->groupStart()
+ ->groupStart()
+ ->where("t4.ancho_impresion >", $ancho)
+ ->where("t4.alto_impresion >", $alto)
+ ->groupEnd()
+ ->orGroupStart()
+ ->where("t4.ancho_impresion >", $alto)
+ ->where("t4.alto_impresion >", $ancho)
+ ->groupEnd()
+ ->groupEnd();
+
if ($is_cubierta == true) {
$builder->where("t2.cubierta", 1);
$builder->where("t5.uso", 'cubierta');
@@ -370,8 +402,17 @@ class PapelGenericoModel extends \App\Models\BaseModel
}
- public function getPapelCliente($tipo, $is_cubierta = false, $selected_papel_id = null, $tapa_dura = null, $papel_especial = false, $POD = null)
- {
+ public function getPapelCliente(
+ $tipo,
+ $is_cubierta = false,
+ $selected_papel_id = null,
+ $tapa_dura = null,
+ $papel_especial = false,
+ $POD = null,
+ $ancho = 0,
+ $alto = 0,
+ $tirada = 0
+ ) {
/*
1.-> Tipo impresion
2.-> Maquina
@@ -406,6 +447,8 @@ class PapelGenericoModel extends \App\Models\BaseModel
->where("t2.use_in_client", 1)
->where("t3.active", 1)
->where("t4.is_deleted", 0)
+ ->where("t4.min <= ", $tirada)
+ ->where("t4.max >= ", $tirada)
->where("t4.tipo", "impresion")
->where("t5.is_deleted", 0)
->where("t5.tipo", $tipo)
@@ -429,6 +472,8 @@ class PapelGenericoModel extends \App\Models\BaseModel
->where("t2.use_in_client", 1)
->where("t3.active", 1)
->where("t4.is_deleted", 0)
+ ->where("t4.min <= ", $tirada)
+ ->where("t4.max >= ", $tirada)
->where("t4.tipo", "impresion")
->where("t5.is_deleted", 0)
->where("t5.tipo", $tipo)
@@ -443,6 +488,17 @@ class PapelGenericoModel extends \App\Models\BaseModel
->where("t3_inner.active", 1);
});
+ $builder->groupStart()
+ ->groupStart()
+ ->where("t4.ancho_impresion >", $ancho)
+ ->where("t4.alto_impresion >", $alto)
+ ->groupEnd()
+ ->orGroupStart()
+ ->where("t4.ancho_impresion >", $alto)
+ ->where("t4.alto_impresion >", $ancho)
+ ->groupEnd()
+ ->groupEnd();
+
if ($is_cubierta == true) {
$builder->where("t2.cubierta", 1);
$builder->where("t5.uso", 'cubierta');
diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php
index 5517a099..255b2cad 100755
--- a/ci4/app/Services/PresupuestoService.php
+++ b/ci4/app/Services/PresupuestoService.php
@@ -474,13 +474,13 @@ class PresupuestoService extends BaseService
return [];
}
- //$multiplicador_pliego = $datosPedido->isCosido ? 4 : 2;
- $paginas_por_pliego = round($factor_anchura * $factor_altura * 2 /** $multiplicador_pliego*/, 2);
+ $multiplicador_pliego = $datosPedido->isCosido ? 4 : 2;
+ $paginas_por_pliego = round($factor_anchura * $factor_altura * $multiplicador_pliego, 2);
$pliegos_libro = round($paginas_por_pliego ? $datosPedido->paginas / $paginas_por_pliego : 0, 2);
$metros_papel_libro = round($pliegos_libro * ($maquina->alto_impresion / 1000.0), 2);
$metros_papel_total = round($metros_papel_libro * ($datosPedido->tirada + $datosPedido->merma), 2);
- $paginas_por_pliego_click = round($factor_anchura * $factor_altura_click * 2/** $multiplicador_pliego*/, 2);
+ $paginas_por_pliego_click = round($factor_anchura * $factor_altura_click * $multiplicador_pliego, 2);
$pliegos_libro_click = round($paginas_por_pliego_click ? $datosPedido->paginas / $paginas_por_pliego_click : 0, 2);
$clicks_libro = round(ceil($pliegos_libro_click) * 2, 2);
$clicks_pedido = round($clicks_libro * ($datosPedido->tirada + $datosPedido->merma), 2);
@@ -522,12 +522,15 @@ class PresupuestoService extends BaseService
$data['alto_click'] = $maquina->alto_click;
+ $direccion_fibra = ($parametrosRotativa->a_favor_fibra === "false" || $parametrosRotativa->a_favor_fibra === 0 ||
+ $parametrosRotativa->a_favor_fibra === "0" || $parametrosRotativa->a_favor_fibra === false)? 0 : 1;
+
$formas = PresupuestoService::getNumFormasRot(
$maquina,
$datosPedido->ancho,
$datosPedido->alto,
$datosPedido->isCosido,
- $parametrosRotativa->a_favor_fibra
+ $direccion_fibra
);
$data['num_formas'] = $formas;
@@ -541,7 +544,7 @@ class PresupuestoService extends BaseService
public static function calculoDimForma($datosPedido, $parametros)
{
// posicionamos paginas en función de a favor de fibra o no
- if (!$parametros->a_favor_fibra) {
+ if ($parametros->a_favor_fibra === "false" || $parametros->a_favor_fibra === 0 || $parametros->a_favor_fibra === "0" || $parametros->a_favor_fibra === false) {
$anchoLibro = $datosPedido->alto;
$altoLibro = $datosPedido->ancho;
} else {
@@ -551,7 +554,7 @@ class PresupuestoService extends BaseService
// si es cosido ancho x 2
if ($datosPedido->isCosido) {
- if (!$parametros->a_favor_fibra) {
+ if ($parametros->a_favor_fibra === "false" || $parametros->a_favor_fibra === 0 || $parametros->a_favor_fibra === "0" || $parametros->a_favor_fibra === false) {
$altoLibro = $altoLibro * 2;
} else {
$anchoLibro = $anchoLibro * 2;
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php
index 705495f1..34e3a455 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/items/_disenioCubierta.php
@@ -173,19 +173,10 @@
-
-
-

"
- alt="Retractilado">
-
-
-
@@ -238,6 +229,7 @@
diff --git a/httpdocs/assets/js/safekat/components/preview.js b/httpdocs/assets/js/safekat/components/preview.js
index 8f3744dc..543f68ef 100644
--- a/httpdocs/assets/js/safekat/components/preview.js
+++ b/httpdocs/assets/js/safekat/components/preview.js
@@ -207,7 +207,7 @@ class previewFormas {
case 'rot_bn':
case 'rot_color':
// Conditional assignements depending on rotation of the printing shape
- if (this.pvObj.orientacionFormas == 'v') {
+ if (this.pvObj.orientacionFormas != 'h') {
let auxReg = this.pvObj.altoForma;
this.pvObj.altoForma = this.pvObj.anchoForma;
this.pvObj.anchoForma = auxReg;
@@ -223,7 +223,7 @@ class previewFormas {
case 'color':
case 'colorhq':
// Conditional assignements depending on rotation of the printing shape
- if (this.pvObj.orientacionFormas == 'v') {
+ if (this.pvObj.orientacionFormas != 'h') {
let auxReg = this.pvObj.altoForma;
this.pvObj.altoForma = this.pvObj.anchoForma;
this.pvObj.anchoForma = auxReg;
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js
index c2414539..16d75732 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js
@@ -32,8 +32,12 @@ class PresupuestoAdminEdit {
this.datosLibro = new DatosLibro(this.domItem.find('#accordionDatosLibroTip'),
{
checkPaginasPresupuesto: this.checkPaginasPresupuesto,
+ getDimensionLibro: this.getDimensionLibro,
+ });
+ this.comparador = new Comparador(this.domItem.find('#accordionDatosPresupuestoClienteTip'),
+ {
+ getDimensionLibro: this.getDimensionLibro,
});
- this.comparador = new Comparador(this.domItem.find('#accordionDatosPresupuestoClienteTip'));
this.lineasPresupuesto = new LineasPresupuesto(this.domItem.find('#accordionLineasPresupuestoTip'),
{
getDimensionLibro: this.getDimensionLibro,
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js
index 57db6fdc..4e39be5a 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/comparador.js
@@ -4,10 +4,12 @@ import Ajax from '../../../components/ajax.js';
class Comparador {
- constructor(domItem) {
+ constructor(domItem, functions = {}) {
this.domItem = domItem;
+ this.getDimensionLibro = functions.getDimensionLibro;
+
this.tipo_impresion_id = parseInt($('#tipo_impresion_id').val());
this.csrf_token = getToken();
@@ -23,6 +25,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'negro',
});
@@ -33,6 +39,10 @@ class Comparador {
papel_generico: () => this.papelNegro.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'negro',
});
this.paginasColor = $('#compPaginasColor');
@@ -42,6 +52,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'color',
});
@@ -52,6 +66,10 @@ class Comparador {
papel_generico: () => this.papelColor.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'color',
});
@@ -62,6 +80,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'negrohq',
});
@@ -72,6 +94,10 @@ class Comparador {
papel_generico: () => this.papelNegrohq.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'negrohq',
});
@@ -82,6 +108,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'colorhq',
});
@@ -92,6 +122,10 @@ class Comparador {
papel_generico: () => this.papelColorhq.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'colorhq',
});
@@ -102,6 +136,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
+ lomo: () => $('#lomo_cubierta').val(),
tipo: 'colorhq',
uso: 'cubierta',
});
@@ -112,6 +150,10 @@ class Comparador {
papel_generico: () => this.papelCubierta.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
+ lomo: () => $('#lomo_cubierta').val(),
tipo: 'colorhq',
uso: 'cubierta',
});
@@ -123,6 +165,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
+ lomo: () => $('#lomo_sobrecubierta').val(),
tipo: 'colorhq',
uso: 'sobrecubierta',
});
@@ -133,6 +179,10 @@ class Comparador {
papel_generico: () => this.papelSobrecubierta.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
+ lomo: () => $('#lomo_sobrecubierta').val(),
tipo: 'colorhq',
uso: 'sobrecubierta',
});
@@ -145,6 +195,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'colorhq',
uso: 'guardas',
});
@@ -155,6 +209,10 @@ class Comparador {
papel_generico: () => this.papelCubierta.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
+ ancho: () => this.getDimensionLibro().ancho,
+ alto: () => this.getDimensionLibro().alto,
+ sopalas: 0,
+ lomo: 0,
tipo: 'colorhq',
uso: 'guardas',
});
@@ -245,7 +303,7 @@ class Comparador {
this.papelSobrecubierta.onChange(() => self.gramajeSobrecubierta.empty());
this.sobrecubierta.on('change', () => {
if (this.sobrecubierta.select2('data')[0].id == 1) {
- if($('#solapas_sobrecubierta').prop('checked') == false){
+ if ($('#solapas_sobrecubierta').prop('checked') == false) {
this.sobrecubierta.val(0);
popErrorAlert(window.language.Presupuestos.errores.error_sobrecubierta_sin_solapas, 'divAlarmasComparador')
}
@@ -1492,7 +1550,7 @@ class Comparador {
}
}
catch (e) {
-
+
}
$.extend(data, bn_obj);
}
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js
index a9f56ea5..8bd7c1bc 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/datosLibro.js
@@ -8,6 +8,7 @@ class DatosLibro {
this.domItem = domItem;
this.checkPaginasPresupuesto = functions.checkPaginasPresupuesto;
+ this.getDimensionLibro = functions.getDimensionLibro;
this.csrf_token = getToken();
this.csrf_hash = $('#mainContainer').find('input[name="' + this.csrf_token + '"]').val();
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js
index 3418bfea..3888600a 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/lineasPresupuesto.js
@@ -1503,7 +1503,7 @@ class LineasPresupuesto {
// Si es inkjet, existe este check
if ($('#' + linea + '_aFavorFibra').length) {
- datos.a_favor_fibra = $('#' + linea + '_aFavorFibra').prop('checked')
+ datos.a_favor_fibra = $('#' + linea + '_aFavorFibra').prop('checked') ? 1: 0;
}
if (updatedTipologias && $('#' + linea + '_gotaNegro').length) {
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js
index f5b735af..ff202546 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js
@@ -49,7 +49,7 @@ class PreviewFormasAdmin{
$('#tab-pv-rot-color').on( "click", function() {
self.preview.setData(self.data);
- self.preview.previewRotativa('rot_color', self.isCosido, self.tipoTapa.constains("dura")?1:0);
+ self.preview.previewRotativa('rot_color', self.isCosido, self.tipoTapa.includes("dura")?1:0);
} );
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js
index f06dee7a..8361a299 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioCubierta.js
@@ -33,6 +33,12 @@ class DisenioCubierta {
[this.csrf_token]: this.csrf_hash,
tipo: 'colorhq',
cubierta: 1,
+ ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
+ alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
+ solapas: () => {return $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val()},
+ lomo: () => {return $('#lc').val()},
+ tapa_dura: () => {return this.tapaBlanda.hasClass("selected") ? 0 : 1},
+ tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
}
);
@@ -63,7 +69,6 @@ class DisenioCubierta {
this.divGramajeCubierta = this.domItem.find("#divGramajeCubierta");
this.acabadoCubierta = this.domItem.find("#acabadoCubierta");
- this.cubiertaRetractilado = this.domItem.find("#retractilado");
this.configuracionSobrecubierta = this.domItem.find(".config-sobrecubierta");
this.sobrecubierta = this.domItem.find("#addSobrecubierta");
@@ -222,12 +227,6 @@ class DisenioCubierta {
this.acabadoCubierta.setOption(datosCubierta.acabado.id, datosCubierta.acabado.text);
- if (datosCubierta.retractilado) {
- setTimeout(() => {
- this.cubiertaRetractilado.trigger('click');
- }, 0);
- }
-
if (datosSobrecubierta && datosSobrecubierta.papel) {
this.sobrecubierta.trigger('click');
this.papelSobrecubierta.val(datosSobrecubierta.papel.code + "_" + datosSobrecubierta.gramaje).trigger('change');
@@ -765,7 +764,12 @@ class DisenioCubierta {
[this.csrf_token]: this.csrf_hash,
tipo: 'colorhq',
cubierta: 1,
- tapa_dura: tapa_dura
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
+ lomo: $('#lc').val(),
+ tapa_dura: tapa_dura,
+ tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
},
{},
(response) => { this.fillPapeles(response); },
@@ -787,7 +791,12 @@ class DisenioCubierta {
papel: this.papelCubierta,
tipo: 'colorhq',
cubierta: 1,
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
+ lomo: $('#lc').val(),
tapa_dura: tapa_dura,
+ tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
},
{},
this.fillGramajes.bind(context),
@@ -914,7 +923,12 @@ class DisenioCubierta {
papel: papel,
tipo: 'colorhq',
cubierta: 1,
- tapa_dura: tapa_dura
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
+ lomo: $('#lc').val(),
+ tapa_dura: tapa_dura,
+ tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
},
{},
this.fillGramajes.bind(context),
diff --git a/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioInterior.js b/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioInterior.js
index c7af7bcf..d378c229 100644
--- a/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioInterior.js
+++ b/httpdocs/assets/js/safekat/pages/presupuestoCliente/disenioInterior.js
@@ -57,6 +57,11 @@ class DisenioInterior {
{
[this.csrf_token]: this.csrf_hash,
tipo: this.getTipoImpresion(),
+ tirada: () => {return $('#tirada').val()},
+ ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
+ alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
}
);
@@ -67,6 +72,11 @@ class DisenioInterior {
{
[this.csrf_token]: this.csrf_hash,
tipo: this.getTipoImpresionColor(),
+ tirada: () => {return $('#tirada').val()},
+ ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
+ alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
}
);
@@ -116,6 +126,10 @@ class DisenioInterior {
[this.csrf_token]: this.csrf_hash,
tirada: $('#tirada').val(),
tipo: this.getTipoImpresion(),
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
},
{},
@@ -131,6 +145,10 @@ class DisenioInterior {
[this.csrf_token]: this.csrf_hash,
tirada: $('#tirada').val(),
tipo: this.getTipoImpresion(),
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
},
{},
@@ -888,6 +906,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: papel,
tipo: tipo,
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
},
{},
@@ -916,6 +938,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: this.papelInterior,
tipo: tipo,
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
},
{},
@@ -962,6 +988,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: papel,
tipo: tipo,
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
},
{},
@@ -986,6 +1016,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: this.papelInterior,
tipo: tipo,
+ ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
+ alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
+ solapas: 0,
+ lomo: 0,
cubierta: 0,
},
{},