alsmanager_lib 3.0.30 → 3.0.32

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 +62 -8
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -3474,6 +3474,58 @@ function queryDeviceById(db_used, id_device) {
3474
3474
  }
3475
3475
  return query;
3476
3476
  }
3477
+ function queryDeviceForConsegneByIdSQLite(id_device) {
3478
+ var query = "SELECT d.id, d.type as Tipo, ";
3479
+ query += "d.manifacturer as Marca, d.model as Modello, ";
3480
+ query += "d.manifacturer as Marca, d.model as Modello, ";
3481
+ query += "case ";
3482
+ query += "when d.no_inventario is not null and d.no_inventario > 0 then concat(d.id, '(ID)') ";
3483
+ query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number) ";
3484
+ query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number, '(TN)') ";
3485
+ query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
3486
+ query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
3487
+ query += "else concat(d.id, '(ID)') "
3488
+ query += "end as Codice, ";
3489
+ query += "d.note, d.num_objects, d.no_inventario from devices d ";
3490
+ query += "where d.id = " + id_device;
3491
+ return query;
3492
+ }
3493
+ function queryDeviceForConsegneByIdMySQL(id_device) {
3494
+ var query = "SELECT d.id, d.type as Tipo, ";
3495
+ query += "d.manifacturer as Marca, d.model as Modello, ";
3496
+ query += "case ";
3497
+ query += "when d.no_inventario is not null and d.no_inventario > 0 then concat(d.id, '(ID)') ";
3498
+ query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number) ";
3499
+ query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number, '(TN)') ";
3500
+ query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
3501
+ query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
3502
+ query += "else concat(d.id, '(ID)') "
3503
+ query += "end as Codice, ";
3504
+ query += "d.note, d.num_objects, d.no_inventario from devices d ";
3505
+ query += "where d.id = :id_device";
3506
+ return query;
3507
+ }
3508
+ function queryDeviceForConsegneById(db_used, id_device) {
3509
+ var query = "";
3510
+ if (db_used) {
3511
+ switch (db_used) {
3512
+ case 'SQLITE':
3513
+ query = queryDeviceForConsegneByIdSQLite(id_device);
3514
+ break;
3515
+ case 'MYSQL':
3516
+ query = queryDeviceForConsegneByIdMySQL(id_device);
3517
+ break;
3518
+ case 'MYSQL2':
3519
+ query = queryDeviceForConsegneByIdSQLite(id_device);
3520
+ break;
3521
+ }
3522
+ }
3523
+ return query;
3524
+ }
3525
+
3526
+
3527
+
3528
+
3477
3529
  //End Get Device by Id
3478
3530
  //Get Device by Identificativo
3479
3531
  function queryDeviceByIdentificativoSQLite(identificativo) {
@@ -7799,14 +7851,14 @@ function selectBeniPerConsegna(db_used, id_consegna) {
7799
7851
  return query;
7800
7852
  }
7801
7853
 
7802
- function selectBeneConsegnaSQLite(id_consegna, id_benecons) {
7854
+ function selectBeneConsegnaSQLite(id_benecons) {
7803
7855
  var query = "select cb.id as id_benecons, cb.id_consegna, cb.id_bene, cb.tipo_bene, ";
7804
7856
  query += "cb.note_consegna, cb.numero, cb.stato_restituzione, cb.data_consegna, cb.data_restituzione from consegna_beni cb";
7805
7857
  query += " where cb.id = " + id_benecons;
7806
7858
  return query;
7807
7859
  }
7808
7860
 
7809
- function selectBeneConsegnaMySQL(id_consegna, id_benecons) {
7861
+ function selectBeneConsegnaMySQL(id_benecons) {
7810
7862
  var query = "select cb.id as id_benecons, cb.id_consegna, cb.id_bene, cb.tipo_bene, ";
7811
7863
  query += "cb.note_consegna, cb.numero, cb.stato_restituzione, cb.data_consegna, cb.data_restituzione from consegna_beni cb";
7812
7864
  query += " where cb.id = :id_benecons";
@@ -7814,18 +7866,18 @@ function selectBeneConsegnaMySQL(id_consegna, id_benecons) {
7814
7866
  }
7815
7867
 
7816
7868
 
7817
- function selectBeneConsegna(db_used, id_consegna, id_benecons) {
7869
+ function selectBeneConsegna(db_used, id_benecons) {
7818
7870
  var query = "";
7819
7871
  if (db_used) {
7820
7872
  switch (db_used) {
7821
7873
  case 'SQLITE':
7822
- query = selectBeneConsegnaSQLite(id_consegna, id_benecons);
7874
+ query = selectBeneConsegnaSQLite(id_benecons);
7823
7875
  break;
7824
7876
  case 'MYSQL':
7825
- query = selectBeneConsegnaMySQL(id_consegna, id_benecons);
7877
+ query = selectBeneConsegnaMySQL(id_benecons);
7826
7878
  break;
7827
7879
  case 'MYSQL2':
7828
- query = selectBeneConsegnaSQLite(id_consegna, id_benecons);
7880
+ query = selectBeneConsegnaSQLite(id_benecons);
7829
7881
  break;
7830
7882
  }
7831
7883
  }
@@ -7945,8 +7997,9 @@ function selectDeviceConsegna(db_used, id_consegna, id_device) {
7945
7997
  return query;
7946
7998
  }
7947
7999
 
8000
+
7948
8001
  function selectDeviceInDepositoSQLite(inv_code) {
7949
- var query = "SELECT d.id, d.type, d.manifacturer, d.model, ";
8002
+ var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
7950
8003
  query += "case ";
7951
8004
  query += "when inv_ict3_number != '' and inv_ict3_number is not null then inv_ict3_number ";
7952
8005
  query += "when inv_pnrr_number != '' and inv_pnrr_number is not null then inv_pnrr_number ";
@@ -7966,7 +8019,7 @@ function selectDeviceInDepositoSQLite(inv_code) {
7966
8019
  return query;
7967
8020
  }
7968
8021
  function selectDeviceInDepositoMySQL(inv_code) {
7969
- var query = "SELECT d.id, d.type, d.manifacturer, d.model, ";
8022
+ var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
7970
8023
  query += "case ";
7971
8024
  query += "when inv_ict3_number != '' and inv_ict3_number is not null then inv_ict3_number ";
7972
8025
  query += "when inv_pnrr_number != '' and inv_pnrr_number is not null then inv_pnrr_number ";
@@ -13750,6 +13803,7 @@ module.exports = {
13750
13803
  getDevicesSelectBySite,
13751
13804
  queryDeviceById,
13752
13805
  queryDeviceByIdentificativo,
13806
+ queryDeviceForConsegneById,
13753
13807
  getDevicesCounterBySite,
13754
13808
  getDevicesCounterByPlace,
13755
13809
  queryDeviceStatus,
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.30",
7
+ "version": "3.0.32",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",