alsmanager_lib 3.0.28 → 3.0.30

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 +14 -31
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -7707,7 +7707,7 @@ function removeConsegnaBene(db_used, id_benecons) {
7707
7707
  return query;
7708
7708
  }
7709
7709
  function selectBeniPerConsegnaSQLite(id_consegna) {
7710
- var query = "select cb.id_bene as id, cb.numero as Numero, cb.tipo_bene as Tipologia, ";
7710
+ var query = "select cb.id, cb.id_bene, cb.numero as Numero, cb.tipo_bene as Tipologia, ";
7711
7711
  query += "case ";
7712
7712
  query += "when cb.tipo_bene = 'DEVICE' then d.type ";
7713
7713
  query += "when cb.tipo_bene = 'SOFTWARE' then s.support ";
@@ -7799,51 +7799,33 @@ function selectBeniPerConsegna(db_used, id_consegna) {
7799
7799
  return query;
7800
7800
  }
7801
7801
 
7802
- function selectDeviceConsegnaSQLite(id_consegna, id_device) {
7803
- var query = "select dc.id as id_dev_cons, d.id, d.type, d.manifacturer, d.model, ";
7804
- query += "case ";
7805
- query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then d.inv_ict3_number ";
7806
- query += "when d.inv_pnrr_number != '' and d.inv_pnrr_number is not null then d.inv_pnrr_number ";
7807
- query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number,'(TN)') ";
7808
- query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
7809
- query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
7810
- query += "end as codice ";
7811
- query += ", dc.note as note_cons from device_consegne dc";
7812
- query += " join devices d on d.id = dc.id_device";
7813
- query += " where dc.id_consegna = " + id_consegna;
7814
- query += " and d.id = " + id_device;
7802
+ function selectBeneConsegnaSQLite(id_consegna, id_benecons) {
7803
+ var query = "select cb.id as id_benecons, cb.id_consegna, cb.id_bene, cb.tipo_bene, ";
7804
+ query += "cb.note_consegna, cb.numero, cb.stato_restituzione, cb.data_consegna, cb.data_restituzione from consegna_beni cb";
7805
+ query += " where cb.id = " + id_benecons;
7815
7806
  return query;
7816
7807
  }
7817
7808
 
7818
- function selectDeviceConsegnaMySQL(id_consegna, id_device) {
7819
- var query = "select dc.id as id_dev_cons, d.id, d.type, d.manifacturer, d.model, ";
7820
- query += "case ";
7821
- query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then d.inv_ict3_number ";
7822
- query += "when d.inv_pnrr_number != '' and d.inv_pnrr_number is not null then d.inv_pnrr_number ";
7823
- query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number,'(TN)') ";
7824
- query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
7825
- query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
7826
- query += "end as codice ";
7827
- query += ", dc.note as note_cons from device_consegne dc";
7828
- query += " join devices d on d.id = dc.id_device";
7829
- query += " where dc.id_consegna = :id_consegna";
7830
- query += " and d.id :id_device";
7809
+ function selectBeneConsegnaMySQL(id_consegna, id_benecons) {
7810
+ var query = "select cb.id as id_benecons, cb.id_consegna, cb.id_bene, cb.tipo_bene, ";
7811
+ query += "cb.note_consegna, cb.numero, cb.stato_restituzione, cb.data_consegna, cb.data_restituzione from consegna_beni cb";
7812
+ query += " where cb.id = :id_benecons";
7831
7813
  return query;
7832
7814
  }
7833
7815
 
7834
7816
 
7835
- function selectDeviceConsegna(db_used, id_consegna, id_device) {
7817
+ function selectBeneConsegna(db_used, id_consegna, id_benecons) {
7836
7818
  var query = "";
7837
7819
  if (db_used) {
7838
7820
  switch (db_used) {
7839
7821
  case 'SQLITE':
7840
- query = selectDeviceConsegnaSQLite(id_consegna, id_device);
7822
+ query = selectBeneConsegnaSQLite(id_consegna, id_benecons);
7841
7823
  break;
7842
7824
  case 'MYSQL':
7843
- query = selectDeviceConsegnaMySQL(id_consegna, id_device);
7825
+ query = selectBeneConsegnaMySQL(id_consegna, id_benecons);
7844
7826
  break;
7845
7827
  case 'MYSQL2':
7846
- query = selectDeviceConsegnaSQLite(id_consegna, id_device);
7828
+ query = selectBeneConsegnaSQLite(id_consegna, id_benecons);
7847
7829
  break;
7848
7830
  }
7849
7831
  }
@@ -13997,6 +13979,7 @@ module.exports = {
13997
13979
  updateConsegnaBene,
13998
13980
  removeConsegnaBene,
13999
13981
  selectBeniPerConsegna,
13982
+ selectBeneConsegna,
14000
13983
  selectDevicePerConsegna,
14001
13984
  selectDeviceConsegna,
14002
13985
  selectSoftwarePerConsegna,
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.28",
7
+ "version": "3.0.30",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",