alsmanager_lib 2.0.54 → 2.0.55

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 -6
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2736,7 +2736,7 @@ function insertDeviceSQLite(dev) {
2736
2736
  if (dev.note)
2737
2737
  note = dev.note;
2738
2738
 
2739
- query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note) ";
2739
+ query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note, num_objects) ";
2740
2740
  query += "values (";
2741
2741
  query += "'" + String(inventario).trim() + "',";
2742
2742
  query += "'" + String(inv_comune).trim() + "',";
@@ -2746,13 +2746,14 @@ function insertDeviceSQLite(dev) {
2746
2746
  query += "'" + String(marca).trim() + "',";
2747
2747
  query += "'" + String(modello).trim() + "',";
2748
2748
  query += "'" + String(serial_no).trim() + "',";
2749
- query += "'" + String(note).trim() + "'";
2749
+ query += "'" + String(note).trim() + "',";
2750
+ query += dev.num_objects;
2750
2751
  query += ")";
2751
2752
  }
2752
2753
  return query;
2753
2754
  }
2754
2755
  function insertDeviceMySQL() {
2755
- var query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note) ";
2756
+ var query = "insert into devices (inv_ict3_number, inv_tn_number, inv_pnrr_number, inv_tndigit_number, type, manifacturer, model, serial_no, note, num_objects) ";
2756
2757
  query += "values (";
2757
2758
  query += ":inventario, ";
2758
2759
  query += ":inv_comune, ";
@@ -2762,7 +2763,8 @@ function insertDeviceMySQL() {
2762
2763
  query += ":marca, ";
2763
2764
  query += ":modello, ";
2764
2765
  query += ":serial_no, ";
2765
- query += ":note";
2766
+ query += ":note, ";
2767
+ query += ":num_objects"
2766
2768
  query += ")";
2767
2769
  return query;
2768
2770
  }
@@ -2825,7 +2827,8 @@ function updateDeviceSQLite(deviceObj) {
2825
2827
  query += "manifacturer = '" + marca.trim() + "',";
2826
2828
  query += "model = '" + modello.trim() + "',";
2827
2829
  query += "serial_no = '" + serial_no.trim() + "',";
2828
- query += "note = '" + note.trim() + "'";
2830
+ query += "note = '" + note.trim() + "',";
2831
+ query += "num_objects = " + dev.num_objects + " ";
2829
2832
  query += " where id = " + dev.id;
2830
2833
  }
2831
2834
  return query;
@@ -2841,7 +2844,8 @@ function updateDeviceMySQL() {
2841
2844
  query += "manifacturer = :marca, ";
2842
2845
  query += "model = :modello, ";
2843
2846
  query += "serial_no = :serial_no, ";
2844
- query += "note = :note";
2847
+ query += "note = :note, ";
2848
+ query += "num_objects = :num_objects ";
2845
2849
  query += " where id = :id_device";
2846
2850
  return query;
2847
2851
  }
@@ -2896,6 +2900,7 @@ function getDeviceMySQLPayload(dev) {
2896
2900
  if (dev.note) {
2897
2901
  retValue.note = dev.note;
2898
2902
  }
2903
+ retValue.num_objects = dev.num_objects;
2899
2904
  payloadObj = {
2900
2905
  "inventario": retValue.inventario.trim(),
2901
2906
  "inv_comune": retValue.inv_comune.trim(),
@@ -2906,6 +2911,7 @@ function getDeviceMySQLPayload(dev) {
2906
2911
  "modello": retValue.modello.trim(),
2907
2912
  "serial_no": retValue.serial_no.trim(),
2908
2913
  "note": retValue.note.trim(),
2914
+ "num_objects": retValue.num_objects,
2909
2915
  "id_device": dev.id
2910
2916
  };
2911
2917
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  ".": "./lib/modules.js",
5
5
  "./dbconn": "./lib/dbconn.js"
6
6
  },
7
- "version": "2.0.54",
7
+ "version": "2.0.55",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",