alsmanager_lib 3.0.221 → 3.0.223

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 +12 -2
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -3016,7 +3016,6 @@ function queryNetworksByFilter() {
3016
3016
  }
3017
3017
 
3018
3018
  //End Infos from details
3019
-
3020
3019
  // Device select
3021
3020
  function getDevicesSelectSQLite(search_type, inv_code, dev_type, marca, dev_model, is_PNRR, dev_status, dev_gestione, no_inv, in_consegna, id_dev_exclude) {
3022
3021
  var query = "SELECT DISTINCT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
@@ -7997,6 +7996,16 @@ function queryConsegne(db_used,data_da, data_a, data_filter, adulto, alunno, sti
7997
7996
  return query;
7998
7997
  }
7999
7998
 
7999
+ function queryConsegneByDevice(identificativo) {
8000
+ var query = "SELECT c.id, c.data_richiesta as Richiesta, c.data_consegna as Consegna, c.richiedente_adulto as Adulto, c.richiedente_alunno as Alunno, c.richiedente_genitore as Genitore, c.is_home as Casa, c.note as Note, c.email_adulto, c.email_genitore from consegne c ";
8001
+ query += "join consegna_beni cb on cb.id_consegna = c.id ";
8002
+ query += "where (removed is null or removed = 0) and ";
8003
+ query += "cb.id_bene in (select id from devices ";
8004
+ query += "where inv_ict3_number = '" + identificativo + "' or ";
8005
+ query += "serial_no like '%" + identificativo + "%' )";
8006
+ return query;
8007
+ }
8008
+
8000
8009
  function queryConsegnaByIdSQLite(id_consegna) {
8001
8010
  var query = "SELECT id, id_place, id_site, data_richiesta, data_consegna, data_rientro, data_limite, ";
8002
8011
  query += "case ";
@@ -17071,7 +17080,7 @@ function getNotesByIdDevice(id_device) {
17071
17080
  query += "where cb.id_bene = " + id_device + " and cb.note_consegna is not null ";
17072
17081
  query += "UNION ";
17073
17082
  query += "select CONCAT('RESTITUZIONE n. ', cb2.id_consegna) as Tipo, cb2.data_restituzione as Data, cb2.note_restituzione as note from consegna_beni cb2 ";
17074
- query += "where cb.id_bene = " + id_device + " and cb2.note_restituzione is not null ";
17083
+ query += "where cb2.id_bene = " + id_device + " and cb2.note_restituzione is not null ";
17075
17084
  query += "UNION ";
17076
17085
  query += "select CONCAT('INTERVENTO n. ', di.id) as Tipo, di.date_start as Data, di.note_intervento as note from device_interventi di ";
17077
17086
  query += "where di.id_device = " + id_device + " and di.note_intervento is not null ";
@@ -17346,6 +17355,7 @@ module.exports = {
17346
17355
  getLastGestioneDeviceByIdDevice,
17347
17356
  getDatesRangeConsegne,
17348
17357
  queryConsegne,
17358
+ queryConsegneByDevice,
17349
17359
  queryConsegnaById,
17350
17360
  getDatiConsegneAttive,
17351
17361
  createPreparazioneMessageFromConsegna,
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.221",
7
+ "version": "3.0.223",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",