mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
recuperados cambios de rama antigua
This commit is contained in:
@ -718,13 +718,6 @@ $(document).on('click', '.btn-remove', function(e) {
|
||||
}
|
||||
});
|
||||
|
||||
// funcion para obtener el cliente id de la url
|
||||
function getId(){
|
||||
var url = window.location.href;
|
||||
var parts = url.split("/");
|
||||
return parts[parts.length-1];
|
||||
}
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -775,11 +768,11 @@ function getId(){
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['cliente_id'] = getId();
|
||||
d.data[0]['cliente_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['cliente_id'] = getId();
|
||||
d.data[v]['cliente_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -855,7 +848,7 @@ function getId(){
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfClienteContactos') ?>',
|
||||
data: {
|
||||
id_cliente: getId(),
|
||||
id_cliente: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
@ -1019,11 +1012,11 @@ function getId(){
|
||||
|
||||
editorPrecios.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['cliente_id'] = getId();
|
||||
d.data[0]['cliente_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['cliente_id'] = getId();
|
||||
d.data[v]['cliente_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1083,7 +1076,7 @@ function getId(){
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfClienteprecios') ?>',
|
||||
data: {
|
||||
cliente_id: getId(),
|
||||
cliente_id: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
@ -1373,7 +1366,7 @@ var tableDirecciones = $('#tableOfDireccionesEnvio').DataTable( {
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfClienteDirecciones') ?>',
|
||||
data: function ( d ) {
|
||||
d.cliente_id = getId();
|
||||
d.cliente_id = id;
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
@ -1468,7 +1461,7 @@ function delete_direccion_envio(dataId){
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.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/vendor/libs/datatables-bs5/datatables.bootstrap5.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-bs5/dataTables.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
|
||||
@ -121,11 +121,6 @@ $('#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(
|
||||
@ -212,26 +207,6 @@ 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;
|
||||
|
||||
@ -39,41 +39,6 @@ $('#paginas').on("change", function () {
|
||||
});
|
||||
|
||||
|
||||
$('.solapas_cubierta').on('change', function(){
|
||||
|
||||
const ancho_libro = getDimensionLibro().ancho;
|
||||
|
||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||
// solapas <= ancho_libro - 10
|
||||
const limite_2 = ancho_libro - 10;
|
||||
const limite = Math.min(limite_1, limite_2);
|
||||
|
||||
if(parseInt($('#solapas_ancho').val()) > limite){
|
||||
$('#solapas_ancho').val(limite)
|
||||
}
|
||||
|
||||
$('#compGramajeCubierta').trigger('change')
|
||||
})
|
||||
|
||||
|
||||
$('.solapas_sobrecubierta').on('change', function(){
|
||||
|
||||
const ancho_libro = getDimensionLibro().ancho;
|
||||
|
||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||
// solapas <= ancho_libro - 10
|
||||
const limite_2 = ancho_libro - 10;
|
||||
const limite = Math.min(limite_1, limite_2);
|
||||
|
||||
if(parseInt($('#solapas_ancho_sobrecubierta').val()) > limite){
|
||||
$('#solapas_ancho_sobrecubierta').val(limite)
|
||||
}
|
||||
|
||||
$('#compGramajeSobrecubierta').trigger('change')
|
||||
})
|
||||
|
||||
$('#tirada').on("change", function (update_tiradas_alternativas = true) {
|
||||
|
||||
calcular_mermas()
|
||||
|
||||
@ -489,6 +489,7 @@ var tableServiciosEnc = new DataTable('#tableOfServiciosEncuadernacion',{
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
tableServiciosEnc.on('draw', function(){
|
||||
@ -523,6 +524,7 @@ function init_servicio_encuadernado(){
|
||||
'</option>' +
|
||||
'</select>',
|
||||
'<span id="precio_unidad_encuadernado_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
|
||||
'<span id="tiempo_encuadernado_' + element.tiempo + '">' + convertirTiempo(element.tiempo) + '</span>',
|
||||
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + element.tarifa_encuadernado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="enc_margen_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.margen).toFixed(2) + '</span>',
|
||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + element.tarifa_encuadernado_id +'"></i></a>'
|
||||
@ -584,6 +586,21 @@ function init_servicio_encuadernado(){
|
||||
|
||||
}
|
||||
|
||||
function convertirTiempo(horas){
|
||||
if(horas != null){
|
||||
|
||||
const seconds = parseFloat(horas) * 3600;
|
||||
// se convierte a formato hh:mm:ss
|
||||
const h = Math.floor(seconds / 3600);
|
||||
const minutos = Math.floor((seconds % 3600) / 60);
|
||||
const segundos = seconds % 60;
|
||||
return h + ':' + minutos + ':' + segundos;
|
||||
}
|
||||
else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
function proveedor_enc_event(){
|
||||
const dimension = getDimensionLibro();
|
||||
if(parseInt($('#tirada').val())>0){
|
||||
@ -611,6 +628,7 @@ function proveedor_enc_event(){
|
||||
success: function (data) {
|
||||
|
||||
$('#precio_unidad_encuadernado_' + datos.tarifa_encuadernacion_id).text(parseFloat(data.values[0].precio_unidad).toFixed(2))
|
||||
$('#tiempo_encuadernado_' + datos.tarifa_encuadernacion_id).text(convertirTiempo(data.values[0].tiempo))
|
||||
$('#precio_total_encuadernado_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].total).toFixed(2))
|
||||
$('#enc_margen_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].margen).toFixed(2))
|
||||
|
||||
@ -694,6 +712,7 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
|
||||
'</option>' +
|
||||
'</select>',
|
||||
'<span id="precio_unidad_encuadernado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
|
||||
'<span id="tiempo_encuadernado_' + row.tiempo + '">' + convertirTiempo(row.tiempo) + '</span>',
|
||||
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="enc_margen_' + row.tarifa_id + '">' + parseFloat(row.margen).toFixed(2) + '</span>',
|
||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + row.tarifa_id +'"></i></a>'
|
||||
@ -796,9 +815,15 @@ function get_datos_encuadernacion(){
|
||||
values['precio_unidad'] = $(this).text()
|
||||
break
|
||||
case 4:
|
||||
values['precio_total'] = $(this).children(":first").val()
|
||||
values['tiempo'] = $(this).text()
|
||||
// se pasa el string hh:mm:ss a horas
|
||||
if(values['tiempo'] != null)
|
||||
values['tiempo'] = parseInt(values['tiempo'].split(':')[0]) + parseInt(values['tiempo'].split(':')[1])/60 + parseInt(values['tiempo'].split(':')[2])/3600
|
||||
break
|
||||
case 5:
|
||||
values['precio_total'] = $(this).children(":first").val()
|
||||
break
|
||||
case 6:
|
||||
values['margen'] = $(this).text()
|
||||
break
|
||||
}
|
||||
|
||||
@ -167,6 +167,7 @@
|
||||
<th><?= lang('Presupuestos.tarifa') ?></th>
|
||||
<th><?= lang('Proveedores.proveedor') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.tiempo') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
@ -311,5 +312,48 @@
|
||||
init_servicio_preimpresion()
|
||||
|
||||
init_servicio_extra()
|
||||
|
||||
$('.solapas_cubierta').on('change', function(){
|
||||
|
||||
const ancho_libro = getDimensionLibro().ancho;
|
||||
|
||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||
// solapas <= ancho_libro - 10
|
||||
const limite_2 = ancho_libro - 10;
|
||||
const limite = Math.min(limite_1, limite_2);
|
||||
|
||||
if(parseInt($('#solapas_ancho').val()) > limite){
|
||||
$('#solapas_ancho').val(limite)
|
||||
asyncMessageDialog(
|
||||
window.Presupuestos.advertencia,
|
||||
window.Presupuestos.actualizacionSolapasCubierta,
|
||||
function(){});
|
||||
}
|
||||
|
||||
$('#compGramajeCubierta').trigger('change')
|
||||
})
|
||||
|
||||
|
||||
$('.solapas_sobrecubierta').on('change', function(){
|
||||
|
||||
const ancho_libro = getDimensionLibro().ancho;
|
||||
|
||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||
// solapas <= ancho_libro - 10
|
||||
const limite_2 = ancho_libro - 10;
|
||||
const limite = Math.min(limite_1, limite_2);
|
||||
|
||||
if(parseInt($('#solapas_ancho_sobrecubierta').val()) > limite){
|
||||
$('#solapas_ancho_sobrecubierta').val(limite)
|
||||
asyncMessageDialog(
|
||||
window.Presupuestos.advertencia,
|
||||
window.Presupuestos.actualizacionSolapasSobrecubierta,
|
||||
function(){});
|
||||
}
|
||||
|
||||
$('#compGramajeSobrecubierta').trigger('change')
|
||||
})
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -134,19 +134,6 @@ 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,19 +140,6 @@ 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