mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminadas modificaciones albaranes
This commit is contained in:
@ -457,7 +457,7 @@ function generarAlbaran(item){
|
|||||||
let rowIndex = table.row(row).index(); // Obtiene el índice de la fila
|
let rowIndex = table.row(row).index(); // Obtiene el índice de la fila
|
||||||
|
|
||||||
const previousValue = table.cell(rowIndex, 2).data();
|
const previousValue = table.cell(rowIndex, 2).data();
|
||||||
const newValue = $(this).val(); // Obtiene el nuevo valor del input
|
const newValue = parseInt($(this).val()); // Obtiene el nuevo valor del input
|
||||||
|
|
||||||
let cantidad = calcular_cantidad_albaranes();
|
let cantidad = calcular_cantidad_albaranes();
|
||||||
|
|
||||||
@ -580,20 +580,16 @@ $(document).on('change', '.albaran_linea', function(){
|
|||||||
};
|
};
|
||||||
data[elementId.split('_').slice(0, -1).join('_')] = $(this).val();
|
data[elementId.split('_').slice(0, -1).join('_')] = $(this).val();
|
||||||
|
|
||||||
if(elementId.includes('cajas')){
|
|
||||||
var cajas = $(this).val();
|
|
||||||
var linea_id = elementId.split('_').slice(-1)[0];
|
|
||||||
var table = $('#tablaAlbaran' + $(this).attr('albaran')).DataTable();
|
|
||||||
var row = table.row($(this).closest('tr')).index();
|
|
||||||
var cantidad = table.cell(row, 2).data();
|
|
||||||
table.cell(row, 7).data(parseInt(cantidad/cajas));
|
|
||||||
data['ejemplares_por_caja'] = parseInt(cantidad/cajas);
|
|
||||||
}
|
|
||||||
|
|
||||||
var linea_id = $(this).attr('linea');
|
var linea_id = $(this).attr('linea');
|
||||||
var url = '<?= route_to('actualizarLineaAlbaran', ':id') ?>';
|
var url = '<?= route_to('actualizarLineaAlbaran', ':id') ?>';
|
||||||
url = url.replace(':id', linea_id );
|
url = url.replace(':id', linea_id );
|
||||||
|
|
||||||
|
if(elementId.includes('cajas')){
|
||||||
|
var cajas = $(this).val();
|
||||||
|
var linea_id = elementId.split('_').slice(-1)[0];
|
||||||
|
$('#ejemplares_por_caja_' + linea_id).val(parseInt($('#cantidad_' + linea_id).val()/cajas)).trigger('change');
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@ -601,7 +597,7 @@ $(document).on('change', '.albaran_linea', function(){
|
|||||||
success: function(response){
|
success: function(response){
|
||||||
|
|
||||||
if('error' in response){
|
if('error' in response){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -637,6 +633,7 @@ function borrar_albaranes(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cambios_cantidad_albaranes();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -657,6 +654,7 @@ function borrar_albaran(albaran_id){
|
|||||||
$('#accordioAlbaran' + albaran_id).remove();
|
$('#accordioAlbaran' + albaran_id).remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cambios_cantidad_albaranes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user