alsmanager_lib 3.0.235 → 3.0.237

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 +10 -8
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -4736,7 +4736,7 @@ function insertDeviceSQLite(dev) {
4736
4736
  if (dev.peso_g)
4737
4737
  peso = dev.peso_g;
4738
4738
 
4739
- query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note, num_objects, no_inventario, peso_g, part_of, is_unused, date_insert) ";
4739
+ query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note, num_objects, no_inventario, peso_g, part_of, is_unused, date_insert, is_removed) ";
4740
4740
  query += "values (";
4741
4741
  query += "'" + String(inventario).trim() + "',";
4742
4742
  query += "'" + String(inv_comune).trim() + "',";
@@ -4752,13 +4752,14 @@ function insertDeviceSQLite(dev) {
4752
4752
  query += peso + ", ";
4753
4753
  query += "'" + dev.part_of + "', ";
4754
4754
  query += dev.is_unused + ", ";
4755
- query += "'" + convertDateToStringDB(new Date()) + "'";
4755
+ query += "'" + convertDateToStringDB(new Date()) + "', ";
4756
+ query += "0"; // is_removed
4756
4757
  query += ")";
4757
4758
  }
4758
4759
  return query;
4759
4760
  }
4760
4761
  function insertDeviceMySQL() {
4761
- query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note, num_objects, no_inventario, peso_g, part_of, is_unused, date_insert) ";
4762
+ query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note, num_objects, no_inventario, peso_g, part_of, is_unused, date_insert, is_removed) ";
4762
4763
  query += "values (";
4763
4764
  query += ":inventario, ";
4764
4765
  query += ":inv_comune, ";
@@ -4774,7 +4775,8 @@ function insertDeviceMySQL() {
4774
4775
  query += ":peso_g, ";
4775
4776
  query += ":part_of, ";
4776
4777
  query += ":is_unused, ";
4777
- query += "'" + convertDateToStringDB(new Date()) + "'";
4778
+ query += "'" + convertDateToStringDB(new Date()) + "', ";
4779
+ query += "0"; // is_removed
4778
4780
  query += ")";
4779
4781
  return query;
4780
4782
  }
@@ -10016,7 +10018,7 @@ function selectDeviceConsegna(db_used, id_consegna, id_device) {
10016
10018
 
10017
10019
 
10018
10020
  function selectDeviceInDepositoSQLite(inv_code) {
10019
- var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
10021
+ var query = "SELECT distinct d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
10020
10022
  query += "case ";
10021
10023
  query += "when inv_ict3_number != '' and inv_ict3_number is not null then inv_ict3_number ";
10022
10024
  query += "when inv_pnrr_number != '' and inv_pnrr_number is not null then inv_pnrr_number ";
@@ -10038,7 +10040,7 @@ function selectDeviceInDepositoSQLite(inv_code) {
10038
10040
  return query;
10039
10041
  }
10040
10042
  function selectDeviceInDepositoMySQL(inv_code) {
10041
- var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
10043
+ var query = "SELECT distinct d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
10042
10044
  query += "case ";
10043
10045
  query += "when inv_ict3_number != '' and inv_ict3_number is not null then inv_ict3_number ";
10044
10046
  query += "when inv_pnrr_number != '' and inv_pnrr_number is not null then inv_pnrr_number ";
@@ -10179,7 +10181,7 @@ function selectSoftwareConsegna(db_used, id_consegna, id_software) {
10179
10181
  }
10180
10182
 
10181
10183
  function selectSoftwaresInDepositoSQLite(inv_code) {
10182
- var query = "SELECT s.id, s.support, s.platform, s.version, s.license_type, s.maker, s.model, ";
10184
+ var query = "SELECT distinct s.id, s.support, s.platform, s.version, s.license_type, s.maker, s.model, ";
10183
10185
  query += "case ";
10184
10186
  query += "when s.inv_ict3_number != '' and s.inv_ict3_number is not null then s.inv_ict3_number ";
10185
10187
  query += "when s.serial_no != '' and s.serial_no is not null then concat(s.serial_no,'(S/N)') ";
@@ -10193,7 +10195,7 @@ function selectSoftwaresInDepositoSQLite(inv_code) {
10193
10195
  return query;
10194
10196
  }
10195
10197
  function selectSoftwaresInDepositoMySQL(inv_code) {
10196
- var query = "SELECT s.id, s.support, s.platform, s.version, s.license_type, s.maker, s.model, ";
10198
+ var query = "SELECT distinct s.id, s.support, s.platform, s.version, s.license_type, s.maker, s.model, ";
10197
10199
  query += "case ";
10198
10200
  query += "when s.inv_ict3_number != '' and s.inv_ict3_number is not null then s.inv_ict3_number ";
10199
10201
  query += "when s.serial_no != '' and s.serial_no is not null then concat(s.serial_no,'(S/N)') ";
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.235",
7
+ "version": "3.0.237",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",