alsmanager_lib 3.0.134 → 3.0.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/modules.js +23 -20
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2822,14 +2822,15 @@ function queryOSByFilter(tipo, date_ref) {
2822
2822
  var query = "select distinct dt.os as os from devices d ";
2823
2823
  query += "left join device_pc dt on d.id = dt.id_device ";
2824
2824
  query += "where d.type = '" + tipo + "' ";
2825
- query += "order dt.os";
2825
+ query += "and dt.os is not null ";
2826
+ query += "order by dt.os";
2826
2827
  return query;
2827
2828
  }
2828
2829
 
2829
2830
  function queryOSVersionByFilter(os) {
2830
2831
  var query = "select distinct dt.os_version as version from device_pc dt ";
2831
2832
  query += "where dt.os = '" + os + "' ";
2832
- query += "order dt.os_version";
2833
+ query += "order by dt.os_version";
2833
2834
  return query;
2834
2835
  }
2835
2836
 
@@ -4507,7 +4508,7 @@ function getDevicesWithProperties(db_used, id_device) {
4507
4508
  function getBeniDaInventariSQLite(table_name, inv_code, include_imp, is_pnrr, is_dismissione) {
4508
4509
  var query = "";
4509
4510
  if (table_name && table_name != '') {
4510
- if (table_name == "ImportRevisione2024") {
4511
+ if (table_name.startsWith("ImportRevisione")) {
4511
4512
  query = "Select ";
4512
4513
  query += "inv_ict3 as Inventario, ";
4513
4514
  query += "ex_inv as Precedente, ";
@@ -4583,7 +4584,7 @@ function getBeniDaInventariSQLite(table_name, inv_code, include_imp, is_pnrr, is
4583
4584
 
4584
4585
  function getBeniDaInventariMySQL(table_name, inv_code, include_imp, is_pnrr, is_dismissione) {
4585
4586
  if (table_name && table_name != '') {
4586
- if (table_name == "ImportRevisione2024") {
4587
+ if (table_name.startsWith("ImportRevisione")) {
4587
4588
  query = "Select ";
4588
4589
  query += "inv_ict3 as Inventario, ";
4589
4590
  query += "ex_inv as Precedente, ";
@@ -4678,7 +4679,7 @@ function getBeniDaInventari(db_used, table_name, inv_code, include_imp, is_pnrr,
4678
4679
  function getBeniDaInventariNonAllocatiSQLite(table_name, is_pnrr, is_dismissione) {
4679
4680
  var query = "";
4680
4681
  if (table_name && table_name != '') {
4681
- if (table_name == "ImportRevisione2024") {
4682
+ if (table_name.startsWith("ImportRevisione")) {
4682
4683
  query = "Select ";
4683
4684
  query += "inv_ict3 as Inventario, ";
4684
4685
  query += "ex_inv as Precedente, ";
@@ -4749,7 +4750,7 @@ function getBeniDaInventariNonAllocatiSQLite(table_name, is_pnrr, is_dismissione
4749
4750
  }
4750
4751
  function getBeniDaInventariNonAllocatiMySQL(table_name, is_pnrr, is_dismissione) {
4751
4752
  if (table_name && table_name != '') {
4752
- if (table_name == "ImportRevisione2024") {
4753
+ if (table_name.startsWith("ImportRevisione")) {
4753
4754
  query = "Select ";
4754
4755
  query += "inv_ict3 as Inventario, ";
4755
4756
  query += "ex_inv as Precedente, ";
@@ -4842,7 +4843,7 @@ function getBeniDaInventariNonAllocati(db_used, table_name, is_pnrr, is_dismissi
4842
4843
  function getBeniDaInventariOnDescriptionSQLite(table_name, search_string, include_imp, is_pnrr, is_dismissione) {
4843
4844
  var query = "";
4844
4845
  if (table_name && table_name != '') {
4845
- if (table_name == "ImportRevisione2024") {
4846
+ if (table_name.startsWith("ImportRevisione")) {
4846
4847
  query = "Select ";
4847
4848
  query += "inv_ict3 as Inventario, ";
4848
4849
  query += "ex_inv as Precedente, ";
@@ -4917,7 +4918,7 @@ function getBeniDaInventariOnDescriptionSQLite(table_name, search_string, includ
4917
4918
 
4918
4919
  function getBeniDaInventariOnDescriptionMySQL(table_name, search_string, include_imp, is_pnrr, is_dismissione) {
4919
4920
  if (table_name && table_name != '') {
4920
- if (table_name == "ImportRevisione2024") {
4921
+ if (table_name.startsWith("ImportRevisione")) {
4921
4922
  query = "Select ";
4922
4923
  query += "inv_ict3 as Inventario, ";
4923
4924
  query += "ex_inv as Precedente, ";
@@ -5016,7 +5017,7 @@ function getBeniDaInventariOnDescription(db_used, table_name, search_string, inc
5016
5017
  function selectInventariPerIntervalloSQLite(table_name, is_pnrr, is_dismissione, code_da, code_a) {
5017
5018
  var query = "";
5018
5019
  if (table_name && table_name != '') {
5019
- if (table_name == "ImportRevisione2024") {
5020
+ if (table_name.startsWith("ImportRevisione")) {
5020
5021
  query = "Select ";
5021
5022
  query += "inv_ict3 as Inventario, ";
5022
5023
  query += "concat(inv_ict3, ' - ', descrizione_bene, ' - ', marca, ' - ', modello_serie) as Descrizione ";
@@ -5052,7 +5053,7 @@ function selectInventariPerIntervalloSQLite(table_name, is_pnrr, is_dismissione,
5052
5053
  function selectInventariPerIntervalloMySQL() {
5053
5054
  var query = "";
5054
5055
  if (table_name && table_name != '') {
5055
- if (table_name == "ImportRevisione2024") {
5056
+ if (table_name.startsWith("ImportRevisione")) {
5056
5057
  query = "Select ";
5057
5058
  query += "inv_ict3 as Inventario, ";
5058
5059
  query += "concat(inv_ict3, ' - ', descrizione_bene, ' - ', marca, ' - ', modello_serie) as Descrizione ";
@@ -5108,7 +5109,7 @@ function selectInventariPerIntervallo(db_used,table_name, is_pnrr, is_dismission
5108
5109
  function getBeniAcquisitiSQLite(table_name, is_pnrr, is_dismissione) {
5109
5110
  var query = "";
5110
5111
  if (table_name) {
5111
- if (table_name == "ImportRevisione2024") {
5112
+ if (table_name.startsWith("ImportRevisione")) {
5112
5113
  query = "Select ";
5113
5114
  query += "inv_ict3 as Inventario, ";
5114
5115
  query += "ex_inv as Precedente, ";
@@ -5169,7 +5170,7 @@ function getBeniAcquisitiSQLite(table_name, is_pnrr, is_dismissione) {
5169
5170
  function getBeniAcquisitiMySQL(table_name, is_pnrr, is_dismissione) {
5170
5171
  var query = "";
5171
5172
  if (table_name) {
5172
- if (table_name == "ImportRevisione2024") {
5173
+ if (table_name.startsWith("ImportRevisione")) {
5173
5174
  query = "Select ";
5174
5175
  query += "inv_ict3 as Inventario, ";
5175
5176
  query += "ex_inv as Precedente, ";
@@ -5251,7 +5252,7 @@ function insertDeviceMassivoSQLite(table_name,lista_inv) {
5251
5252
  var query = "";
5252
5253
  var insert_sql = "insert into devices (inv_ict3_number, inv_tn_number, manifacturer, model, note) "
5253
5254
  if (table_name && table_name != '') {
5254
- if (inv_info.tabella == "ImportRevisione2024") {
5255
+ if (inv_info.tabella.startsWith("ImportRevisione")) {
5255
5256
  query = "Select ";
5256
5257
  query += "trim(inv_ict3) as Inventario, ";
5257
5258
  query += "trim(ex_inv) as ex_inventario, ";
@@ -5293,7 +5294,7 @@ function insertDeviceMassivoMySQL(table_name,lista_inv) {
5293
5294
  var query = "";
5294
5295
  var insert_sql = "insert into devices (inv_ict3_number, inv_tn_number, manifacturer, model, note) "
5295
5296
  if (table_name && table_name != '') {
5296
- if (inv_info.tabella == "ImportRevisione2024") {
5297
+ if (inv_info.tabella.startsWith("ImportRevisione")) {
5297
5298
  query = "Select ";
5298
5299
  query += "trim(inv_ict3) as Inventario, ";
5299
5300
  query += "trim(ex_inv) as ex_inventario, ";
@@ -5432,7 +5433,7 @@ function insertDeviceSiteFromInventarioSQLite(table_name, data_in, id_place, id_
5432
5433
  dp_str = d.getFullYear() + "-" + String((d.getMonth() + 1)).padStart(2, '0') + "-" + String(d.getDate()).padStart(2, '0');
5433
5434
  }
5434
5435
 
5435
- if (inv_info.tabella == "ImportRevisione2024") {
5436
+ if (inv_info.tabella.startsWith("ImportRevisione")) {
5436
5437
  query = "Select ";
5437
5438
  query += "d.id, ";
5438
5439
  query += "'" + id_place + "', ";
@@ -5485,7 +5486,7 @@ function insertDeviceSiteFromInventarioMySQL() {
5485
5486
  dp_str = d.getFullYear() + "-" + String((d.getMonth() + 1)).padStart(2, '0') + "-" + String(d.getDate()).padStart(2, '0');
5486
5487
  }
5487
5488
 
5488
- if (inv_info.tabella == "ImportRevisione2024") {
5489
+ if (inv_info.tabella.startsWith("ImportRevisione")) {
5489
5490
  query = "Select ";
5490
5491
  query += "d.id, ";
5491
5492
  query += "':id_place', ";
@@ -6328,7 +6329,7 @@ function getDevicesSelectForInventarioRawById(db_used, id_device) {
6328
6329
  function selectBeneDaInventarioSQLite(table_name, inv_code, is_pnrr, is_dismissione) {
6329
6330
  var query = "";
6330
6331
  if (table_name && inv_code) {
6331
- if (table_name == "ImportRevisione2024") {
6332
+ if (table_name.startsWith("ImportRevisione")) {
6332
6333
  query = "Select ";
6333
6334
  query += "inv_ict3 as Inventario, ";
6334
6335
  query += "ex_inv as Precedente, ";
@@ -6396,7 +6397,7 @@ function selectBeneDaInventarioSQLite(table_name, inv_code, is_pnrr, is_dismissi
6396
6397
  function selectBeneDaInventarioMySQL(table_name, inv_code, is_pnrr, is_dismissione) {
6397
6398
  var query = "";
6398
6399
  if (table_name) {
6399
- if (table_name == "ImportRevisione2024") {
6400
+ if (ttable_name.startsWith("ImportRevisione")) {
6400
6401
  query = "Select ";
6401
6402
  query += "inv_ict3 as Inventario, ";
6402
6403
  query += "ex_inv as Precedente, ";
@@ -6514,8 +6515,9 @@ function checkEsistenzaInInventario(db_used,codice) {
6514
6515
 
6515
6516
  function selectTabelleInventariComboSQLite(only_dismiss, only_pnrr) {
6516
6517
  var query = "select name, description from table_inventari "
6518
+ query += "where is_active = 1 ";
6517
6519
  if ((only_dismiss && only_dismiss == 1)|| (only_pnrr && only_pnrr == 1)) {
6518
- query += "where ";
6520
+ query += "and ";
6519
6521
  if (only_dismiss && only_dismiss == 1) {
6520
6522
  query += "is_dismissione = 1";
6521
6523
  if (only_pnrr && only_pnrr == 1)
@@ -6530,8 +6532,9 @@ function selectTabelleInventariComboSQLite(only_dismiss, only_pnrr) {
6530
6532
 
6531
6533
  function selectTabelleInventariComboMySQL(only_dismiss, only_pnrr) {
6532
6534
  var query = "select name, description from table_inventari "
6535
+ query += "where is_active = 1 ";
6533
6536
  if ((only_dismiss && only_dismiss == 1)|| (only_pnrr && only_pnrr == 1)) {
6534
- query += "where ";
6537
+ query += "and ";
6535
6538
  if (only_dismiss && only_dismiss == 1) {
6536
6539
  query += "is_dismissione = 1";
6537
6540
  if (only_pnrr && only_pnrr == 1)
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  ".": "./lib/modules.js",
5
5
  "./dbconn": "./lib/dbconn.js"
6
6
  },
7
- "version": "3.0.134",
7
+ "version": "3.0.136",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",