mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en cubierta
This commit is contained in:
@ -580,7 +580,8 @@ $routes->group('presupuestoadmin', ['namespace' => 'App\Controllers\Presupuestos
|
||||
$routes->post('menuitems', 'Presupuestoadmin::menuItems', ['as' => 'menuItemsOfPresupuestoAdmin']);
|
||||
|
||||
$routes->get('cargar/(:any)', 'Presupuestoadmin::cargar/$1');
|
||||
$routes->post('comparadorplana', 'Presupuestoadmin::obtenerComparadorPlana');
|
||||
$routes->post('comparadorinterior', 'Presupuestoadmin::obtenerComparadorInterior');
|
||||
$routes->post('comparadorexteriores', 'Presupuestoadmin::obtenerComparadorExteriores');
|
||||
$routes->get('papelgenerico', 'Presupuestoadmin::getPapelGenerico');
|
||||
$routes->get('papelgramaje', 'Presupuestoadmin::getGramaje');
|
||||
});
|
||||
|
||||
@ -416,12 +416,13 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
if (!$this->model->delete($id)) {
|
||||
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||
$rawResult = $this->model->where('id', $id)
|
||||
->set(['deleted_at' => $datetime->format('Y-m-d H:i:s'),
|
||||
'is_deleted' => $this->delete_flag])
|
||||
->set([
|
||||
'deleted_at' => $datetime->format('Y-m-d H:i:s'),
|
||||
'is_deleted' => $this->delete_flag
|
||||
])
|
||||
->update();
|
||||
if (!$rawResult) {
|
||||
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
|
||||
@ -463,7 +464,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function cargar($id){
|
||||
public function cargar($id)
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$modelPapelFormato = new PapelFormatoModel();
|
||||
@ -609,7 +611,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
|
||||
public function obtenerComparadorPlana(){
|
||||
public function obtenerComparadorInterior()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
@ -623,6 +626,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
$tipo_impresion_id = $this->request->getPost('tipo_impresion_id');
|
||||
$uso = $this->request->getPost('uso');
|
||||
|
||||
$tipo_maquina = $this->request->getPost('tipo_maquina');
|
||||
|
||||
$data = array(
|
||||
'cliente_id' => $cliente_id,
|
||||
'datosPedido' => (object) $datosPedido,
|
||||
@ -636,15 +641,94 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
'uso' => $uso
|
||||
);
|
||||
|
||||
$data = PresupuestoClienteService::obtenerPresupuestoClienteInterior($data, true);
|
||||
if ($tipo_maquina == 'rotativa') {
|
||||
$data['papelInteriorDiferente'] = false;
|
||||
$lineas = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data, true);
|
||||
} else
|
||||
$lineas = PresupuestoClienteService::obtenerPresupuestoClienteInterior($data, true);
|
||||
return $this->respond(
|
||||
[
|
||||
'status' => 1,
|
||||
'data' => $data
|
||||
'data' => $lineas
|
||||
]
|
||||
);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
else{
|
||||
}
|
||||
|
||||
public function obtenerComparadorExteriores()
|
||||
{
|
||||
|
||||
$resultado = [];
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$cubierta = $this->request->getPost('cubierta') ?? false;
|
||||
$sobrecubierta = $this->request->getPost('sobrecubierta') ?? false;
|
||||
|
||||
// cubierta y sobrecubierta siempre colorhq
|
||||
$isColor = true;
|
||||
$isHq = true;
|
||||
|
||||
if ($cubierta) {
|
||||
|
||||
$cliente_id = $cubierta['cliente_id'];
|
||||
$datosPedido = $cubierta['datosPedido'];
|
||||
$papel_generico = $cubierta['papel_generico'];
|
||||
$gramaje = $cubierta['gramaje'];
|
||||
$paginas_color = $this->request->getPost('paginas_color') ?? 0;
|
||||
$tipo_impresion_id = $this->request->getPost('tipo_impresion_id');
|
||||
$uso = $this->request->getPost('uso');
|
||||
$lomoRedondo = $cubierta['lomoRedondo'] ?? false;
|
||||
|
||||
$data = array(
|
||||
'cliente_id' => $cliente_id,
|
||||
'datosPedido' => (object) $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'paginas_color' => $paginas_color,
|
||||
'isColor' => $isColor,
|
||||
'isHq' => $isHq,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'uso' => $uso,
|
||||
'lomoRedondo' => $lomoRedondo
|
||||
);
|
||||
$lineas = PresupuestoClienteService::obtenerCubierta($data, true);
|
||||
$resultado['cubierta'] = $lineas;
|
||||
}
|
||||
|
||||
if ($sobrecubierta) {
|
||||
|
||||
$cliente_id = $sobrecubierta['cliente_id'];
|
||||
$datosPedido = $sobrecubierta['datosPedido'];
|
||||
$papel_generico = $sobrecubierta['papel_generico'];
|
||||
$gramaje = $sobrecubierta['gramaje'];
|
||||
$paginas_color = $this->request->getPost('paginas_color') ?? 0;
|
||||
$tipo_impresion_id = $this->request->getPost('tipo_impresion_id');
|
||||
$uso = $this->request->getPost('uso');
|
||||
|
||||
$data = array(
|
||||
'cliente_id' => $cliente_id,
|
||||
'datosPedido' => (object) $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'paginas_color' => $paginas_color,
|
||||
'isColor' => $isColor,
|
||||
'isHq' => $isHq,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'uso' => $uso
|
||||
);
|
||||
$lineas = PresupuestoClienteService::obtenerSobrecubierta($data, true);
|
||||
$resultado['sobrecubierta'] = $lineas;
|
||||
}
|
||||
|
||||
return $this->respond(
|
||||
[
|
||||
'status' => 1,
|
||||
'data' => $resultado
|
||||
]
|
||||
);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
@ -900,9 +984,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
];
|
||||
|
||||
return $this->respond($data);
|
||||
}
|
||||
|
||||
else if ($tipo == 'duplicar'){
|
||||
} else if ($tipo == 'duplicar') {
|
||||
$presupuesto_id = $reqData['presupuesto_id'] ?? -1;
|
||||
$result = $this->duplicarPresupuesto($presupuesto_id);
|
||||
$newTokenHash = csrf_hash();
|
||||
@ -913,8 +995,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$data = [
|
||||
'error' => $result['message'],
|
||||
$csrfTokenName => $newTokenHash
|
||||
@ -1041,7 +1122,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
* Si ocurre una excepción, la clave 'success' será false y una clave 'message' contendrá el mensaje de la excepción.
|
||||
* @throws \Exception Si ocurre un error durante la operación.
|
||||
*/
|
||||
private function duplicarPresupuesto($id){
|
||||
private function duplicarPresupuesto($id)
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
@ -1269,7 +1351,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getPapelGenerico(){
|
||||
public function getPapelGenerico()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
@ -1314,7 +1397,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function getGramaje(){
|
||||
public function getGramaje()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$papel_generico_id = $this->request->getGet("papel_generico");
|
||||
@ -1425,7 +1509,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
return $model->getPOD();
|
||||
}
|
||||
|
||||
protected function getLineasPresupuesto($presupuestoEntity){
|
||||
protected function getLineasPresupuesto($presupuestoEntity)
|
||||
{
|
||||
$lineas = (new PresupuestoLineaModel())->getLineasPresupuesto($presupuestoEntity->id);
|
||||
|
||||
$input_data = [];
|
||||
@ -1434,7 +1519,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
return PresupuestoService::checkLineasPresupuesto($input_data, $lineas);
|
||||
}
|
||||
|
||||
protected function getLineasServicios($presupuestoEntity){
|
||||
protected function getLineasServicios($presupuestoEntity)
|
||||
{
|
||||
|
||||
$serviciosPresupuesto = (object) array();
|
||||
|
||||
@ -1455,15 +1541,13 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
if ($presupuestoEntity->papel_formato_personalizado) {
|
||||
$input_data['ancho'] = $presupuestoEntity->papel_formato_ancho;
|
||||
$input_data['alto'] = $presupuestoEntity->papel_formato_alto;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$model = model("App\Models\Configuracion\PapelFormatoModel");
|
||||
$papel = $model->find($presupuestoEntity->papel_formato_id);
|
||||
if ($papel) {
|
||||
$input_data['ancho'] = $papel->ancho;
|
||||
$input_data['alto'] = $papel->alto;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$input_data['ancho'] = 0;
|
||||
$input_data['alto'] = 0;
|
||||
}
|
||||
@ -1472,7 +1556,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
return PresupuestoService::checkLineasServicios($input_data, $serviciosPresupuesto);
|
||||
}
|
||||
|
||||
protected function getLineasDirecciones($presupuestoEntity){
|
||||
protected function getLineasDirecciones($presupuestoEntity)
|
||||
{
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||
$direccionesEnvio = $model->where('presupuesto_id', $presupuestoEntity->id)->findAll();
|
||||
|
||||
@ -65,7 +65,7 @@ class PresupuestoClienteService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
public static function obtenerCubierta($data)
|
||||
public static function obtenerCubierta($data, $return_raw=false)
|
||||
{
|
||||
|
||||
$uso = $data['uso'];
|
||||
@ -76,7 +76,6 @@ class PresupuestoClienteService extends BaseService
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
$lomoRedondo = $data['lomoRedondo'];
|
||||
|
||||
$lineas_cubierta = [];
|
||||
@ -102,6 +101,14 @@ class PresupuestoClienteService extends BaseService
|
||||
}
|
||||
if (count($lineas_cubierta) > 0) {
|
||||
|
||||
if($return_raw){
|
||||
$lineas_cubierta = array_values(array_unique($lineas_cubierta, SORT_REGULAR));
|
||||
|
||||
return[
|
||||
'cubierta' => $lineas_cubierta
|
||||
];
|
||||
}
|
||||
|
||||
usort(
|
||||
$lineas_cubierta,
|
||||
function ($a, $b) {
|
||||
@ -119,7 +126,7 @@ class PresupuestoClienteService extends BaseService
|
||||
return $lineas_cubierta;
|
||||
}
|
||||
|
||||
public static function obtenerSobrecubierta($data)
|
||||
public static function obtenerSobrecubierta($data, $return_raw=false)
|
||||
{
|
||||
|
||||
$uso = $data['uso'];
|
||||
@ -154,6 +161,14 @@ class PresupuestoClienteService extends BaseService
|
||||
}
|
||||
if (count($lineas_sobrecubierta) > 0) {
|
||||
|
||||
if($return_raw){
|
||||
$lineas_sobrecubierta = array_values(array_unique($lineas_sobrecubierta, SORT_REGULAR));
|
||||
|
||||
return[
|
||||
'cubierta' => $lineas_sobrecubierta
|
||||
];
|
||||
}
|
||||
|
||||
usort(
|
||||
$lineas_sobrecubierta,
|
||||
function ($a, $b) {
|
||||
@ -247,22 +262,25 @@ class PresupuestoClienteService extends BaseService
|
||||
$uso = $data['uso'];
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'];
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
if ($data['papelInteriorDiferente'] == false)
|
||||
$papel_generico = $data['papel_generico'];
|
||||
else {
|
||||
$papel_generico = $data['papel_generico']['negro'];
|
||||
if($paginas_color>0)
|
||||
$papel_generico_color = $data['papel_generico']['color'];
|
||||
}
|
||||
if ($data['papelInteriorDiferente'] == false)
|
||||
$gramaje = $data['gramaje'];
|
||||
else {
|
||||
$gramaje = $data['gramaje']['negro'];
|
||||
if($paginas_color>0)
|
||||
$gramaje_color = $data['gramaje']['color'];
|
||||
}
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
|
||||
$paginas_negro = $datosPedido->paginas - $paginas_color;
|
||||
|
||||
@ -293,6 +311,14 @@ class PresupuestoClienteService extends BaseService
|
||||
}
|
||||
if (count($linea_negro_plana) > 0) {
|
||||
|
||||
/*if($return_raw){
|
||||
$linea_negro_plana = array_values(array_unique($linea_color_plana, SORT_REGULAR));
|
||||
|
||||
return[
|
||||
'negro' => $linea_negro_plana
|
||||
];
|
||||
}*/
|
||||
|
||||
usort(
|
||||
$linea_negro_plana,
|
||||
function ($a, $b) {
|
||||
@ -335,6 +361,14 @@ class PresupuestoClienteService extends BaseService
|
||||
}
|
||||
if (count($linea_color_plana) > 0) {
|
||||
|
||||
/*if($return_raw){
|
||||
$linea_color_plana = array_values(array_unique($linea_color_plana, SORT_REGULAR));
|
||||
|
||||
return[
|
||||
'color' => $linea_color_plana
|
||||
];
|
||||
}*/
|
||||
|
||||
usort(
|
||||
$linea_color_plana,
|
||||
function ($a, $b) {
|
||||
@ -349,8 +383,7 @@ class PresupuestoClienteService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
// Si hay negro y color, y se hace con el mismo papel, hay que buscar la combinación
|
||||
// más económica con la misma máquna
|
||||
|
||||
if($return_raw){
|
||||
$linea_negro_plana = array_values(array_unique($linea_negro_plana, SORT_REGULAR));
|
||||
$linea_color_plana = array_values(array_unique($linea_color_plana, SORT_REGULAR));
|
||||
@ -360,6 +393,8 @@ class PresupuestoClienteService extends BaseService
|
||||
'color' => $linea_color_plana
|
||||
];
|
||||
}
|
||||
// Si hay negro y color, y se hace con el mismo papel, hay que buscar la combinación
|
||||
// más económica con la misma máquna
|
||||
if (
|
||||
$paginas_negro > 0 && $paginas_color > 0 && $data['papelInteriorDiferente'] == 0 &&
|
||||
count($linea_negro_plana) > 0 && count($linea_color_plana) > 0
|
||||
@ -500,7 +535,7 @@ class PresupuestoClienteService extends BaseService
|
||||
* - isHq: si es alta calidad
|
||||
* - paginas_color: número de páginas a color
|
||||
*/
|
||||
private static function obtenerPresupuestoClienteInteriorRotativa($data)
|
||||
public static function obtenerPresupuestoClienteInteriorRotativa($data, $return_raw = false)
|
||||
{
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
@ -539,6 +574,14 @@ class PresupuestoClienteService extends BaseService
|
||||
|
||||
if (count($linea_rotativa) > 0) {
|
||||
|
||||
if($return_raw){
|
||||
$linea_rotativa = array_values(array_unique($linea_rotativa, SORT_REGULAR));
|
||||
|
||||
return[
|
||||
'rotativa' => $linea_rotativa,
|
||||
];
|
||||
}
|
||||
|
||||
usort(
|
||||
$linea_rotativa,
|
||||
function ($a, $b) {
|
||||
|
||||
@ -1,18 +1,3 @@
|
||||
/*******************************
|
||||
* Eventos asociados a elementos HTML
|
||||
*******************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$('#compPosPaginasColor').on("keyup", function () {
|
||||
computarPaginasColor(this.value);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@ -23,163 +8,6 @@ $('#compPosPaginasColor').on("keyup", function () {
|
||||
*******************************/
|
||||
|
||||
|
||||
function getRowFromLineaRot(linea) {
|
||||
|
||||
$precio_impresion = isNaN(parseFloat(linea.fields.precio_impresion_horas + linea.fields.precio_click_pedido)) ? "" :
|
||||
parseFloat(linea.fields.precio_impresion_horas + linea.fields.precio_click_pedido).toFixed(2);
|
||||
|
||||
return {
|
||||
'tipo': 'rotativa',
|
||||
'paginas': linea.fields.paginas,
|
||||
'papel': linea.fields.papel_generico,
|
||||
'gramaje': linea.fields.gramaje,
|
||||
'marca': linea.fields.papel_impresion,
|
||||
'aFavorFibra': linea.fields.a_favor_fibra == 1 ? 'si' : 'no',
|
||||
'maquina': linea.fields.maquina,
|
||||
'numeroPliegos': isNaN(parseFloat(linea.fields.pliegos_libro)) ? "" : parseFloat(linea.fields.pliegos_libro).toFixed(2),
|
||||
'pliegosPedido': isNaN(parseFloat(linea.fields.pliegos_pedido)) ? "" : parseFloat(linea.fields.pliegos_pedido).toFixed(2),
|
||||
'precioPliego': isNaN(parseFloat(linea.fields.precios_pliegos)) ? "" : parseFloat(linea.fields.precios_pliegos).toFixed(6),
|
||||
'libro': isNaN(parseFloat(linea.fields.precio_libro)) ? "" : parseFloat(linea.fields.precio_libro).toFixed(2),
|
||||
'totalPapelPedido': isNaN(parseFloat(linea.fields.precio_pedido)) ? "" : parseFloat(linea.fields.precio_pedido).toFixed(2),
|
||||
'lomo': isNaN(parseFloat(linea.fields.mano)) ? "" : parseFloat(linea.fields.mano).toFixed(2),
|
||||
'peso': isNaN(parseFloat(linea.fields.peso)) ? "" : parseFloat(linea.fields.peso).toFixed(2),
|
||||
'horasMaquina': isNaN(parseFloat(linea.fields.horas_maquina)) ? "" : parseFloat(linea.fields.horas_maquina).toFixed(2),
|
||||
'precioImpresion': $precio_impresion,
|
||||
'precioPagNegro': isNaN(parseFloat(linea.fields.precio_pagina_negro)) ? "" : parseFloat(linea.fields.precio_pagina_negro).toFixed(6),
|
||||
'precioPagColor': isNaN(parseFloat(linea.fields.precio_pagina_color)) ? "" : parseFloat(linea.fields.precio_pagina_color).toFixed(6),
|
||||
'totalTinta': isNaN(parseFloat(linea.fields.precio_tinta)) ? "" : parseFloat(linea.fields.precio_tinta).toFixed(2),
|
||||
'totalCorte': isNaN(parseFloat(linea.fields.total_corte)) ? "" : parseFloat(linea.fields.total_corte).toFixed(2),
|
||||
'total': isNaN(parseFloat(linea.fields.total_impresion)) ? "" : (parseFloat(linea.fields.total_impresion)).toFixed(2),
|
||||
'maquinaId': linea.fields.maquina_id,
|
||||
'maquinaVelocidad': linea.fields.maquina_velocidad,
|
||||
'tiempoMaquina': linea.fields.tiempo_maquina,
|
||||
'papelGenericoId': linea.fields.papel_generico_id,
|
||||
'papelImpresionId': linea.fields.papel_impresion_id,
|
||||
'paginasColor': linea.fields.paginas_color,
|
||||
'tarifa_impresion_id': linea.fields.tarifa_impresion_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function clearIntLineas(is_color) {
|
||||
//$("#tableCompIntPlana").DataTable().rows( '.selected' ).deselect();
|
||||
var tabla = $('#tableCompIntPlana').DataTable();
|
||||
tabla
|
||||
.rows(function (idx, data, node) {
|
||||
return data['tipo'].includes(is_color ? 'color' : 'bn');
|
||||
})
|
||||
.remove()
|
||||
.draw();
|
||||
//$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#insertarPlanaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
|
||||
function clearCubierta() {
|
||||
|
||||
var tabla = $('#tableCompCubierta').DataTable();
|
||||
tabla
|
||||
.rows(function (idx, data, node) {
|
||||
return data['tipo'] === 'cubierta';
|
||||
})
|
||||
.remove()
|
||||
.draw();
|
||||
if(tabla.rows().count()==0)
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearSobrecubierta() {
|
||||
|
||||
|
||||
var tabla = $('#tableCompCubierta').DataTable();
|
||||
tabla
|
||||
.rows(function (idx, data, node) {
|
||||
return data['tipo'] === 'sobrecubierta';
|
||||
})
|
||||
.remove()
|
||||
.draw();
|
||||
if(tabla.rows().count()==0)
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearGuardas() {
|
||||
|
||||
$('#tableCompGuardas').DataTable().clear().draw();
|
||||
$('#insertarGuardasBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearIntRot() {
|
||||
|
||||
$('#errorComRot').html('');
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#insertarRotativaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function selectIntRotLineas() {
|
||||
|
||||
$("#tableCompIntRotativa").DataTable().rows('.selected').deselect();
|
||||
|
||||
let value_total = 0.00;
|
||||
|
||||
if ($("#tableCompIntRotativa").DataTable().rows().count() > 0) {
|
||||
|
||||
$("#tableCompIntRotativa").DataTable().row(0).nodes().to$().toggleClass('selected');
|
||||
value_total = parseFloat($("#tableCompIntRotativa").DataTable().rows(0).data()[0]['total'])
|
||||
};
|
||||
|
||||
|
||||
$('#total_comp_rot').html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
function selectCubiertaLineas() {
|
||||
|
||||
$("#tableCompCubierta").DataTable().rows('.selected').deselect();
|
||||
|
||||
cubierta_selected = false;
|
||||
sobrecubierta_selected = false;
|
||||
|
||||
if ($("#tableCompCubierta").DataTable().rows().count() > 0) {
|
||||
|
||||
$("#tableCompCubierta").DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
if (!cubierta_selected && $('#tableCompCubierta').DataTable().cell(rowIdx, 0).data() === 'cubierta') {
|
||||
$("#tableCompCubierta").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
cubierta_selected = true;
|
||||
}
|
||||
if (!sobrecubierta_selected && $('#tableCompCubierta').DataTable().cell(rowIdx, 0).data() === 'sobrecubierta') {
|
||||
$("#tableCompCubierta").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
sobrecubierta_selected = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var table = $("#tableCompCubierta").DataTable();
|
||||
var rows = table.rows('.selected').indexes();
|
||||
var data = table.rows(rows).data();
|
||||
|
||||
var value_total = 0.00;
|
||||
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
|
||||
value_total += parseFloat(data[i]['total'])
|
||||
}
|
||||
|
||||
|
||||
$('#total_comp_cubierta').html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
function selectGuardasLineas() {
|
||||
|
||||
@ -197,140 +25,12 @@ function selectGuardasLineas() {
|
||||
$('#total_comp_guardas').html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
function getIDsComparador(is_color, is_hq) {
|
||||
|
||||
if (!is_color) {
|
||||
if (is_hq) {
|
||||
var papel = '#compPapelNegrohq';
|
||||
var gramaje = '#compGramajeNegrohq';
|
||||
var paginas = '#compPaginasNegrohq';
|
||||
}
|
||||
else {
|
||||
var papel = '#compPapelNegro';
|
||||
var gramaje = '#compGramajeNegro';
|
||||
var paginas = '#compPaginasNegro';
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (is_hq) {
|
||||
var papel = '#compPapelColorhq';
|
||||
var gramaje = '#compGramajeColorhq';
|
||||
var paginas = '#compPaginasColorhq';
|
||||
}
|
||||
else {
|
||||
var papel = '#compPapelColor';
|
||||
var gramaje = '#compGramajeColor';
|
||||
var paginas = '#compPaginasColor';
|
||||
}
|
||||
}
|
||||
return {
|
||||
papel: papel,
|
||||
gramaje: gramaje,
|
||||
paginas: paginas,
|
||||
}
|
||||
}
|
||||
|
||||
function getDimensionLibro() {
|
||||
var ancho = 0;
|
||||
var alto = 0;
|
||||
|
||||
// TO-DO
|
||||
if (!document.getElementById('papelFormatoPersonalizado').checked) {
|
||||
ancho = 170//parseFloat($('#papelFormatoId').getText().trim().split(" x ")[0]);
|
||||
alto = 240//parseFloat($('#papelFormatoId').getText().trim().split(" x ")[1]);
|
||||
|
||||
}
|
||||
|
||||
else if (document.getElementById('papelFormatoPersonalizado').checked) {
|
||||
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
|
||||
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
|
||||
}
|
||||
return {
|
||||
ancho: ancho,
|
||||
alto: alto
|
||||
}
|
||||
}
|
||||
|
||||
function checkInputsForRotativa() {
|
||||
|
||||
// Si es color, el gramaje y el papel tiene que ser el mismo
|
||||
try {
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
if ($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim()) {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ($('#tipoImpresion').select2('data')[0].id == 'negro') {
|
||||
if ($('#compPapelNegro').select2('data')[0].id.length > 0 &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.length > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function fillIntPlana(data, is_color, is_hq) {
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
$('#tableCompIntPlana').DataTable().row
|
||||
.add(getRowFromLineaInt(is_color ? (is_hq ? 'colorhq' : 'color') : (is_hq ? 'bnhq' : 'bn'), linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function fillIntRot(data) {
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined") {
|
||||
$('#tableCompIntRotativa').DataTable().row
|
||||
.add(getRowFromLineaRot(linea))
|
||||
.draw()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function fillCubierta(data) {
|
||||
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
$('#tableCompCubierta').DataTable().row
|
||||
.add(getRowFromLineaInt('cubierta', linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function fillSobrecubierta(data) {
|
||||
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
$('#tableCompCubierta').DataTable().row
|
||||
.add(getRowFromLineaInt('sobrecubierta', linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function fillGuardas(data) {
|
||||
|
||||
@ -345,130 +45,5 @@ function fillGuardas(data) {
|
||||
})
|
||||
}
|
||||
|
||||
function clearCompTable() {
|
||||
|
||||
$('#insertarPlanaBtn').addClass('d-none')
|
||||
$('#insertarRotativaBtn').addClass('d-none')
|
||||
$('#total_comp_plana').html('0.00')
|
||||
$('#total_comp_rot').html('0.00')
|
||||
}
|
||||
|
||||
function generateCompJSON() {
|
||||
|
||||
data = {}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
try {
|
||||
bn_obj = {
|
||||
"bn": {
|
||||
'paginas': $('#compPaginasNegro').val(),
|
||||
'papel_id': $('#compPapelNegro').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegro').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
bn_obj = {}
|
||||
}
|
||||
$.extend(data, bn_obj);
|
||||
}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
try {
|
||||
bnhq_obj = {
|
||||
"bnhq": {
|
||||
'paginas': $('#compPaginasNegrohq').val(),
|
||||
'papel_id': $('#compPapelNegrohq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegrohq').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
bnhq_obj = {}
|
||||
}
|
||||
$.extend(data, bnhq_obj);
|
||||
}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
try {
|
||||
color_obj = {
|
||||
"color": {
|
||||
'paginas': $('#compPaginasColor').val(),
|
||||
'papel_id': $('#compPapelColor').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColor').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
color_obj = {}
|
||||
}
|
||||
$.extend(data, color_obj);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
try {
|
||||
colorhq_obj = {
|
||||
"colorhq": {
|
||||
'paginas': $('#compPaginasColorhq').val(),
|
||||
'papel_id': $('#compPapelColorhq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColorhq').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
colorhq_obj = {}
|
||||
}
|
||||
$.extend(data, colorhq_obj);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
cubierta_obj = {
|
||||
"cubierta": {
|
||||
'paginas': $('#compCarasCubierta option:selected').val(),
|
||||
'papel_id': $('#compPapelCubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeCubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
cubierta_obj = {}
|
||||
}
|
||||
$.extend(data, cubierta_obj);
|
||||
|
||||
try {
|
||||
sobrecubierta_obj = {
|
||||
"sobrecubierta": {
|
||||
'imprimir': $('#compSobrecubierta option:selected').val(),
|
||||
'papel_id': $('#compPapelSobrecubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeSobrecubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
sobrecubierta_obj = {}
|
||||
}
|
||||
$.extend(data, sobrecubierta_obj);
|
||||
|
||||
if($('#compCarasGuardas').length>0){
|
||||
try {
|
||||
guardas_obj = {
|
||||
"guardas": {
|
||||
'paginas_impresion': $('#compCarasGuardas option:selected').val(),
|
||||
'papel_id': $('#compPapelGuardas').select2('data')[0].id,
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
guardas_obj = {}
|
||||
}
|
||||
$.extend(data, guardas_obj);
|
||||
|
||||
}
|
||||
|
||||
data_str = JSON.stringify(data)
|
||||
$('#comparador_json_data').val(data_str)
|
||||
}
|
||||
|
||||
|
||||
@ -164,6 +164,7 @@ class Comparador {
|
||||
this.btnInsertarCubierta = $('#insertarCubiertaBtn');
|
||||
|
||||
this.cargando = false;
|
||||
this.comparadorPlanaRunning = false;
|
||||
}
|
||||
|
||||
init() {
|
||||
@ -179,18 +180,19 @@ class Comparador {
|
||||
|
||||
initSelect2() {
|
||||
|
||||
if ($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3 ||
|
||||
$('#tipo_impresion_id').val() == 5 || $('#tipo_impresion_id').val() == 7) {
|
||||
$('#compCarasCubierta').select2({
|
||||
this.paginasCubierta.select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
});
|
||||
|
||||
$('#compPapelGuardas').select2({
|
||||
if ($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3 ||
|
||||
$('#tipo_impresion_id').val() == 5 || $('#tipo_impresion_id').val() == 7) {
|
||||
|
||||
this.papelGuardas.select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compCarasGuardas').select2({
|
||||
this.carasGuardas.select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
});
|
||||
@ -206,6 +208,11 @@ class Comparador {
|
||||
this.papelCubierta.init();
|
||||
this.gramajeCubierta.init();
|
||||
if (this.tipo_impresion_id != 5 && this.tipo_impresion_id != 6 && this.tipo_impresion_id != 7 && this.tipo_impresion_id != 8 && this.tipo_impresion_id != 21) {
|
||||
|
||||
this.sobrecubierta.select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
});
|
||||
this.papelSobrecubierta.init();
|
||||
this.gramajeSobrecubierta.init();
|
||||
this.papelSobrecubierta.onChange(() => this.gramajeSobrecubierta.setVal(0))
|
||||
@ -268,6 +275,12 @@ class Comparador {
|
||||
$('.comp_negrohq_items').on('change', this.obtenerComparadorInterior.bind(this));
|
||||
$('.comp_color_items').on('change', this.obtenerComparadorInterior.bind(this));
|
||||
$('.comp_colorhq_items').on('change', this.obtenerComparadorInterior.bind(this));
|
||||
|
||||
$('.comp_cubierta_items').on('change', this.obtenerComparadorExteriores.bind(this));
|
||||
if (this.tipo_impresion_id != 5 && this.tipo_impresion_id != 6 && this.tipo_impresion_id != 7 && this.tipo_impresion_id != 8 && this.tipo_impresion_id != 21) {
|
||||
$('.comp_sobrecubierta_items').on('change', this.obtenerComparadorExteriores.bind(this));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#changePaginasComparador(element) {
|
||||
@ -343,6 +356,7 @@ class Comparador {
|
||||
|
||||
this.cargando = false;
|
||||
this.paginasNegro.trigger('change');
|
||||
this.paginasCubierta.trigger('change');
|
||||
}
|
||||
|
||||
|
||||
@ -580,6 +594,14 @@ class Comparador {
|
||||
|
||||
updateOpcionesComparador() {
|
||||
|
||||
$('.comp_negro_items').off('change');
|
||||
$('.comp_negrohq_items').off('change');
|
||||
$('.comp_color_items').off('change');
|
||||
$('.comp_colorhq_items').off('change');
|
||||
|
||||
this.tableCompIntPlana.clear().draw();
|
||||
this.tableCompIntRotativa.clear().draw();
|
||||
|
||||
const selValue = this.tipo_impresion.val();
|
||||
const elements_negro = $('.comp-negro-selected');
|
||||
const elements_negrohq = $('.comp-negrohq-selected');
|
||||
@ -597,6 +619,11 @@ class Comparador {
|
||||
$(element).removeClass('d-none');
|
||||
});
|
||||
}
|
||||
else {
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
$(element).addClass('d-none');
|
||||
});
|
||||
}
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
$(element).removeClass('d-none');
|
||||
});
|
||||
@ -613,11 +640,21 @@ class Comparador {
|
||||
$(element).removeClass('d-none');
|
||||
});
|
||||
}
|
||||
else {
|
||||
Array.from(elements_color).forEach(element => {
|
||||
$(element).addClass('d-none');
|
||||
});
|
||||
}
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
$(element).removeClass('d-none');
|
||||
});
|
||||
}
|
||||
|
||||
$('.comp_negro_items').on('change', this.obtenerComparadorInterior.bind(this));
|
||||
$('.comp_negrohq_items').on('change', this.obtenerComparadorInterior.bind(this));
|
||||
$('.comp_color_items').on('change', this.obtenerComparadorInterior.bind(this));
|
||||
$('.comp_colorhq_items').on('change', this.obtenerComparadorInterior.bind(this));
|
||||
|
||||
if (selValue.includes('color')) {
|
||||
$('.pos-paginas-color').removeClass('d-none');
|
||||
}
|
||||
@ -714,6 +751,7 @@ class Comparador {
|
||||
let papel_generico = {};
|
||||
let gramaje = {};
|
||||
let paginasColor = 0;
|
||||
let paginas = parseInt($('#paginas').val());
|
||||
|
||||
if (!$('#papelFormatoPersonalizado').prop('checked')) {
|
||||
const selectedFormat = $('#papelFormatoId').select2('data')[0].text;
|
||||
@ -780,27 +818,63 @@ class Comparador {
|
||||
};
|
||||
|
||||
if (this.tipo_impresion.val().includes('color')) {
|
||||
|
||||
if (this.tipo_impresion.val().includes('hq')) {
|
||||
papel_generico.color = { id: this.papelColorhq.getVal(), nombre: this.papelColorhq.getText() };
|
||||
gramaje.color = this.gramajeColorhq.getVal();
|
||||
paginasColor = this.paginasColorhq.val();
|
||||
}
|
||||
papel_generico.negro = { id: this.papelNegrohq.getVal(), nombre: this.papelNegrohq.getText() };
|
||||
gramaje.negro = this.gramajeNegrohq.getVal();
|
||||
}
|
||||
else {
|
||||
if (this.tipo_impresion.val().includes('hq')) {
|
||||
papel_generico.color = { id: this.papelColor.getVal(), nombre: this.papelColor.getText() };
|
||||
gramaje.color = this.gramajeColor.getVal();
|
||||
paginasColor = this.paginasColor.val();
|
||||
}
|
||||
|
||||
}
|
||||
if (this.tipo_impresion.val().includes('hq')) {
|
||||
papel_generico.negro = { id: this.papelNegrohq.getVal(), nombre: this.papelNegrohq.getText() };
|
||||
gramaje.negro = this.gramajeNegrohq.getVal();
|
||||
}
|
||||
else {
|
||||
papel_generico.negro = { id: this.papelNegro.getVal(), nombre: this.papelNegro.getText() };
|
||||
gramaje.negro = this.gramajeNegro.getVal();
|
||||
}
|
||||
|
||||
}
|
||||
else if (uso = 'cubierta') {
|
||||
if (this.papelCubierta.getVal() == 0 || this.papelCubierta.getVal() == null) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
if (this.gramajeCubierta.getVal() == 0 || this.gramajeCubierta.getVal() == null) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccioneGramaje, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
|
||||
|
||||
papel_generico = { id: this.papelCubierta.getVal(), nombre: this.papelCubierta.getText() };
|
||||
gramaje = this.gramajeCubierta.getVal();
|
||||
paginas = this.paginasCubierta.select2('data')[0].id
|
||||
}
|
||||
|
||||
else if (uso = 'sobrecubierta') {
|
||||
if (this.papelSobrecubierta.getVal() == 0 || this.papelSobrecubierta.getVal() == null) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
if (this.gramajeSobrecubierta.getVal() == 0 || this.gramajeSobrecubierta.getVal() == null) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccioneGramaje, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
|
||||
papel_generico = { id: this.papelSobrecubierta.getVal(), nombre: this.papelSobrecubierta.getText() };
|
||||
gramaje = this.gramajeSobrecubierta.getVal();
|
||||
paginas = 4;
|
||||
|
||||
}
|
||||
|
||||
const datosPedido = {
|
||||
paginas: $('#paginas').val(),
|
||||
paginas: paginas,
|
||||
tirada: $('#tirada').val(),
|
||||
merma: $('#merma').val(),
|
||||
ancho: ancho,
|
||||
@ -826,6 +900,10 @@ class Comparador {
|
||||
isHq: this.tipo_impresion.val().includes('hq'),
|
||||
paginas_color: paginasColor
|
||||
}
|
||||
// TO-DO
|
||||
if(uso == 'cubierta'){
|
||||
datos.lomoRedondo = false;
|
||||
}
|
||||
|
||||
|
||||
return { error: false, data: datos };
|
||||
@ -837,9 +915,10 @@ class Comparador {
|
||||
|
||||
const self = this;
|
||||
|
||||
if (this.cargando) {
|
||||
if (this.cargando || this.comparadorPlanaRunning) {
|
||||
return
|
||||
}
|
||||
this.comparadorPlanaRunning = true;
|
||||
|
||||
if (event.currentTarget.id.includes('Paginas')) {
|
||||
this.#changePaginasComparador(event.currentTarget.id);
|
||||
@ -848,45 +927,50 @@ class Comparador {
|
||||
this.tableCompIntPlana.clear().draw();
|
||||
this.tableCompIntRotativa.clear().draw();
|
||||
this.btnInsertarPlana.addClass('d-none');
|
||||
this.btnInsertarRotativa.addClass('d-none');
|
||||
$('#title_int_rot').html(window.language.Presupuestos.compInteriorRotativa);
|
||||
$('#title_int_plana').html(window.language.Presupuestos.compInteriorPlana);
|
||||
|
||||
const datosComp = this.getDataForComp('interior');
|
||||
if (datosComp.error) {
|
||||
this.comparadorPlanaRunning = false;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
|
||||
const isHq = this.tipo_impresion.val().includes('hq');
|
||||
const isColor = this.tipo_impresion.val().includes('color');
|
||||
|
||||
datosComp.data['tipo_maquina'] = 'plana';
|
||||
datosComp.data[this.csrf_token] = this.csrf_hash;
|
||||
new Ajax('/presupuestoadmin/comparadorplana',
|
||||
new Ajax('/presupuestoadmin/comparadorinterior',
|
||||
datosComp.data,
|
||||
{},
|
||||
(response) => {
|
||||
if (response.data.negro.length > 0) {
|
||||
const isHq = response.data.negro[0].fields.tipo_linea.includes('hq');
|
||||
let sorted = response.data.negro.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
$('#tableCompIntPlana').DataTable().row
|
||||
.add(self.getRowFromLineaInt(isHq ? 'bnhq' : 'bn', linea))
|
||||
self.tableCompIntPlana.row
|
||||
.add(self.getRowFromLinea(isHq ? 'bnhq' : 'bn', linea))
|
||||
.draw()
|
||||
});
|
||||
}
|
||||
if (response.data.color.length > 0) {
|
||||
const isHq = response.data.color[0].fields.tipo_linea.includes('hq');
|
||||
let sorted = response.data.color.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
$('#tableCompIntPlana').DataTable().row
|
||||
.add(self.getRowFromLineaInt(isHq ? 'colorhq' : 'color', linea))
|
||||
self.tableCompIntPlana.row
|
||||
.add(self.getRowFromLinea(isHq ? 'colorhq' : 'color', linea))
|
||||
.draw()
|
||||
});
|
||||
}
|
||||
this.selectIntLineas();
|
||||
|
||||
self.selectLineas('plana');
|
||||
if ($('#tableCompIntPlana').DataTable().rows().count() > 0) {
|
||||
$('#title_int_plana').html(window.language.Presupuestos.compInteriorPlana + ' (' + self.tableCompIntPlana.rows().count() + ')');
|
||||
$('#insertarPlanaBtn').removeClass('d-none');
|
||||
@ -895,66 +979,197 @@ class Comparador {
|
||||
$('#title_int_plana').html(window.language.Presupuestos.compInteriorPlana);
|
||||
$('#insertarPlanaBtn').addClass('d-none');
|
||||
}
|
||||
|
||||
// Rotativa
|
||||
if (!isHq) {
|
||||
if (!isColor || (isColor && datosComp.data.papel_generico.negro.id == datosComp.data.papel_generico.color.id &&
|
||||
datosComp.data.gramaje.negro == datosComp.data.gramaje.color)) {
|
||||
|
||||
datosComp.data['tipo_maquina'] = 'rotativa';
|
||||
datosComp.data.papel_generico.id = datosComp.data.papel_generico.negro.id;
|
||||
datosComp.data.papel_generico.nombre = datosComp.data.papel_generico.negro.nombre;
|
||||
datosComp.data.gramaje = datosComp.data.gramaje.negro;
|
||||
new Ajax('/presupuestoadmin/comparadorinterior',
|
||||
datosComp.data,
|
||||
{},
|
||||
(response) => {
|
||||
if (response.data.rotativa.length > 0) {
|
||||
let sorted = response.data.rotativa.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
self.tableCompIntRotativa.row
|
||||
.add(self.getRowFromLineaRot(linea))
|
||||
.draw()
|
||||
});
|
||||
}
|
||||
self.selectLineas('rotativa');
|
||||
if (self.tableCompIntRotativa.rows().count() > 0) {
|
||||
self.btnInsertarRotativa.removeClass('d-none');
|
||||
$('#title_int_rot').html(window.language.Presupuestos.compInteriorRotativa + ' (' + self.tableCompIntRotativa.rows().count() + ')');
|
||||
}
|
||||
else {
|
||||
$('#title_int_rot').html(window.language.Presupuestos.compInteriorRotativa);
|
||||
}
|
||||
|
||||
self.comparadorPlanaRunning = false;
|
||||
},
|
||||
(error) => {
|
||||
console.log(error);
|
||||
self.comparadorPlanaRunning = false;
|
||||
}
|
||||
).post();
|
||||
}
|
||||
else {
|
||||
self.comparadorPlanaRunning = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
self.comparadorPlanaRunning = false;
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.log(error);
|
||||
self.comparadorPlanaRunning = false;
|
||||
}
|
||||
).post();
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
this.comparadorPlanaRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
obtenerComparadorExteriores(event, actualizarLineaPlana = false, actualizarLineaRot = false) {
|
||||
|
||||
try {
|
||||
|
||||
const self = this;
|
||||
|
||||
if (this.cargando) {
|
||||
return
|
||||
}
|
||||
|
||||
this.tableCompCubierta.clear().draw();
|
||||
this.btnInsertarCubierta.addClass('d-none');
|
||||
$('#title_cubierta').html(window.language.Presupuestos.compCubiertaSobrecubierta);
|
||||
|
||||
let datosComp = {};
|
||||
datosComp.cubierta = this.getDataForComp('cubierta');
|
||||
if (datosComp.cubierta.error) {
|
||||
return;
|
||||
}
|
||||
if (this.tipo_impresion_id != 5 && this.tipo_impresion_id != 6 && this.tipo_impresion_id != 7 && this.tipo_impresion_id != 8 && this.tipo_impresion_id != 21) {
|
||||
if (this.sobrecubierta.select2('data')[0].id == 1) {
|
||||
datosComp.sobrecubierta = this.getDataForComp('sobrecubierta');
|
||||
if (datosComp.sobrecubierta.error) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else{
|
||||
datosComp.sobrecubierta = {};
|
||||
}
|
||||
}
|
||||
else{
|
||||
datosComp.sobrecubierta = {};
|
||||
}
|
||||
datosComp.cubierta.data[this.csrf_token] = this.csrf_hash;
|
||||
if(Object.keys(datosComp.sobrecubierta).length > 0){
|
||||
datosComp.sobrecubierta.data[this.csrf_token] = this.csrf_hash;
|
||||
}
|
||||
new Ajax('/presupuestoadmin/comparadorexteriores',
|
||||
{
|
||||
cubierta: datosComp.cubierta.data,
|
||||
sobrecubierta: datosComp.sobrecubierta.data
|
||||
},
|
||||
{},
|
||||
(response) => {
|
||||
if (response.data.cubierta.length > 0) {
|
||||
let sorted = response.data.cubierta.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
self.tableCompCubierta.row
|
||||
add(self.getRowFromLinea('cubierta', linea))
|
||||
.draw()
|
||||
});
|
||||
}
|
||||
if (response.data.sobrecubierta) {
|
||||
let sorted = response.data.sobrecubierta.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
self.tableCompCubierta.row
|
||||
.add(self.getRowFromLinea('sobrecubierta', linea))
|
||||
.draw()
|
||||
});
|
||||
}
|
||||
|
||||
self.selectLineas('cubierta');
|
||||
if (self.tableCompCubierta.rows().count() > 0) {
|
||||
$('#title_cubierta').html(window.language.Presupuestos.compCubiertaSobrecubierta +
|
||||
(' (' + self.tableCompCubierta.rows().count() + ')'));
|
||||
self.btnInsertarCubierta.removeClass('d-none');
|
||||
}
|
||||
else {
|
||||
$('#title_cubierta').html(window.language.Presupuestos.compCubiertaSobrecubierta);
|
||||
self.btnInsertarCubierta.addClass('d-none');
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.log(error);
|
||||
}
|
||||
).post();
|
||||
}
|
||||
/*
|
||||
elementos = getIDsComparador(is_color, is_hq)
|
||||
|
||||
|
||||
if ($('' + elementos.papel).select2('data').length > 0 &&
|
||||
$('' + elementos.gramaje).select2('data').length > 0 &&
|
||||
parseInt($('' + elementos.paginas).val()) >= 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
|
||||
|
||||
getLineasIntPlana(is_color, is_hq, actualizarLineaPlana).then((result) => {
|
||||
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||
if (!is_color) {
|
||||
getLineasIntRot(is_hq, actualizarLineaRot);
|
||||
}
|
||||
else {
|
||||
if (!is_hq) {
|
||||
if ($('#compPapelNegro').select2('data').length > 0 && $('#compPapelColor').select2('data').length > 0 &&
|
||||
$('#compGramajeNegro').select2('data').length > 0 && $('#compGramajeColor').select2('data').length > 0) {
|
||||
if (($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim())) {
|
||||
getLineasIntRot(is_hq, actualizarLineaRot);
|
||||
}
|
||||
else {
|
||||
$('#errorComRot').html('<?= lang("Presupuestos.errores.errorRotColor") ?>');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}*/
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
selectLineas(tabla) {
|
||||
|
||||
let table = this.tableCompIntPlana;
|
||||
let select1 = false;
|
||||
let select2 = false;
|
||||
let tipo1 = 'bn';
|
||||
let tipo2 = 'color';
|
||||
let total_label = '#total_comp_plana'
|
||||
switch (tabla) {
|
||||
case 'cubierta':
|
||||
table = this.tableCompCubierta;
|
||||
tipo1 = 'lp_cubierta';
|
||||
tipo2 = 'lp_sobrecubierta';
|
||||
total_label = '#total_comp_cubierta';
|
||||
break;
|
||||
|
||||
case 'rotativa':
|
||||
table = this.tableCompIntRotativa;
|
||||
tipo1 = 'rotativa';
|
||||
total_label = '#total_comp_rot';
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
selectIntLineas() {
|
||||
var negro_selected = false;
|
||||
var color_selected = false;
|
||||
$("#tableCompIntPlana").DataTable().rows('.selected').deselect();
|
||||
$("#tableCompIntPlana").DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
if (!negro_selected && $('#tableCompIntPlana').DataTable().cell(rowIdx, 0).data().includes('bn')) {
|
||||
$("#tableCompIntPlana").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
negro_selected = true;
|
||||
table.rows('.selected').deselect();
|
||||
table.rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
if (!select1 && table.cell(rowIdx, 0).data().includes(tipo1)) {
|
||||
table.row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
select1 = true;
|
||||
}
|
||||
if (!color_selected && $('#tableCompIntPlana').DataTable().cell(rowIdx, 0).data().includes('color')) {
|
||||
$("#tableCompIntPlana").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
color_selected = true;
|
||||
if (tabla == 'plana' || tabla == 'cubierta')
|
||||
if (!select2 && table.cell(rowIdx, 0).data().includes(tipo2)) {
|
||||
table.row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
select2 = true;
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#tableCompIntPlana").DataTable();
|
||||
var rows = table.rows('.selected').indexes();
|
||||
var data = table.rows(rows).data();
|
||||
|
||||
@ -965,10 +1180,10 @@ class Comparador {
|
||||
value_total += parseFloat(data[i]['total'])
|
||||
}
|
||||
|
||||
$('#total_comp_plana').html(value_total.toFixed(2));
|
||||
$(total_label).html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
getRowFromLineaInt(tipo, linea) {
|
||||
getRowFromLinea(tipo, linea) {
|
||||
|
||||
const precio_impresion = isNaN(parseFloat(linea.fields.precio_impresion_horas + linea.fields.margen_impresion_horas + linea.fields.precio_click_pedido)) ? "" :
|
||||
parseFloat(linea.fields.precio_impresion_horas + linea.fields.margen_impresion_horas + linea.fields.precio_click_pedido).toFixed(2);
|
||||
@ -1002,25 +1217,165 @@ class Comparador {
|
||||
data['paginas_impresion'] = linea.fields.paginas_impresion;
|
||||
return data;
|
||||
}
|
||||
|
||||
getRowFromLineaRot(linea) {
|
||||
|
||||
const precio_impresion = isNaN(parseFloat(linea.fields.precio_impresion_horas + linea.fields.precio_click_pedido)) ? "" :
|
||||
parseFloat(linea.fields.precio_impresion_horas + linea.fields.precio_click_pedido).toFixed(2);
|
||||
|
||||
return {
|
||||
'tipo': 'rotativa',
|
||||
'paginas': linea.fields.paginas,
|
||||
'papel': linea.fields.papel_generico,
|
||||
'gramaje': linea.fields.gramaje,
|
||||
'marca': linea.fields.papel_impresion,
|
||||
'aFavorFibra': linea.fields.a_favor_fibra == 1 ? 'si' : 'no',
|
||||
'maquina': linea.fields.maquina,
|
||||
'numeroPliegos': isNaN(parseFloat(linea.fields.pliegos_libro)) ? "" : parseFloat(linea.fields.pliegos_libro).toFixed(2),
|
||||
'pliegosPedido': isNaN(parseFloat(linea.fields.pliegos_pedido)) ? "" : parseFloat(linea.fields.pliegos_pedido).toFixed(2),
|
||||
'precioPliego': isNaN(parseFloat(linea.fields.precios_pliegos)) ? "" : parseFloat(linea.fields.precios_pliegos).toFixed(6),
|
||||
'libro': isNaN(parseFloat(linea.fields.precio_libro)) ? "" : parseFloat(linea.fields.precio_libro).toFixed(2),
|
||||
'totalPapelPedido': isNaN(parseFloat(linea.fields.precio_pedido)) ? "" : parseFloat(linea.fields.precio_pedido).toFixed(2),
|
||||
'lomo': isNaN(parseFloat(linea.fields.mano)) ? "" : parseFloat(linea.fields.mano).toFixed(2),
|
||||
'peso': isNaN(parseFloat(linea.fields.peso)) ? "" : parseFloat(linea.fields.peso).toFixed(2),
|
||||
'horasMaquina': isNaN(parseFloat(linea.fields.horas_maquina)) ? "" : parseFloat(linea.fields.horas_maquina).toFixed(2),
|
||||
'precioImpresion': precio_impresion,
|
||||
'precioPagNegro': isNaN(parseFloat(linea.fields.precio_pagina_negro)) ? "" : parseFloat(linea.fields.precio_pagina_negro).toFixed(6),
|
||||
'precioPagColor': isNaN(parseFloat(linea.fields.precio_pagina_color)) ? "" : parseFloat(linea.fields.precio_pagina_color).toFixed(6),
|
||||
'totalTinta': isNaN(parseFloat(linea.fields.precio_tinta)) ? "" : parseFloat(linea.fields.precio_tinta).toFixed(2),
|
||||
'totalCorte': isNaN(parseFloat(linea.fields.total_corte)) ? "" : parseFloat(linea.fields.total_corte).toFixed(2),
|
||||
'total': isNaN(parseFloat(linea.fields.total_impresion)) ? "" : (parseFloat(linea.fields.total_impresion)).toFixed(2),
|
||||
'maquinaId': linea.fields.maquina_id,
|
||||
'maquinaVelocidad': linea.fields.maquina_velocidad,
|
||||
'tiempoMaquina': linea.fields.tiempo_maquina,
|
||||
'papelGenericoId': linea.fields.papel_generico_id,
|
||||
'papelImpresionId': linea.fields.papel_impresion_id,
|
||||
'paginasColor': linea.fields.paginas_color,
|
||||
'tarifa_impresion_id': linea.fields.tarifa_impresion_id,
|
||||
}
|
||||
}
|
||||
|
||||
generateCompJSON() {
|
||||
|
||||
data = {}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
try {
|
||||
bn_obj = {
|
||||
"bn": {
|
||||
'paginas': $('#compPaginasNegro').val(),
|
||||
'papel_id': $('#compPapelNegro').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegro').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
bn_obj = {}
|
||||
}
|
||||
$.extend(data, bn_obj);
|
||||
}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
try {
|
||||
bnhq_obj = {
|
||||
"bnhq": {
|
||||
'paginas': $('#compPaginasNegrohq').val(),
|
||||
'papel_id': $('#compPapelNegrohq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegrohq').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
bnhq_obj = {}
|
||||
}
|
||||
$.extend(data, bnhq_obj);
|
||||
}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
try {
|
||||
color_obj = {
|
||||
"color": {
|
||||
'paginas': $('#compPaginasColor').val(),
|
||||
'papel_id': $('#compPapelColor').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColor').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
color_obj = {}
|
||||
}
|
||||
$.extend(data, color_obj);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
try {
|
||||
colorhq_obj = {
|
||||
"colorhq": {
|
||||
'paginas': $('#compPaginasColorhq').val(),
|
||||
'papel_id': $('#compPapelColorhq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColorhq').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
colorhq_obj = {}
|
||||
}
|
||||
$.extend(data, colorhq_obj);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
cubierta_obj = {
|
||||
"cubierta": {
|
||||
'paginas': $('#compCarasCubierta option:selected').val(),
|
||||
'papel_id': $('#compPapelCubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeCubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
cubierta_obj = {}
|
||||
}
|
||||
$.extend(data, cubierta_obj);
|
||||
|
||||
try {
|
||||
sobrecubierta_obj = {
|
||||
"sobrecubierta": {
|
||||
'imprimir': $('#compSobrecubierta option:selected').val(),
|
||||
'papel_id': $('#compPapelSobrecubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeSobrecubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
sobrecubierta_obj = {}
|
||||
}
|
||||
$.extend(data, sobrecubierta_obj);
|
||||
|
||||
if ($('#compCarasGuardas').length > 0) {
|
||||
try {
|
||||
guardas_obj = {
|
||||
"guardas": {
|
||||
'paginas_impresion': $('#compCarasGuardas option:selected').val(),
|
||||
'papel_id': $('#compPapelGuardas').select2('data')[0].id,
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
guardas_obj = {}
|
||||
}
|
||||
$.extend(data, guardas_obj);
|
||||
|
||||
}
|
||||
|
||||
data_str = JSON.stringify(data)
|
||||
$('#comparador_json_data').val(data_str)
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
$('#compSobrecubierta').on('change', function(){
|
||||
if ($('#compSobrecubierta').val()==1){
|
||||
value = false
|
||||
}
|
||||
else{
|
||||
value = 'disabled'
|
||||
$('#compPapelSobrecubierta').val(0)
|
||||
$('#compGramajeSobrecubierta').val('')
|
||||
$('#compGramajeSobrecubierta').select2("destroy")
|
||||
$('#compGramajeSobrecubierta').select2({allowClear: false, minimumResultsForSearch: Infinity})
|
||||
|
||||
}
|
||||
$('#compPapelSobrecubierta').prop('disabled', value);
|
||||
$('#compGramajeSobrecubierta').prop('disabled', value);
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user