alsmanager_lib 3.0.129 → 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 +72 -1
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2818,7 +2818,7 @@ function queryDeviceModelsByFilter(db_used, manifacturer, dev_type) {
2818
2818
 
2819
2819
  //end of Manage models
2820
2820
  //Infos from details
2821
- function queryOSByFilter(tipo) {
2821
+ function queryOSByFilter(tipo, date_ref) {
2822
2822
  var query = "select distinct dt.os as os from devices d ";
2823
2823
  query += "left join device_pc dt on d.id = dt.id_device ";
2824
2824
  query += "where d.type = '" + tipo + "' ";
@@ -7182,8 +7182,72 @@ function esistonoBeniDaRestituire(id_consegna) {
7182
7182
  }
7183
7183
 
7184
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
+ }
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
+ }
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
+ }
7185
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
+ }
7186
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
7187
7251
  // Beni in consegna
7188
7252
  function queryConsegneByIdDeviceSQLite(id_device) {
7189
7253
  var query = "select c.data_consegna as Consegna, ";
@@ -15286,6 +15350,13 @@ module.exports = {
15286
15350
  queryDocumentsDismissioneIdDevice,
15287
15351
  getDevicesInDismissione,
15288
15352
  //
15353
+ getBeniInLimbo,
15354
+ getBeneInLimboById,
15355
+ getBeneInLimboByIdBene,
15356
+ writeBeneInLimbo,
15357
+ updateBeneInLimbo,
15358
+ deleteBeneInLimbo,
15359
+ //
15289
15360
  assignCategoryFromDB,
15290
15361
  getBeniConsumoByIdDevice,
15291
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.129",
7
+ "version": "3.0.130",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",