alsmanager_lib 3.0.18 → 3.0.20

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 +31 -2
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2156,7 +2156,7 @@ function createSwitchPatchPropertiesMySQLObj(id_device, dev_prop) {
2156
2156
  return obj;
2157
2157
  }
2158
2158
  function insertSwitchPatchPropertiesSQLite(id_device, dev_prop) {
2159
- var query = "insert into device_switch (id_device, num_ports, num_poe) values ";
2159
+ var query = "insert into device_switch (id_device, num_ports, num_poe, tipo) values ";
2160
2160
  query += "(" + id_device + ", " + dev_prop.num_ports + ", " + dev_prop.num_poe + ", '" + dev_prop.tipo + "')";
2161
2161
  return query;
2162
2162
  }
@@ -8466,6 +8466,34 @@ function queryDocumentsDismissioneIdDevice(db_used, id_device) {
8466
8466
  return query;
8467
8467
  }
8468
8468
 
8469
+
8470
+ function getDevicesInDismissione() {
8471
+ var query = "select d.id, ";
8472
+ query += "case ";
8473
+ query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then d.inv_ict3_number ";
8474
+ query += "else ''";
8475
+ query += "end as Inventario, ";
8476
+ query += "case ";
8477
+ query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number,'(TN)') ";
8478
+ query += "else ''";
8479
+ query += "end as Comune_Prov, ";
8480
+ query += "case ";
8481
+ query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
8482
+ query += "else ''";
8483
+ query += "end as TNDigit, ";
8484
+ query += "case ";
8485
+ query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
8486
+ query += "else ''";
8487
+ query += "end as SerialNo, ";
8488
+ query += "d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
8489
+ query += "md.descrizione as Motivo_Dismissione "
8490
+ query += "from device_dismissioni dm ";
8491
+ query += "join devices d on d.id = dm.id_device ";
8492
+ query += "left join motivo_dismissione md on dm.motivo = md.id "
8493
+ query += "";
8494
+ return query;
8495
+ }
8496
+
8469
8497
  //End manage dismissioni
8470
8498
 
8471
8499
 
@@ -13260,7 +13288,8 @@ module.exports = {
13260
13288
  updateDocumentoDismissione,
13261
13289
  removeDocumentoDismissione,
13262
13290
  checkDocumentoInDismissione,
13263
- queryDocumentsDismissioneIdDevice,
13291
+ queryDocumentsDismissioneIdDevice,
13292
+ getDevicesInDismissione,
13264
13293
  //
13265
13294
  assignCategoryFromDB,
13266
13295
  getBeniConsumoByIdDevice,
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.18",
7
+ "version": "3.0.20",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",