From f85dfc1cfc7f6547bf38e3acf6cb23432aa7f5f2 Mon Sep 17 00:00:00 2001 From: imnavajas Date: Mon, 8 Jan 2024 09:17:54 +0100 Subject: [PATCH] Arreglados bugs de warning numero de paginas --- .../_lineasPresupuestoItems.php | 43 ++++++++++--------- .../presupuestos/cosidotapablanda/previews.js | 2 +- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php index 2036534a..b27764df 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php @@ -364,7 +364,7 @@ const actionBtns_lp = function(data) { `; }; - window.tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{ + var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{ scrollX: true, searching: false, paging: false, @@ -3285,27 +3285,29 @@ async function fill_bbdd_from_lp(presupuesto_id){ data.push(linea_data) } ); - - await $.ajax({ - type: 'post', - url: '', + if(data.lengh > 0){ - data: { - tipo: 'lineasPresupuesto', - datos: data, - presupuesto_id: presupuesto_id, - : v - }, - dataType: 'json', - success:function(response){ + await $.ajax({ + type: 'post', + url: '', - token=response.; - yeniden(token); - } - }).fail(function (jqXHR, textStatus, error) { - // Handle error here - console.log(jqXHR) - }); + data: { + tipo: 'lineasPresupuesto', + datos: data, + presupuesto_id: presupuesto_id, + : v + }, + dataType: 'json', + success:function(response){ + + token=response.; + yeniden(token); + } + }).fail(function (jqXHR, textStatus, error) { + // Handle error here + console.log(jqXHR) + }); + } } function updateLineasPresupuesto(){ @@ -3344,6 +3346,7 @@ function checkPaginasPresupuesto(){ tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) { var rowData = this.data(); + if((rowData.row_id != 'lp_cubierta') && (rowData.row_id != 'lp_sobrecubierta')) cantidad_total += rowData.paginas }) diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js index dec08b47..e1174633 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js @@ -463,7 +463,7 @@ function getObjetoLP(lpName) { function getVisibleTabs() { - window.tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) { + $('#tableLineasPresupuesto').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) { var rowData = this.data(); console.log(rowData.row_id); $("#tab-pv-bn").show();