alsmanager_lib 3.0.128 → 3.0.130

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 +111 -0
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2817,6 +2817,41 @@ function queryDeviceModelsByFilter(db_used, manifacturer, dev_type) {
2817
2817
 
2818
2818
 
2819
2819
  //end of Manage models
2820
+ //Infos from details
2821
+ function queryOSByFilter(tipo, date_ref) {
2822
+ var query = "select distinct dt.os as os from devices d ";
2823
+ query += "left join device_pc dt on d.id = dt.id_device ";
2824
+ query += "where d.type = '" + tipo + "' ";
2825
+ query += "order dt.os";
2826
+ return query;
2827
+ }
2828
+
2829
+ function queryOSVersionByFilter(os) {
2830
+ var query = "select distinct dt.os_version as version from device_pc dt ";
2831
+ query += "where dt.os = '" + os + "' ";
2832
+ query += "order dt.os_version";
2833
+ return query;
2834
+ }
2835
+
2836
+ function queryStoragesByFilter() {
2837
+ var query = "";
2838
+ query += "";
2839
+ return query;
2840
+ }
2841
+
2842
+ function queryAddOnsByFilter() {
2843
+ var query = "";
2844
+ query += "";
2845
+ return query;
2846
+ }
2847
+
2848
+ function queryNetworksByFilter() {
2849
+ var query = "";
2850
+ query += "";
2851
+ return query;
2852
+ }
2853
+
2854
+ //End Infos from details
2820
2855
 
2821
2856
  // Device select
2822
2857
  function getDevicesSelectSQLite(search_type, inv_code, dev_type, marca, dev_model, is_PNRR, dev_status, dev_gestione, no_inv, in_consegna, id_dev_exclude) {
@@ -7147,8 +7182,72 @@ function esistonoBeniDaRestituire(id_consegna) {
7147
7182
  }
7148
7183
 
7149
7184
  //End Creazione email sollecito consegna
7185
+ // Beni in Limbo
7186
+ function getBeniInLimbo(data_ref_da, data_ref_a) {
7187
+ /*
7188
+ CREATE TABLE "beni_limbo" (
7189
+ "id" INTEGER,
7190
+ "id_bene" INTEGER,
7191
+ "tipo_bene" TEXT,
7192
+ "id_doc" INTEGER,
7193
+ "data_rilievo" TEXT,
7194
+ "note" TEXT,
7195
+ PRIMARY KEY("id" AUTOINCREMENT)
7196
+ )
7197
+ */
7198
+ var query = "select b.id, d.manifacturer, d.model, b.tipo_bene, b.id_doc, b.data_rilievo, b.note from beni_limbo b ";
7199
+ query += "join device d on d.id = b.id_bene ";
7200
+ if (data_ref_da) {
7201
+ query += "and b.data_rilievo <= " + data_ref_da + " ";
7202
+ }
7203
+ if (data_ref_a) {
7204
+ query += "and b.data_rilievo >= " + data_ref_a + " ";
7205
+ }
7206
+ return query;
7207
+ }
7150
7208
 
7209
+ function getBeneInLimboById(id_limbo) {
7210
+ var query = "select b.id, b.id_bene, b.tipo_bene, b.id_doc, b.data_rilievo, b.note from beni_limbo b ";
7211
+ query += "where b.id = " + id_limbo;
7212
+ return query;
7213
+ }
7151
7214
 
7215
+ function getBeneInLimboByIdBene(id_bene) {
7216
+ var query = "select b.id, b.id_bene, b.tipo_bene, b.id_doc, b.data_rilievo, b.note from beni_limbo b ";
7217
+ query += "where b.id_bene = " + id_bene;
7218
+ return query;
7219
+ }
7220
+
7221
+ function writeBeneInLimbo(id_bene, tipo_bene, id_doc, data_rilievo, note) {
7222
+ var query = "insert into beni_limbo (id_bene, tipo_bene, id_doc, data_rilievo, note) value (";
7223
+ var dr_str = convertDateToStringDB(data_rilievo);
7224
+ query += id_bene + ", ";
7225
+ query += "'" + tipo_bene + "', ";
7226
+ query += id_doc + ", ";
7227
+ query += "'" + dr_str + "', ";
7228
+ query += "'" + note + "'";
7229
+ return query;
7230
+ }
7231
+
7232
+ function updateBeneInLimbo(id_limbo, id_bene, tipo_bene, id_doc, data_rilievo, note) {
7233
+ var query = "update beni_limbo set ";
7234
+ var dr_str = convertDateToStringDB(data_rilievo);
7235
+ query += "id_bene = " + id_bene + ", ";
7236
+ query += "tipo_bene = '" + tipo_bene + "', ";
7237
+ query += "id_doc = " + id_doc + ", ";
7238
+ query += "data_rilievo = '" + dr_str + "', ";
7239
+ query += "note = '" + note + "'";
7240
+ query += "where id = " + id_limbo;
7241
+ return query;
7242
+ }
7243
+
7244
+ function deleteBeneInLimbo(id_limbo) {
7245
+ var query = "delete from beni_limbo b ";
7246
+ query += "where b.id = " + id_limbo;
7247
+ return query;
7248
+ }
7249
+
7250
+ //End Beni in Limbo
7152
7251
  // Beni in consegna
7153
7252
  function queryConsegneByIdDeviceSQLite(id_device) {
7154
7253
  var query = "select c.data_consegna as Consegna, ";
@@ -15027,6 +15126,11 @@ module.exports = {
15027
15126
  queryDeviceManifacturesByFilter,
15028
15127
  queryDeviceModels,
15029
15128
  queryDeviceModelsByFilter,
15129
+ queryOSByFilter,
15130
+ queryOSVersionByFilter,
15131
+ queryStoragesByFilter,
15132
+ queryAddOnsByFilter,
15133
+ queryNetworksByFilter,
15030
15134
  getDevicesSelectByRelated,
15031
15135
  getDevicesSelect,
15032
15136
  getDevicesByIdDoc,
@@ -15246,6 +15350,13 @@ module.exports = {
15246
15350
  queryDocumentsDismissioneIdDevice,
15247
15351
  getDevicesInDismissione,
15248
15352
  //
15353
+ getBeniInLimbo,
15354
+ getBeneInLimboById,
15355
+ getBeneInLimboByIdBene,
15356
+ writeBeneInLimbo,
15357
+ updateBeneInLimbo,
15358
+ deleteBeneInLimbo,
15359
+ //
15249
15360
  assignCategoryFromDB,
15250
15361
  getBeniConsumoByIdDevice,
15251
15362
  queryConsegneByIdDevice,
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.128",
7
+ "version": "3.0.130",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",