Arreglados bugs de warning numero de paginas

This commit is contained in:
imnavajas
2024-01-08 09:17:54 +01:00
parent a05c717c9f
commit f85dfc1cfc
2 changed files with 24 additions and 21 deletions

View File

@ -364,7 +364,7 @@ const actionBtns_lp = function(data) {
`; `;
}; };
window.tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{ var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
scrollX: true, scrollX: true,
searching: false, searching: false,
paging: false, paging: false,
@ -3285,27 +3285,29 @@ async function fill_bbdd_from_lp(presupuesto_id){
data.push(linea_data) data.push(linea_data)
} ); } );
if(data.lengh > 0){
await $.ajax({ await $.ajax({
type: 'post', type: 'post',
url: '<?= route_to("updateDataOfCosidotapablanda") ?>', url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
data: { data: {
tipo: 'lineasPresupuesto', tipo: 'lineasPresupuesto',
datos: data, datos: data,
presupuesto_id: presupuesto_id, presupuesto_id: presupuesto_id,
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v <?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
}, },
dataType: 'json', dataType: 'json',
success:function(response){ success:function(response){
token=response.<?= csrf_token() ?>; token=response.<?= csrf_token() ?>;
yeniden(token); yeniden(token);
} }
}).fail(function (jqXHR, textStatus, error) { }).fail(function (jqXHR, textStatus, error) {
// Handle error here // Handle error here
console.log(jqXHR) console.log(jqXHR)
}); });
}
} }
function updateLineasPresupuesto(){ function updateLineasPresupuesto(){
@ -3344,6 +3346,7 @@ function checkPaginasPresupuesto(){
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) { tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
var rowData = this.data(); var rowData = this.data();
if((rowData.row_id != 'lp_cubierta') && (rowData.row_id != 'lp_sobrecubierta'))
cantidad_total += rowData.paginas cantidad_total += rowData.paginas
}) })

View File

@ -463,7 +463,7 @@ function getObjetoLP(lpName) {
function getVisibleTabs() { function getVisibleTabs() {
window.tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) { $('#tableLineasPresupuesto').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
var rowData = this.data(); var rowData = this.data();
console.log(rowData.row_id); console.log(rowData.row_id);
$("#tab-pv-bn").show(); $("#tab-pv-bn").show();