mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
bugs resueltos. añadida funcionalidad checkboxes
This commit is contained in:
@ -189,6 +189,28 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
// JJO
|
// JJO
|
||||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||||
|
|
||||||
|
if ($this->request->getPost('retractilado') == null) {
|
||||||
|
$sanitizedData['retractilado'] = false;
|
||||||
|
}
|
||||||
|
if ($this->request->getPost('retractilado5') == null) {
|
||||||
|
$sanitizedData['retractilado5'] = false;
|
||||||
|
}
|
||||||
|
if ($this->request->getPost('ferro') == null) {
|
||||||
|
$sanitizedData['ferro'] = false;
|
||||||
|
}
|
||||||
|
if ($this->request->getPost('ferro_digital') == null) {
|
||||||
|
$sanitizedData['ferro_digital'] = false;
|
||||||
|
}
|
||||||
|
if ($this->request->getPost('prototipo') == null) {
|
||||||
|
$sanitizedData['prototipo'] = false;
|
||||||
|
}
|
||||||
|
if ($this->request->getPost('marcapaginas') == null) {
|
||||||
|
$sanitizedData['marcapaginas'] = false;
|
||||||
|
}
|
||||||
|
if ($this->request->getPost('faja_color') == null) {
|
||||||
|
$sanitizedData['faja_color'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
@ -295,6 +317,14 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$this->viewData['POD'] = $this->getPOD();
|
$this->viewData['POD'] = $this->getPOD();
|
||||||
|
|
||||||
|
$this->viewData['serviciosCheckboxes'] = [
|
||||||
|
'retractilado' => 3,
|
||||||
|
'retractilado5' => 5,
|
||||||
|
'ferro' => 24,
|
||||||
|
'prototipo' => 9,
|
||||||
|
'fajaColor' => 16,
|
||||||
|
];
|
||||||
|
|
||||||
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('updateCosidotapablanda', $id);
|
$this->viewData['formAction'] = route_to('updateCosidotapablanda', $id);
|
||||||
|
|||||||
@ -17,9 +17,9 @@ class Test extends BaseController
|
|||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$model = model('App\Models\Tarifas\TarifaEnvioPrecioModel');
|
|
||||||
echo '<pre>';
|
echo '<pre>';
|
||||||
var_dump($model->getEnvioPrecio(2, 1.5, "cajas"));
|
var_dump($this->get_tarifa_enc(18, 150, 100, 98,148));
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,6 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"sobrecubiertas_ancho" => 0.0,
|
"sobrecubiertas_ancho" => 0.0,
|
||||||
"merma" => null,
|
"merma" => null,
|
||||||
"merma_portada" => 6.0,
|
"merma_portada" => 6.0,
|
||||||
"imagenes_bn_interior" => false,
|
|
||||||
"comentarios_cliente" => null,
|
"comentarios_cliente" => null,
|
||||||
"comentarios_safekat" => null,
|
"comentarios_safekat" => null,
|
||||||
"comentarios_pdf" => null,
|
"comentarios_pdf" => null,
|
||||||
@ -215,7 +214,6 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"sobrecubiertas_ancho" => "float",
|
"sobrecubiertas_ancho" => "float",
|
||||||
"merma" => "float",
|
"merma" => "float",
|
||||||
"merma_portada" => "float",
|
"merma_portada" => "float",
|
||||||
"imagenes_bn_interior" => "boolean",
|
|
||||||
"en_produccion" => "boolean",
|
"en_produccion" => "boolean",
|
||||||
"en_espera" => "boolean",
|
"en_espera" => "boolean",
|
||||||
"modo_comparador" => "boolean",
|
"modo_comparador" => "boolean",
|
||||||
|
|||||||
@ -158,10 +158,12 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
public function getPrecioTarifa($tarifa_encuadernacion_id, $paginas, $tirada, $ancho, $alto, $proveedor_id, $POD){
|
public function getPrecioTarifa($tarifa_encuadernacion_id, $paginas, $tirada, $ancho, $alto, $proveedor_id, $POD){
|
||||||
|
|
||||||
$modelTarifa = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
$modelTarifa = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
||||||
if($proveedor_id != -1)
|
if($proveedor_id != -1){
|
||||||
$tarifa_value = $modelTarifa->getTarifaPresupuestoEncuadernacion($tarifa_encuadernacion_id, $paginas, $tirada, $ancho, $alto, $proveedor_id);
|
$tarifa_value = $modelTarifa->getTarifaPresupuestoEncuadernacion($tarifa_encuadernacion_id, $paginas, $tirada, $ancho, $alto, $proveedor_id);
|
||||||
else
|
}
|
||||||
|
else{
|
||||||
$tarifa_value = $modelTarifa->getTarifaPresupuestoEncuadernacion($tarifa_encuadernacion_id, $paginas, $tirada, $ancho, $alto);
|
$tarifa_value = $modelTarifa->getTarifaPresupuestoEncuadernacion($tarifa_encuadernacion_id, $paginas, $tirada, $ancho, $alto);
|
||||||
|
}
|
||||||
if (count($tarifa_value)>0) {
|
if (count($tarifa_value)>0) {
|
||||||
|
|
||||||
$result_data = $this->calcularTarifa($tarifa_value[0], $paginas, $POD<$tirada?false:true);
|
$result_data = $this->calcularTarifa($tarifa_value[0], $paginas, $POD<$tirada?false:true);
|
||||||
|
|||||||
@ -69,7 +69,6 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
|||||||
"sobrecubiertas_ancho",
|
"sobrecubiertas_ancho",
|
||||||
"merma",
|
"merma",
|
||||||
"merma_portada",
|
"merma_portada",
|
||||||
"imagenes_bn_interior",
|
|
||||||
"comentarios_cliente",
|
"comentarios_cliente",
|
||||||
"comentarios_safekat",
|
"comentarios_safekat",
|
||||||
"comentarios_pdf",
|
"comentarios_pdf",
|
||||||
|
|||||||
@ -158,11 +158,11 @@ class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
|
|||||||
$builder->where('t2.tirada_min <=', $tirada);
|
$builder->where('t2.tirada_min <=', $tirada);
|
||||||
$builder->where('t2.tirada_max >=', $tirada);
|
$builder->where('t2.tirada_max >=', $tirada);
|
||||||
$builder->where('t3.paginas_libro_min <=', $paginas);
|
$builder->where('t3.paginas_libro_min <=', $paginas);
|
||||||
$builder->where('t3.paginas_libro_max >', $paginas);
|
$builder->where('t3.paginas_libro_max >=', $paginas);
|
||||||
$builder->where('t4.ancho_min <=', $ancho);
|
$builder->where('t4.ancho_min <=', $ancho);
|
||||||
$builder->where('t4.ancho_max >', $ancho);
|
$builder->where('t4.ancho_max >=', $ancho);
|
||||||
$builder->where('t4.alto_min <=', $alto);
|
$builder->where('t4.alto_min <=', $alto);
|
||||||
$builder->where('t4.alto_max >', $alto);
|
$builder->where('t4.alto_max >=', $alto);
|
||||||
|
|
||||||
if($proveedor_id != -1){
|
if($proveedor_id != -1){
|
||||||
$builder->where('t2.proveedor_id', $proveedor_id);
|
$builder->where('t2.proveedor_id', $proveedor_id);
|
||||||
|
|||||||
@ -233,33 +233,8 @@
|
|||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
</div><!--//.col -->
|
</div><!--//.col -->
|
||||||
|
|
||||||
<div class="col-md-12 col-lg-3 px-4">
|
|
||||||
<div class="mb-3">
|
|
||||||
<div class="form-check">
|
|
||||||
<label for="recogerEnTaller" class="form-check-label">
|
|
||||||
<input type="checkbox" id="recogerEnTaller" name="recoger_en_taller" value="1" class="form-check-input" <?= $presupuestoEntity->recoger_en_taller == true ? 'checked' : ''; ?>>
|
|
||||||
<?= lang('Presupuestos.recogerEnTaller') ?>
|
|
||||||
</label>
|
|
||||||
</div><!--//.form-check -->
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
</div><!--//.col -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-md-12 col-lg-4 px-4">
|
|
||||||
<div class="mb-3">
|
|
||||||
<div class="form-check">
|
|
||||||
<label for="imagenesBnInterior" class="form-check-label">
|
|
||||||
<input type="checkbox" id="imagenesBnInterior" name="imagenes_bn_interior" value="1" class="form-check-input" <?= $presupuestoEntity->imagenes_bn_interior == true ? 'checked' : ''; ?>>
|
|
||||||
<?= lang('Presupuestos.imagenesBnInterior') ?>
|
|
||||||
</label>
|
|
||||||
</div><!--//.form-check -->
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
</div><!--//.col -->
|
|
||||||
|
|
||||||
</div> <!--//.row -->
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div> <!-- //.accordion-body -->
|
</div> <!-- //.accordion-body -->
|
||||||
@ -358,11 +333,37 @@ $('#papelFormatoPersonalizado').on("click",function(){
|
|||||||
<?php if(str_contains($formAction,'edit')): ?>
|
<?php if(str_contains($formAction,'edit')): ?>
|
||||||
var ancho_libro = getDimensionLibro().ancho;
|
var ancho_libro = getDimensionLibro().ancho;
|
||||||
var alto_libro = getDimensionLibro().alto;
|
var alto_libro = getDimensionLibro().alto;
|
||||||
|
|
||||||
|
$('#retractilado').on("change", function () {
|
||||||
|
checkRetractiladoComparador(this);
|
||||||
|
servicioRetractilado()
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#retractilado5').on("change", function () {
|
||||||
|
checkRetractiladoComparador(this);
|
||||||
|
servicioRetractilado5()
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#fajaColor').on("change", function () {
|
||||||
|
servicioFajaColor()
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#ferro').on("change", function () {
|
||||||
|
servicioFerro()
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#prototipo').on("change", function () {
|
||||||
|
servicioPrototipo()
|
||||||
|
servicioFerro()
|
||||||
|
});
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
$('#papelFormatoId').on('select2:select', function (e){
|
$('#papelFormatoId').on('select2:select', function (e){
|
||||||
ancho_libro = getDimensionLibro().ancho;
|
ancho_libro = getDimensionLibro().ancho;
|
||||||
alto_libro = getDimensionLibro().alto;
|
alto_libro = getDimensionLibro().alto;
|
||||||
|
update_servicios(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#papelFormatoAncho').on('change', function (e){
|
$('#papelFormatoAncho').on('change', function (e){
|
||||||
|
|||||||
@ -1331,6 +1331,7 @@
|
|||||||
else{
|
else{
|
||||||
$('#insertarCubiertaBtn').addClass('d-none')
|
$('#insertarCubiertaBtn').addClass('d-none')
|
||||||
$('#total_comp_cubierta').html('0.00')
|
$('#total_comp_cubierta').html('0.00')
|
||||||
|
$('#compGramajeCubierta').empty().trigger("change");
|
||||||
$('#compGramajeCubierta').val('').trigger('change');
|
$('#compGramajeCubierta').val('').trigger('change');
|
||||||
$('#compGramajeCubierta').prop('disabled', false);
|
$('#compGramajeCubierta').prop('disabled', false);
|
||||||
$('#compPapelCubierta').find('option[value="0"]').remove();
|
$('#compPapelCubierta').find('option[value="0"]').remove();
|
||||||
|
|||||||
@ -404,6 +404,7 @@
|
|||||||
$('#precio_total_acabado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
$('#precio_total_acabado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
||||||
$('#acabado_margen_' + line[0].tarifa_id).text(parseFloat(line[0].margen).toFixed(2))
|
$('#acabado_margen_' + line[0].tarifa_id).text(parseFloat(line[0].margen).toFixed(2))
|
||||||
});
|
});
|
||||||
|
check_serv_acabado_error()
|
||||||
yeniden(data.<?= csrf_token() ?>);
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
}).then(
|
}).then(
|
||||||
fetch(domain + "/presupuestos/presupuestoencuadernaciones/update/" + id , {
|
fetch(domain + "/presupuestos/presupuestoencuadernaciones/update/" + id , {
|
||||||
@ -426,8 +427,10 @@
|
|||||||
data.lines.forEach((line) => {
|
data.lines.forEach((line) => {
|
||||||
|
|
||||||
$('#proveedor_enc_' + line[0].tarifa_id).off('change')
|
$('#proveedor_enc_' + line[0].tarifa_id).off('change')
|
||||||
if(line[0].hasOwnProperty('proveedor_id'))
|
if(line[0].hasOwnProperty('proveedor_id')){
|
||||||
$('#proveedor_enc_' + line[0].tarifa_id).val(line[0].proveedor_id)
|
$('#proveedor_enc_' + line[0].tarifa_id)
|
||||||
|
.append('<option selected="selected" value="' + line[0].proveedor_id + '">' + line[0].proveedor + '</option>')
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
$('#proveedor_enc_' + line[0].tarifa_id).empty()
|
$('#proveedor_enc_' + line[0].tarifa_id).empty()
|
||||||
.append('<option selected="selected" value="' + line[0].proveedor_id + '">' + '<?= lang("Presupuestos.no_disponible") ?>' + '</option>')
|
.append('<option selected="selected" value="' + line[0].proveedor_id + '">' + '<?= lang("Presupuestos.no_disponible") ?>' + '</option>')
|
||||||
@ -437,6 +440,7 @@
|
|||||||
$('#enc_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
$('#enc_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
||||||
$('#proveedor_enc_' + line[0].tarifa_id).on('change', proveedor_enc_event)
|
$('#proveedor_enc_' + line[0].tarifa_id).on('change', proveedor_enc_event)
|
||||||
});
|
});
|
||||||
|
check_serv_enc_error()
|
||||||
yeniden(data.<?= csrf_token() ?>);
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
}).then(
|
}).then(
|
||||||
fetch(domain + "/presupuestos/presupuestomanipulados/update/" + id , {
|
fetch(domain + "/presupuestos/presupuestomanipulados/update/" + id , {
|
||||||
@ -458,6 +462,7 @@
|
|||||||
$('#precio_total_manipulado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
$('#precio_total_manipulado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
||||||
$('#manipulado_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
$('#manipulado_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
||||||
});
|
});
|
||||||
|
check_serv_manipulado_error()
|
||||||
yeniden(data.<?= csrf_token() ?>);
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
}).then(function(){
|
}).then(function(){
|
||||||
if(update_preimpresion){
|
if(update_preimpresion){
|
||||||
@ -478,7 +483,7 @@
|
|||||||
$('#precio_preimpresion_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
$('#precio_preimpresion_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
|
||||||
$('#preimpresion_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
$('#preimpresion_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
|
||||||
});
|
});
|
||||||
|
check_serv_preimpresion_error()
|
||||||
yeniden(data.<?= csrf_token() ?>);
|
yeniden(data.<?= csrf_token() ?>);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -604,6 +609,54 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function servicioRetractilado(){
|
||||||
|
if($('#retractilado').prop('checked')){
|
||||||
|
$('#add_servicio_acabado_list').val(<?php echo $serviciosCheckboxes['retractilado'] ?>)
|
||||||
|
$('#insertar_serv_acabado').click()
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var row_indexes = tableServiciosAcabado.rows().eq( 0 ).filter( function (rowIdx) {
|
||||||
|
return tableServiciosAcabado.cell( rowIdx, 0 ).data() == <?php echo $serviciosCheckboxes['retractilado'] ?> ? true : false;
|
||||||
|
} );
|
||||||
|
if(row_indexes.length > 0){
|
||||||
|
tableServiciosAcabado.row(row_indexes[0]).remove().draw()
|
||||||
|
check_serv_acabado_error()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function servicioRetractilado5(){
|
||||||
|
if($('#retractilado5').prop('checked')){
|
||||||
|
$('#add_servicio_acabado_list').val(<?php echo $serviciosCheckboxes['retractilado5'] ?>)
|
||||||
|
$('#insertar_serv_acabado').click()
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var row_indexes = tableServiciosAcabado.rows().eq( 0 ).filter( function (rowIdx) {
|
||||||
|
return tableServiciosAcabado.cell( rowIdx, 0 ).data() == <?php echo $serviciosCheckboxes['retractilado5'] ?> ? true : false;
|
||||||
|
} );
|
||||||
|
if(row_indexes.length > 0){
|
||||||
|
tableServiciosAcabado.row(row_indexes[0]).remove().draw()
|
||||||
|
check_serv_acabado_error()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function servicioFajaColor(){
|
||||||
|
if($('#fajaColor').prop('checked')){
|
||||||
|
$('#add_servicio_acabado_list').val(<?php echo $serviciosCheckboxes['fajaColor'] ?>)
|
||||||
|
$('#insertar_serv_acabado').click()
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var row_indexes = tableServiciosAcabado.rows().eq( 0 ).filter( function (rowIdx) {
|
||||||
|
return tableServiciosAcabado.cell( rowIdx, 0 ).data() == <?php echo $serviciosCheckboxes['fajaColor'] ?> ? true : false;
|
||||||
|
} );
|
||||||
|
if(row_indexes.length > 0){
|
||||||
|
tableServiciosAcabado.row(row_indexes[0]).remove().draw()
|
||||||
|
check_serv_acabado_error()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$('#insertar_serv_acabado').on('click', function(){
|
$('#insertar_serv_acabado').on('click', function(){
|
||||||
const tarifa_text = $('#add_servicio_acabado_list').select2('data')[0].text.trim()
|
const tarifa_text = $('#add_servicio_acabado_list').select2('data')[0].text.trim()
|
||||||
|
|
||||||
@ -788,7 +841,8 @@
|
|||||||
|
|
||||||
var htmlString = '';
|
var htmlString = '';
|
||||||
|
|
||||||
if($('#tableOfServiciosEncuadernacion tr > td:contains(' + '<?= lang("Presupuestos.no_disponible") ?>' + ')').length > 0){
|
$('#tableOfServiciosEncuadernacion tr').each(function(){
|
||||||
|
if($(this).find('td').eq(3).text() == '0.00'){
|
||||||
htmlString = `
|
htmlString = `
|
||||||
<div class="alert alert-danger d-flex align-items-baseline" role="alert">
|
<div class="alert alert-danger d-flex align-items-baseline" role="alert">
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
@ -799,6 +853,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
})
|
||||||
$('#serv-enc-error').html(htmlString)
|
$('#serv-enc-error').html(htmlString)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1231,6 +1286,41 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function servicioPrototipo(){
|
||||||
|
if($('#prototipo').prop('checked')){
|
||||||
|
$('#add_servicio_preimpresion_list').val(<?php echo $serviciosCheckboxes['prototipo'] ?>)
|
||||||
|
$('#insertar_serv_preimpresion').click()
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var row_indexes = tableServiciosPreimpresion.rows().eq( 0 ).filter( function (rowIdx) {
|
||||||
|
return tableServiciosPreimpresion.cell( rowIdx, 0 ).data() == <?php echo $serviciosCheckboxes['prototipo'] ?> ? true : false;
|
||||||
|
} );
|
||||||
|
if(row_indexes.length > 0){
|
||||||
|
tableServiciosPreimpresion.row(row_indexes[0]).remove().draw()
|
||||||
|
check_serv_preimpresion_error()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function servicioFerro(){
|
||||||
|
var row_indexes = tableServiciosPreimpresion.rows().eq( 0 ).filter( function (rowIdx) {
|
||||||
|
return tableServiciosPreimpresion.cell( rowIdx, 0 ).data() == <?php echo $serviciosCheckboxes['ferro'] ?> ? true : false;
|
||||||
|
} );
|
||||||
|
if($('#ferro').prop('checked')){
|
||||||
|
if(row_indexes.length == 0){
|
||||||
|
$('#add_servicio_preimpresion_list').val(<?php echo $serviciosCheckboxes['ferro'] ?>)
|
||||||
|
$('#insertar_serv_preimpresion').click()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(row_indexes.length > 0){
|
||||||
|
tableServiciosPreimpresion.row(row_indexes[0]).remove().draw()
|
||||||
|
check_serv_preimpresion_error()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$('#insertar_serv_preimpresion').on('click', function(){
|
$('#insertar_serv_preimpresion').on('click', function(){
|
||||||
const tarifa_text = $('#add_servicio_preimpresion_list').select2('data')[0].text.trim()
|
const tarifa_text = $('#add_servicio_preimpresion_list').select2('data')[0].text.trim()
|
||||||
|
|
||||||
|
|||||||
@ -72,33 +72,12 @@ $('#compPaginasColorhq').on("change", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#compRetractilado').on("change", function () {
|
|
||||||
checkRetractiladoComparador(this);
|
$('#prototipo').on("change", function () {
|
||||||
|
$('#ferro').prop('checked', true)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('#compRetractilado5').on("change", function () {
|
|
||||||
checkRetractiladoComparador(this);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('#imagenesBnInterior').on("change", function () {
|
|
||||||
var e = document.getElementById('tipoImpresion');
|
|
||||||
var optionToHide = e.querySelector("option[value='negro']");
|
|
||||||
|
|
||||||
if (document.getElementById('imagenesBnInterior').checked) {
|
|
||||||
optionToHide.setAttribute('disabled', 'disabled')
|
|
||||||
|
|
||||||
if (e.value == 'negro') {
|
|
||||||
e.value = 'negrohq';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
optionToHide.removeAttribute('disabled');
|
|
||||||
}
|
|
||||||
$('#tipoImpresion').select2();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('#compPosPaginasColor').on("keyup", function () {
|
$('#compPosPaginasColor').on("keyup", function () {
|
||||||
computarPaginasColor(this.value);
|
computarPaginasColor(this.value);
|
||||||
@ -230,14 +209,14 @@ function computarPaginasColor(string) {
|
|||||||
function checkRetractiladoComparador(element) {
|
function checkRetractiladoComparador(element) {
|
||||||
|
|
||||||
switch (element.id) {
|
switch (element.id) {
|
||||||
case 'compRetractilado':
|
case 'retractilado':
|
||||||
if (document.getElementById(element.id).checked) {
|
if ($('#' + element.id).prop('checked')) {
|
||||||
document.getElementById('compRetractilado5').checked = false;
|
$('#retractilado5').prop('checked', false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'compRetractilado5':
|
case 'retractilado5':
|
||||||
if (document.getElementById(element.id).checked) {
|
if ($('#' + element.id).prop('checked')) {
|
||||||
document.getElementById('compRetractilado').checked = false;
|
$('#retractilado').prop('checked', false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -551,8 +530,7 @@ function generateCompJSON(){
|
|||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
|
|
||||||
if( $('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color')
|
if ($('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
bn_obj = {
|
bn_obj = {
|
||||||
"bn": {
|
"bn": {
|
||||||
@ -568,8 +546,7 @@ function generateCompJSON(){
|
|||||||
$.extend(data, bn_obj);
|
$.extend(data, bn_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq')
|
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
bnhq_obj = {
|
bnhq_obj = {
|
||||||
"bnhq": {
|
"bnhq": {
|
||||||
@ -585,8 +562,7 @@ function generateCompJSON(){
|
|||||||
$.extend(data, bnhq_obj);
|
$.extend(data, bnhq_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($('#tipoImpresion').select2('data')[0].id == 'color')
|
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
color_obj = {
|
color_obj = {
|
||||||
"color": {
|
"color": {
|
||||||
@ -604,8 +580,7 @@ function generateCompJSON(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($('#tipoImpresion').select2('data')[0].id == 'colorhq')
|
if ($('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
colorhq_obj = {
|
colorhq_obj = {
|
||||||
"colorhq": {
|
"colorhq": {
|
||||||
|
|||||||
Reference in New Issue
Block a user