mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
mergeando del main a mi rama
This commit is contained in:
@ -22,7 +22,7 @@ if (session()->has('error')) {
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
<?= $this->section('globalJsFunctions') ?>
|
||||
|
||||
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
|
||||
var htmlString = `
|
||||
|
||||
@ -564,7 +564,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php if ($formAction !== site_url('cliente/add')){ ?>
|
||||
<div class="tab-pane fade" id="tarifascliente" role="tabpanel">
|
||||
<?= view("themes/backend/vuexy/form/clientes/cliente/convert2templateModal") ?>
|
||||
@ -610,7 +609,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="contactos" role="tabpanel">
|
||||
<table id="tableOfClienteContactos"
|
||||
class="table table-striped table-hover" style="width: 100%;">
|
||||
@ -629,7 +627,6 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="domicilio-entrega" role="tabpanel">
|
||||
<?= view("themes/backend/vuexy/form/clientes/cliente/_clienteDireccionesForm") ?>
|
||||
<table id="tableOfDireccionesEnvio" class="table dt-responsive dataTable" style="width: 100%;">
|
||||
@ -662,7 +659,20 @@
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="usuarios" role="tabpanel">
|
||||
<h3>Proximanente</h3>
|
||||
<table id="tableOfClienteUsuarios" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th><?= lang('App.profile_first_name') ?></th>
|
||||
<th><?= lang('App.profile_last_name') ?></th>
|
||||
<th><?= lang('App.profile_email') ?></th>
|
||||
<th class="text-nowrap" style="min-width:100px"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
@ -673,27 +683,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<?php /* A implementar en el controller
|
||||
<div class="mb-3">
|
||||
<label for="limiteCreditoUserId" class="form-label">
|
||||
<?= lang('Clientes.limiteCreditoUserId') ?>*
|
||||
</label>
|
||||
<input type="number" id="limiteCreditoUserId" name="limite_credito_user_id" required placeholder="1"
|
||||
maxLength="10" class="form-control"
|
||||
value="<?= old('limite_credito_user_id', $clienteEntity->limite_credito_user_id) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="limiteCreditoChangeAt" class="form-label">
|
||||
<?= lang('Clientes.limiteCreditoChangeAt') ?>*
|
||||
</label>
|
||||
<input type="text" id="limiteCreditoChangeAt" name="limite_credito_change_at" required
|
||||
placeholder="2017-02-13 12:38:03" maxLength="20" class="form-control"
|
||||
value="<?= old('limite_credito_change_at', $clienteEntity->limite_credito_change_at) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
*/ ?>
|
||||
|
||||
|
||||
|
||||
<?php if ($formAction !== site_url('cliente/add')){ ?>
|
||||
@ -701,6 +690,12 @@
|
||||
/****************************************
|
||||
Funcionamiento general
|
||||
*****************************************/
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
let id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
|
||||
$(document).on('click', '.btn-remove', function(e) {
|
||||
|
||||
@ -718,18 +713,21 @@ $(document).on('click', '.btn-remove', function(e) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
/****************************************
|
||||
Contactos
|
||||
*****************************************/
|
||||
|
||||
const lastColNr = $('#tableOfClienteContactos').find("tr:first th").length - 1;
|
||||
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-deleted mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||
<span class="cancel"></span>
|
||||
`;
|
||||
};
|
||||
@ -779,7 +777,6 @@ $(document).on('click', '.btn-remove', function(e) {
|
||||
|
||||
|
||||
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
@ -803,33 +800,27 @@ $(document).on('click', '.btn-remove', function(e) {
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
// Delete row
|
||||
$('#tableOfClienteContactos').on( 'click', 'tbody span.remove', function (e) {
|
||||
$(document).on('click', '.btn-deleted', function(e) {
|
||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||
});
|
||||
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
editor
|
||||
.create( false )
|
||||
.edit( this.parentNode, false)
|
||||
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
||||
.set( 'is_deleted', 1 )
|
||||
.submit();
|
||||
|
||||
}
|
||||
});
|
||||
$(document).on('click', '.btn-remove', function(e) {
|
||||
const dataId = $(this).attr('data-id');
|
||||
const row = $(this).closest('tr');
|
||||
if ($.isNumeric(dataId)) {
|
||||
$.ajax({
|
||||
url: `/clientecontactos/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
var theTable = $('#tableOfClienteContactos').DataTable( {
|
||||
@ -1457,6 +1448,67 @@ function delete_direccion_envio(dataId){
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
/****************************************
|
||||
Contactos
|
||||
*****************************************/
|
||||
|
||||
const lastColNrCU = $('#tableOfClienteUsuarios').find("tr:first th").length - 1;
|
||||
|
||||
var theTableCU = $('#tableOfClienteUsuarios').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfClienteUsuarios') ?>',
|
||||
data: {
|
||||
//id_cliente: id,
|
||||
id_cliente: 1,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'apellidos' },
|
||||
{ 'data': 'email' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNrCU]
|
||||
},
|
||||
{
|
||||
"orderData": [ 0, 1 ],
|
||||
"targets": 0
|
||||
},
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
}
|
||||
} );
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.min.css') ?>">
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
$('#saveForm').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#soporteId').select2({
|
||||
@ -230,11 +230,9 @@
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>">
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
@ -121,6 +121,11 @@ $('#tableOfPresupuestos thead tr:eq(1) th').each(function (i) {
|
||||
selector.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>');
|
||||
selector.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>');
|
||||
selector.append('<option value="libroFresadoTapaDura"><?= lang('Presupuestos.libroFresadoTapaDura') ?></option>');
|
||||
selector.append('<option value="libroEspiralTapaDura"><?= lang('Presupuestos.libroEspiralTapaDura') ?></option>');
|
||||
selector.append('<option value="libroEspiralTapaBlanda"><?= lang('Presupuestos.libroEspiralTapaBlanda') ?></option>');
|
||||
selector.append('<option value="libroWireoTapaDura"><?= lang('Presupuestos.libroWireoTapaDura') ?></option>');
|
||||
selector.append('<option value="libroWireoTapaBlanda"><?= lang('Presupuestos.libroWireoTapaBlanda') ?></option>');
|
||||
selector.append('<option value="libroGrapado"><?= lang('Presupuestos.libroGrapado') ?></option>');
|
||||
|
||||
selector.on('change', function () {
|
||||
var val = $.fn.dataTable.util.escapeRegex(
|
||||
@ -207,6 +212,27 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
||||
return '<?= lang('Presupuestos.libroFresadoTapaDura') ?>';
|
||||
break;
|
||||
|
||||
|
||||
case "libroEspiralTapaDura":
|
||||
return '<?= lang('Presupuestos.libroEspiralTapaDura') ?>';
|
||||
break;
|
||||
|
||||
case "libroEspiralTapaBlanda":
|
||||
return '<?= lang('Presupuestos.libroEspiralTapaBlanda') ?>';
|
||||
break;
|
||||
|
||||
case "libroWireoTapaDura":
|
||||
return '<?= lang('Presupuestos.libroWireoTapaDura') ?>';
|
||||
break;
|
||||
|
||||
case "libroWireoTapaBlanda":
|
||||
return '<?= lang('Presupuestos.libroWireoTapaBlanda') ?>';
|
||||
break;
|
||||
|
||||
case "libroGrapado":
|
||||
return '<?= lang('Presupuestos.libroGrapado') ?>';
|
||||
break;
|
||||
|
||||
default:
|
||||
return data; // Debug
|
||||
break;
|
||||
|
||||
@ -220,6 +220,7 @@ $(document).on('click', '.delete-add-row', function(e) {
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
showBreadCrumbSaveButton(true);
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -173,4 +173,4 @@
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
* Seccion para las funciones generales de la pagina
|
||||
***************************************************************************************/
|
||||
|
||||
|
||||
$('.nav-servicios button').on('shown.bs.tab', function(){
|
||||
$("#tableOfServiciosEncuadernacion").DataTable().columns.adjust();
|
||||
$("#tableOfServiciosPreimpresion").DataTable().columns.adjust();
|
||||
@ -16,6 +15,7 @@ $('#serv_default').on('click', function(){
|
||||
get_tarifas_enc('default').then(
|
||||
get_tarifas_manipulado('default')
|
||||
)
|
||||
showBreadCrumbSaveButton(true);
|
||||
})
|
||||
|
||||
// Delete row
|
||||
@ -73,6 +73,7 @@ $(document).on('click', '.btn-delete-serv', function(e) {
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
//updateTotales(false, true, false)
|
||||
showBreadCrumbSaveButton(true);
|
||||
|
||||
});
|
||||
|
||||
@ -369,6 +370,8 @@ $('#insertar_serv_acabado').on('click', function(){
|
||||
popErrorAlert(window.Presupuestos.errores.error_servicios_duplicados, 'serv-acabado-alert');
|
||||
}
|
||||
check_serv_acabado_error();
|
||||
showBreadCrumbSaveButton(true);
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -1298,13 +1301,16 @@ function servicioFerro(){
|
||||
}
|
||||
|
||||
$('#insertar_serv_preimpresion').on('click', function(){
|
||||
const tarifa_text = $('#add_servicio_preimpresion_list').select2('data')[0].text.trim()
|
||||
|
||||
if( $('#add_servicio_preimpresion_list').select2('data')[0].text.trim().length > 0){
|
||||
if($('#tableOfServiciosPreimpresion tr > td:contains(' + tarifa_text + ')').length == 0)
|
||||
get_tarifas_preimpresion($('#add_servicio_preimpresion_list').select2('data')[0].id);
|
||||
else{
|
||||
popErrorAlert(window.Presupuestos.errores.error_servicios_duplicados, 'serv-preimpresion-alert')
|
||||
|
||||
let data = $('#add_servicio_preimpresion_list').select2('data');
|
||||
if (data.length > 0) {
|
||||
const tarifa_text = data[0].text.trim();
|
||||
if (tarifa_text.length > 0) {
|
||||
if ($('#tableOfServiciosPreimpresion tr > td:contains(' + tarifa_text + ')').length == 0)
|
||||
get_tarifas_preimpresion(data[0].id);
|
||||
else {
|
||||
popErrorAlert(window.Presupuestos.errores.error_servicios_duplicados, 'serv-preimpresion-alert');
|
||||
}
|
||||
}
|
||||
}
|
||||
check_serv_preimpresion_error()
|
||||
|
||||
@ -852,7 +852,7 @@ var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||
var select = $('<select>')
|
||||
.attr('id', row.row_id + '_gramaje')
|
||||
.attr('name', row.row_id + '_gramaje')
|
||||
.addClass('form-control form-select-sm lp-cell lp-select ' + row.row_class + '-select')
|
||||
.addClass('form-control form-select-sm lp-cell lp-select ' )//+ row.row_class + '-select')
|
||||
.css('min-width', '40px')
|
||||
|
||||
var option = '<option value="" selected>'+ parseInt(data)+'</option>';
|
||||
@ -1504,7 +1504,20 @@ $('#btn_addLinea').on("click", function (e) {
|
||||
/***********************
|
||||
* Funciones LP BN
|
||||
************************/
|
||||
async function set_lp_bn_gramaje(){
|
||||
function change_papelGenerico_lp_bn(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_bn_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_bn(true)
|
||||
set_lp_bn_gramaje()
|
||||
}
|
||||
}
|
||||
|
||||
async function set_lp_bn_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_bn_gramaje option:selected').text()
|
||||
$('#lp_bn_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
uso: 'interior',
|
||||
@ -1517,7 +1530,7 @@ async function set_lp_bn_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_bn(true)
|
||||
$('#lp_bn_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -1527,14 +1540,21 @@ async function set_lp_bn_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_bn_gramaje').append(option);
|
||||
});
|
||||
$('#lp_bn_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
$('#lp_bn_gramaje option').filter(function() {
|
||||
return $(this).html() == previous;
|
||||
}).prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_bn_gramaje').val('')
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function set_lp_bn_papelImpresion(){
|
||||
|
||||
var datos = {
|
||||
@ -1831,8 +1851,16 @@ function fill_lp_bn(row, fromComparator=false){
|
||||
}
|
||||
|
||||
function eventos_lp_bn(isInkjet = false){
|
||||
$('#lp_bn_papel').bind("focus", {clear_selectors: true}, clear_lp_bn);
|
||||
$('#lp_bn_gramaje').bind("focus", set_lp_bn_gramaje);
|
||||
|
||||
$('#lp_bn_papel').bind("change", change_papelGenerico_lp_bn);
|
||||
$('#lp_bn_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_bn_gramaje);
|
||||
$('#lp_bn_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_bn_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_bn(true)
|
||||
}
|
||||
});
|
||||
$('#lp_bn_papelImpresion').focus("focus", set_lp_bn_papelImpresion);
|
||||
$('#lp_bn_maquina').bind("focus", set_lp_bn_maquina);
|
||||
$('#lp_bn_maquina').bind("change", change_lp_bn_maquina);
|
||||
@ -1850,7 +1878,20 @@ function eventos_lp_bn(isInkjet = false){
|
||||
/***********************
|
||||
* Funciones LP COLOR
|
||||
************************/
|
||||
async function set_lp_color_gramaje(){
|
||||
function change_papelGenerico_lp_color(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_color_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_color(true)
|
||||
set_lp_color_gramaje()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_color_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_color_gramaje option:selected').text()
|
||||
$('#lp_color_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
@ -1864,7 +1905,7 @@ async function set_lp_color_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_color(true)
|
||||
$('#lp_color_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -1874,7 +1915,14 @@ async function set_lp_color_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_color_gramaje').append(option);
|
||||
});
|
||||
$('#lp_color_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
$('#lp_color_gramaje option').filter(function() {
|
||||
return $(this).html() == previous;
|
||||
}).prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_color_gramaje').val('')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -2169,8 +2217,15 @@ function fill_lp_color(row, fromComparator=false){
|
||||
|
||||
function eventos_lp_color(isInkjet = false){
|
||||
|
||||
$('#lp_color_papel').bind("focus", {clear_selectors: true}, clear_lp_color);
|
||||
$('#lp_color_gramaje').bind("focus", set_lp_color_gramaje);
|
||||
$('#lp_color_papel').bind("change", change_papelGenerico_lp_color);
|
||||
$('#lp_color_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_color_gramaje);
|
||||
$('#lp_color_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_color_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_color(true)
|
||||
}
|
||||
});
|
||||
$('#lp_color_papelImpresion').focus("focus", set_lp_color_papelImpresion);
|
||||
$('#lp_color_maquina').bind("focus", set_lp_color_maquina);
|
||||
$('#lp_color_maquina').bind("change", change_lp_color_maquina);
|
||||
@ -2189,7 +2244,20 @@ function eventos_lp_color(isInkjet = false){
|
||||
/***********************
|
||||
* Funciones LP BNHQ
|
||||
************************/
|
||||
async function set_lp_bnhq_gramaje(){
|
||||
function change_papelGenerico_lp_bnhq(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_bnhq_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_bnhq(true)
|
||||
set_lp_bnhq_gramaje()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_bnhq_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_bnhq_gramaje option:selected').text()
|
||||
$('#lp_bnhq_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
@ -2203,7 +2271,7 @@ async function set_lp_bnhq_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_bnhq(true)
|
||||
$('#lp_bnhq_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -2213,7 +2281,14 @@ async function set_lp_bnhq_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_bnhq_gramaje').append(option);
|
||||
});
|
||||
$('#lp_bnhq_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
$('#lp_bnhq_gramaje option').filter(function() {
|
||||
return $(this).html() == previous;
|
||||
}).prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_bnhq_gramaje').val('')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -2507,8 +2582,15 @@ function fill_lp_bnhq(row, fromComparator=false){
|
||||
}
|
||||
|
||||
function eventos_lp_bnhq(isInkjet = false){
|
||||
$('#lp_bnhq_papel').bind("focus", {clear_selectors: true}, clear_lp_bnhq);
|
||||
$('#lp_bnhq_gramaje').bind("focus", set_lp_bnhq_gramaje);
|
||||
$('#lp_bnhq_papel').bind("change", change_papelGenerico_lp_bnhq);
|
||||
$('#lp_bnhq_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_bnhq_gramaje);
|
||||
$('#lp_bnhq_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_bnhq_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_bnhq(true)
|
||||
}
|
||||
});
|
||||
$('#lp_bnhq_papelImpresion').focus("focus", set_lp_bnhq_papelImpresion);
|
||||
$('#lp_bnhq_maquina').bind("focus", set_lp_bnhq_maquina);
|
||||
$('#lp_bnhq_maquina').bind("change", change_lp_bnhq_maquina);
|
||||
@ -2526,7 +2608,20 @@ function eventos_lp_bnhq(isInkjet = false){
|
||||
/***********************
|
||||
* Funciones LP COLORHQ
|
||||
************************/
|
||||
async function set_lp_colorhq_gramaje(){
|
||||
function change_papelGenerico_lp_colorhq(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_colorhq_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_colorhq(true)
|
||||
set_lp_colorhq_gramaje()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_colorhq_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_colorhq_gramaje option:selected').text()
|
||||
$('#lp_colorhq_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
@ -2540,7 +2635,7 @@ async function set_lp_colorhq_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_colorhq(true)
|
||||
$('#lp_colorhq_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -2550,14 +2645,19 @@ async function set_lp_colorhq_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_colorhq_gramaje').append(option);
|
||||
});
|
||||
$('#lp_colorhq_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
$('#lp_colorhq_gramaje option').filter(function() {
|
||||
return $(this).html() == previous;
|
||||
}).prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_colorhq_gramaje').val('')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function set_lp_colorhq_papelImpresion(){
|
||||
|
||||
var datos = {
|
||||
@ -2854,8 +2954,15 @@ function fill_lp_colorhq(row, fromComparator=false){
|
||||
|
||||
function eventos_lp_colorhq(isInkjet = false){
|
||||
|
||||
$('#lp_colorhq_papel').bind("focus", {clear_selectors: true}, clear_lp_colorhq);
|
||||
$('#lp_colorhq_gramaje').bind("focus", set_lp_colorhq_gramaje);
|
||||
$('#lp_colorhq_papel').bind("change", change_papelGenerico_lp_colorhq);
|
||||
$('#lp_colorhq_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_colorhq_gramaje);
|
||||
$('#lp_colorhq_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_colorhq_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_colorhq(true)
|
||||
}
|
||||
});
|
||||
$('#lp_colorhq_papelImpresion').focus("focus", set_lp_colorhq_papelImpresion);
|
||||
$('#lp_colorhq_maquina').bind("focus", set_lp_colorhq_maquina);
|
||||
$('#lp_colorhq_maquina').bind("change", change_lp_colorhq_maquina);
|
||||
@ -2874,7 +2981,18 @@ function eventos_lp_colorhq(isInkjet = false){
|
||||
/***********************
|
||||
* Funciones LP ROT_BN
|
||||
************************/
|
||||
async function set_lp_rot_bn_gramaje(){
|
||||
function change_papelGenerico_lp_rot_bn(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_rot_bn_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_rot_bn(true)
|
||||
set_lp_rot_bn_gramaje()
|
||||
}
|
||||
}
|
||||
async function set_lp_rot_bn_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_rot_bn_gramaje option:selected').text()
|
||||
$('#lp_rot_bn_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
@ -2888,7 +3006,7 @@ async function set_lp_rot_bn_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_rot_bn(true)
|
||||
$('#lp_rot_bn_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -2898,7 +3016,13 @@ async function set_lp_rot_bn_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_rot_bn_gramaje').append(option);
|
||||
});
|
||||
$('#lp_rot_bn_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
const option = $("select#lp_rot_bn_gramaje option:equal('" + previous + "')");
|
||||
option.prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_rot_bn_gramaje').val('')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -3203,8 +3327,15 @@ function fill_lp_rot_bn(row, fromComparador=false){
|
||||
}
|
||||
|
||||
function eventos_lp_rot_bn(){
|
||||
$('#lp_rot_bn_papel').bind("focus", {clear_selectors: true}, clear_lp_rot_bn);
|
||||
$('#lp_rot_bn_gramaje').bind("focus", set_lp_rot_bn_gramaje);
|
||||
$('#lp_rot_bn_papel').bind("change", change_papelGenerico_lp_rot_bn);
|
||||
$('#lp_rot_bn_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_rot_bn_gramaje);
|
||||
$('#lp_rot_bn_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_rot_bn_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_rot_bn(true)
|
||||
}
|
||||
});
|
||||
$('#lp_rot_bn_papelImpresion').focus("focus", set_lp_rot_bn_papelImpresion);
|
||||
$('#lp_rot_bn_maquina').bind("focus", set_lp_rot_bn_maquina);
|
||||
$('#lp_rot_bn_maquina').bind("change", change_lp_rot_bn_maquina);
|
||||
@ -3220,7 +3351,20 @@ function eventos_lp_rot_bn(){
|
||||
/***********************
|
||||
* Funciones LP ROT_COLOR
|
||||
************************/
|
||||
async function set_lp_rot_color_gramaje(){
|
||||
function change_papelGenerico_lp_rot_color(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_rot_color_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_rot_color(true)
|
||||
set_lp_rot_color_gramaje()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_rot_color_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_rot_color_gramaje option:selected').text()
|
||||
$('#lp_rot_color_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
@ -3234,7 +3378,7 @@ async function set_lp_rot_color_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_rot_color(true)
|
||||
$('#lp_rot_color_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -3244,7 +3388,13 @@ async function set_lp_rot_color_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_rot_color_gramaje').append(option);
|
||||
});
|
||||
$('#lp_rot_color_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
const option = $("select#lp_rot_color_gramaje option:equal('" + previous + "')");
|
||||
option.prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_rot_color_gramaje').val('')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -3554,8 +3704,15 @@ function fill_lp_rot_color(row, fromComparador=false){
|
||||
}
|
||||
|
||||
function eventos_lp_rot_color(){
|
||||
$('#lp_rot_color_papel').bind("focus", {clear_selectors: true}, clear_lp_rot_color);
|
||||
$('#lp_rot_color_gramaje').bind("focus", set_lp_rot_color_gramaje);
|
||||
$('#lp_rot_color_papel').bind("change", change_papelGenerico_lp_rot_color);
|
||||
$('#lp_rot_color_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_rot_color_gramaje);
|
||||
$('#lp_rot_color_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_rot_color_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_rot_color(true)
|
||||
}
|
||||
});
|
||||
$('#lp_rot_color_papelImpresion').focus("focus", set_lp_rot_color_papelImpresion);
|
||||
$('#lp_rot_color_maquina').bind("focus", set_lp_rot_color_maquina);
|
||||
$('#lp_rot_color_maquina').bind("change", change_lp_rot_color_maquina);
|
||||
@ -3571,7 +3728,20 @@ function eventos_lp_rot_color(){
|
||||
/***********************
|
||||
* Funciones LP CUBIERTA
|
||||
************************/
|
||||
async function set_lp_cubierta_gramaje(){
|
||||
function change_papelGenerico_lp_cubierta(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_cubierta_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_cubierta(true)
|
||||
set_lp_cubierta_gramaje()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_cubierta_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_cubierta_gramaje option:selected').text()
|
||||
$('#lp_cubierta_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
@ -3585,7 +3755,7 @@ async function set_lp_cubierta_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_cubierta(true)
|
||||
$('#lp_cubierta_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -3595,7 +3765,14 @@ async function set_lp_cubierta_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_cubierta_gramaje').append(option);
|
||||
});
|
||||
$('#lp_cubierta_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
$('#lp_cubierta_gramaje option').filter(function() {
|
||||
return $(this).html() == previous;
|
||||
}).prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_cubierta_gramaje').val('')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -3836,8 +4013,15 @@ function fill_lp_cubierta(row, fromComparador=false){
|
||||
|
||||
function eventos_lp_cubierta(){
|
||||
|
||||
$('#lp_cubierta_papel').bind("focus", {clear_selectors: true}, clear_lp_cubierta);
|
||||
$('#lp_cubierta_gramaje').bind("focus", set_lp_cubierta_gramaje);
|
||||
$('#lp_cubierta_papel').bind("change", change_papelGenerico_lp_cubierta);
|
||||
$('#lp_cubierta_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_cubierta_gramaje);
|
||||
$('#lp_cubierta_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_cubierta_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_cubierta(true)
|
||||
}
|
||||
});
|
||||
$('#lp_cubierta_papelImpresion').focus("focus", set_lp_cubierta_papelImpresion);
|
||||
$('#lp_cubierta_maquina').bind("focus", set_lp_cubierta_maquina);
|
||||
$('#lp_cubierta_maquina').bind("change", change_lp_cubierta_maquina);
|
||||
@ -3857,7 +4041,20 @@ function check_update_cubierta(){
|
||||
/***********************
|
||||
* Funciones LP SOBRECUBIERTA
|
||||
************************/
|
||||
async function set_lp_sobrecubierta_gramaje(){
|
||||
function change_papelGenerico_lp_sobrecubierta(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_sobrecubierta_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_sobrecubierta(true)
|
||||
set_lp_sobrecubierta_gramaje()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_sobrecubierta_gramaje(mantenerSeleccion = false){
|
||||
|
||||
var previous = $('#lp_sobrecubierta_gramaje option:selected').text()
|
||||
$('#lp_sobrecubierta_gramaje').data('val', previous);
|
||||
|
||||
var datos = {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
@ -3871,7 +4068,7 @@ async function set_lp_sobrecubierta_gramaje(){
|
||||
type: 'post',
|
||||
url: window.routes_lp.menuItemsOfCosidotapablanda,
|
||||
beforeSend: function() {
|
||||
clear_lp_sobrecubierta(true)
|
||||
$('#lp_sobrecubierta_gramaje').empty()
|
||||
},
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
@ -3881,7 +4078,14 @@ async function set_lp_sobrecubierta_gramaje(){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_sobrecubierta_gramaje').append(option);
|
||||
});
|
||||
$('#lp_sobrecubierta_gramaje').val('')
|
||||
if(mantenerSeleccion){
|
||||
$('#lp_sobrecubierta_gramaje option').filter(function() {
|
||||
return $(this).html() == previous;
|
||||
}).prop('selected', true);
|
||||
}
|
||||
else{
|
||||
$('#lp_sobrecubierta_gramaje').val('')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -4108,8 +4312,15 @@ function fill_lp_sobrecubierta(row, fromComparador=false){
|
||||
|
||||
function eventos_lp_sobrecubierta(){
|
||||
|
||||
$('#lp_sobrecubierta_papel').bind("focus", {clear_selectors: true}, clear_lp_sobrecubierta);
|
||||
$('#lp_sobrecubierta_gramaje').bind("focus", set_lp_sobrecubierta_gramaje);
|
||||
$('#lp_sobrecubierta_papel').bind("change", change_papelGenerico_lp_sobrecubierta);
|
||||
$('#lp_sobrecubierta_gramaje').bind("focus", {mantenerSeleccion: true}, set_lp_sobrecubierta_gramaje);
|
||||
$('#lp_sobrecubierta_gramaje').on('change', function(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_sobrecubierta_gramaje option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_sobrecubierta(true)
|
||||
}
|
||||
});
|
||||
$('#lp_sobrecubierta_papelImpresion').focus("focus", set_lp_sobrecubierta_papelImpresion);
|
||||
$('#lp_sobrecubierta_maquina').bind("focus", set_lp_sobrecubierta_maquina);
|
||||
$('#lp_sobrecubierta_maquina').bind("change", change_lp_sobrecubierta_maquina);
|
||||
@ -4162,6 +4373,14 @@ function getLomoCubiertaLineasPresupuesto(){
|
||||
/***********************
|
||||
* Funciones LP GUARDAS
|
||||
************************/
|
||||
function change_papelGenerico_lp_guardas(){
|
||||
var previous = $(this).data('val');
|
||||
const selected = $("select#lp_guardas_papel option:selected");
|
||||
if(selected.text() != previous){
|
||||
clear_lp_guardas(true)
|
||||
}
|
||||
}
|
||||
|
||||
function clear_lp_guardas(clear_selectors){
|
||||
let pags = $("#lp_guardas_paginas option:selected" ).val()
|
||||
$(".lp-guardas-input" ).val("0")
|
||||
@ -4315,7 +4534,7 @@ function fill_lp_guardas(row, fromComparador=false){
|
||||
|
||||
function eventos_lp_guardas(isInkjet = false){
|
||||
|
||||
$('#lp_guardas_papel').bind("focus", {clear_selectors: true}, clear_lp_guardas);
|
||||
$('#lp_guardas_papel').bind("change", change_papelGenerico_lp_guardas);
|
||||
$('#lp_guardas_papelImpresion').focus("focus", set_lp_guardas_papelImpresion);
|
||||
$('#lp_guardas_maquina').bind("focus", set_lp_guardas_maquina);
|
||||
$('#lp_guardas_maquina').bind("change", calcularPresupuesto_guardas);
|
||||
|
||||
@ -61,6 +61,7 @@ $('#add_tirada_alt').on('click', function () {
|
||||
|
||||
const tirada_alt = parseInt($('#tirada_alt').val());
|
||||
add_tirada_alternativa(tirada_alt);
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
|
||||
@ -274,6 +275,7 @@ $(document).on('click', '.btn-delete-tirada', function (e) {
|
||||
tableTiradas.row(row)
|
||||
.remove()
|
||||
.draw();
|
||||
showBreadCrumbSaveButton(true);
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -214,65 +214,49 @@
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
// Obtener todos los campos de entrada del formulario
|
||||
const formInputs = document.querySelectorAll('input, textarea, select');
|
||||
$(window).on('load', function() {
|
||||
|
||||
//console.log(formInputs)
|
||||
|
||||
// Crear un objeto para almacenar los valores originales
|
||||
const originalValues = {};
|
||||
|
||||
// Guardar los valores originales
|
||||
formInputs.forEach(function(input) {
|
||||
if (input.type === 'checkbox') {
|
||||
originalValues[input.id] = input.checked;
|
||||
} else {
|
||||
originalValues[input.id] = input.tagName.toLowerCase() === 'select'
|
||||
? $(input).val() // jQuery para obtener el valor de un select2
|
||||
: input.value;
|
||||
}
|
||||
// Detectar cambios en inputs de texto
|
||||
$('input[type="text"]').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
|
||||
// Agregar un evento de cambio a cada campo de entrada
|
||||
formInputs.forEach(function(input) {
|
||||
if (input.tagName.toLowerCase() === 'select' && $(input).data('select2')) {
|
||||
// Para elementos select2
|
||||
$(input).on('change', function() {
|
||||
verificarCambios();
|
||||
});
|
||||
} else {
|
||||
// Para otros tipos de campos
|
||||
input.addEventListener('input', function() {
|
||||
verificarCambios();
|
||||
});
|
||||
}
|
||||
// Detectar cambios en inputs de texto
|
||||
$('input[type="number"]').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
function verificarCambios() {
|
||||
// Verificar si hay cambios con respecto a los originales
|
||||
var cambiosDetectados = Array.from(formInputs).some(function(input) {
|
||||
return input.type === 'checkbox'
|
||||
? input.checked !== originalValues[input.id]
|
||||
: input.tagName.toLowerCase() === 'select'
|
||||
? $(input).val() !== originalValues[input.id]
|
||||
: input.value !== originalValues[input.id];
|
||||
});
|
||||
// Detectar cambios en select
|
||||
$('select').change(function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Mostrar alerta solo si hay cambios
|
||||
if (cambiosDetectados) {
|
||||
showBreadCrumbSaveButton(true);
|
||||
}else{
|
||||
showBreadCrumbSaveButton(false);
|
||||
}
|
||||
}
|
||||
// Detectar cambios en checkboxes
|
||||
$('input[type="checkbox"]').change(function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
$('#bc-save').on( "click", function() {
|
||||
showBreadCrumbSaveButton(false);
|
||||
$('#saveForm').click()
|
||||
} );
|
||||
// Detectar cambios en textareas
|
||||
$('textarea').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en otros tipos de input
|
||||
$('input[type="radio"]').change(function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en otros tipos de input
|
||||
$('input:not([type])').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#bc-save').on( "click", function() {
|
||||
showBreadCrumbSaveButton(false);
|
||||
$('#saveForm').click()
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
@ -7,21 +7,7 @@
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control" value="<?=old('nombre', $tarifaEncuadernacionEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifaencuadernacion.precioMin') ?>*
|
||||
</label>
|
||||
<input type="text" id="precio_min" name="precio_min" class="form-control" value="<?=old('precio_min', $tarifaEncuadernacionEntity->precio_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Tarifaencuadernacion.importeFijo') ?>*
|
||||
</label>
|
||||
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaEncuadernacionEntity->importe_fijo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
</div><!--//.col -->
|
||||
</div><!-- //.row -->
|
||||
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
<th><?= lang('TarifaEncuadernacionTiradas.proveedor') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionTiradas.tiradaMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionTiradas.tiradaMax') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -78,9 +80,9 @@
|
||||
<th>ID</th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.dimensiones') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.margen') ?></th>
|
||||
<th style="min-width:100px"></th>
|
||||
</tr>
|
||||
@ -470,11 +472,11 @@
|
||||
{
|
||||
name: "paginas_libro_min"
|
||||
}, {
|
||||
name: "precio_max"
|
||||
name: "precio_min"
|
||||
}, {
|
||||
name: "paginas_libro_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
name: "precio_max"
|
||||
}, {
|
||||
name: "margen"
|
||||
}, {
|
||||
@ -659,6 +661,10 @@
|
||||
name: "tirada_min"
|
||||
}, {
|
||||
name: "tirada_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
}, {
|
||||
name: "importe_fijo"
|
||||
}, {
|
||||
"name": "tarifa_encuadernacion_id",
|
||||
"type": "hidden"
|
||||
@ -740,6 +746,8 @@
|
||||
},
|
||||
{ 'data': 'tirada_min' },
|
||||
{ 'data': 'tirada_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
|
||||
@ -17,8 +17,6 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.tipo_encuadernacion') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.servicio_encuadernacion') ?></th>
|
||||
@ -90,8 +88,6 @@
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': 'mostrar_en_presupuesto' },
|
||||
{ 'data': 'tipo_encuadernacion' },
|
||||
{ 'data': 'servicio_encuadernacion' },
|
||||
@ -100,7 +96,7 @@
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [3,4,5];
|
||||
const boolCols = [1,2,3];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
|
||||
@ -139,6 +139,19 @@ if (!empty($token) && $tfa == false) {
|
||||
</li>
|
||||
<!--/ Notification -->
|
||||
|
||||
<!-- Search Budgets -->
|
||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
||||
<a
|
||||
class="nav-link hide-arrow"
|
||||
href="<?= site_url('presupuestos/buscador'); ?>"
|
||||
title="Acceso directo a buscador de presupuestos"
|
||||
>
|
||||
<i class="ti ti-report-search ti-md"></i>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<!--/ Search Budgets -->
|
||||
|
||||
<!-- View Mode links -->
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
<a
|
||||
|
||||
@ -372,6 +372,19 @@ if (!empty($token) && $tfa == false) {
|
||||
</li>
|
||||
<!--/ Notification -->
|
||||
|
||||
<!-- Search Budgets -->
|
||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
||||
<a
|
||||
class="nav-link hide-arrow"
|
||||
href="<?= site_url('presupuestos/buscador'); ?>"
|
||||
title="Acceso directo a buscador de presupuestos"
|
||||
>
|
||||
<i class="ti ti-report-search ti-md"></i>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<!--/ Search Budgets -->
|
||||
|
||||
<!-- View Mode links -->
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
<a
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
<?= $this->section('globalJsFunctions') ?>
|
||||
|
||||
function showBreadCrumbSaveButton(showIt = false){
|
||||
if(showIt === true){
|
||||
|
||||
@ -134,6 +134,19 @@ if (!empty($token) && $tfa == false) {
|
||||
</li>
|
||||
<!--/ Notification -->
|
||||
|
||||
<!-- Search Budgets -->
|
||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
||||
<a
|
||||
class="nav-link hide-arrow"
|
||||
href="<?= site_url('presupuestos/buscador'); ?>"
|
||||
title="Acceso directo a buscador de presupuestos"
|
||||
>
|
||||
<i class="ti ti-report-search ti-md"></i>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<!--/ Search Budgets -->
|
||||
|
||||
<!-- View Mode links -->
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
<a
|
||||
@ -346,6 +359,7 @@ if (isset($global_js_variables)) {
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
<?= $this->renderSection('globalJsFunctions') ?>
|
||||
|
||||
var theTable;
|
||||
var <?=csrf_token() ?? 'token'?>v = '<?= csrf_hash() ?>';
|
||||
|
||||
@ -139,6 +139,19 @@ if (!empty($token) && $tfa == false) {
|
||||
</li>
|
||||
<!--/ Notification -->
|
||||
|
||||
<!-- Search Budgets -->
|
||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
||||
<a
|
||||
class="nav-link hide-arrow"
|
||||
href="<?= site_url('presupuestos/buscador'); ?>"
|
||||
title="Acceso directo a buscador de presupuestos"
|
||||
>
|
||||
<i class="ti ti-report-search ti-md"></i>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<!--/ Search Budgets -->
|
||||
|
||||
<!-- View Mode links -->
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
<a
|
||||
|
||||
@ -140,6 +140,19 @@ if (!empty($token) && $tfa == false) {
|
||||
</li>
|
||||
<!--/ Notification -->
|
||||
|
||||
<!-- Search Budgets -->
|
||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
||||
<a
|
||||
class="nav-link hide-arrow"
|
||||
href="<?= site_url('presupuestos/buscador'); ?>"
|
||||
title="Acceso directo a buscador de presupuestos"
|
||||
>
|
||||
<i class="ti ti-report-search ti-md"></i>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<!--/ Search Budgets -->
|
||||
|
||||
<!-- View Mode links -->
|
||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||
<a
|
||||
|
||||
Reference in New Issue
Block a user