alsmanager_lib 3.0.132 → 3.0.134

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 +28 -15
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -7247,39 +7247,52 @@ function deleteBeneInLimbo(id_limbo) {
7247
7247
  return query;
7248
7248
  }
7249
7249
 
7250
+
7251
+
7252
+
7250
7253
  //End Beni in Limbo
7251
7254
  // Beni in consegna
7252
7255
  function queryConsegneByIdDeviceSQLite(id_device) {
7253
- var query = "select c.data_consegna as Consegna, ";
7256
+ var query = "select dc.data_consegna as Consegna, ";
7254
7257
  query += "case ";
7255
- query += "when c.stato_restituzione = 0 then 'Prestito in corso' ";
7256
- query += "when c.stato_restituzione = 1 then 'Non restituito' ";
7257
- query += "when c.stato_restituzione = 2 then 'Restituito' ";
7258
- query += "when c.stato_restituzione = 3 then 'Danneggiato' ";
7259
- query += "when c.stato_restituzione = 4 then 'Parti mancanti' ";
7258
+ query += "when dc.stato_restituzione = 0 then 'Prestito in corso' ";
7259
+ query += "when dc.stato_restituzione = 1 then 'Non restituito' ";
7260
+ query += "when dc.stato_restituzione = 2 then 'Restituito' ";
7261
+ query += "when dc.stato_restituzione = 3 then 'Danneggiato' ";
7262
+ query += "when dc.stato_restituzione = 4 then 'Parti mancanti' ";
7260
7263
  query += "else '' ";
7261
7264
  query += "end as Stato, ";
7265
+ query += "case ";
7266
+ query += "when dc.data_restituzione is not null then dc.data_restituzione ";
7267
+ query += "when trim(dc.data_restituzione) <> '' then dc.data_restituzione ";
7268
+ query += "else '' ";
7269
+ query += "end as Restituzione, ";
7262
7270
  //query += "c.note as Note from device_consegne dc ";
7263
7271
  query += "c.note as Note from consegna_beni dc ";
7264
7272
  query += "inner join consegne c on c.id = dc.id_consegna ";
7265
- query += "where dc.id_device = " + id_device;
7273
+ query += "where dc.id_bene = " + id_device;
7266
7274
  return query;
7267
7275
  }
7268
7276
 
7269
7277
  function queryConsegneByIdDeviceMySQL(id_device) {
7270
- var query = "select c.data_consegna as Consegna, ";
7278
+ var query = "select dc.data_consegna as Consegna, ";
7271
7279
  query += "case ";
7272
- query += "when c.stato_restituzione = 0 then 'Prestito in corso' ";
7273
- query += "when c.stato_restituzione = 1 then 'Non restituito' ";
7274
- query += "when c.stato_restituzione = 2 then 'Restituito' ";
7275
- query += "when c.stato_restituzione = 3 then 'Danneggiato' ";
7276
- query += "when c.stato_restituzione = 4 then 'Parti mancanti' ";
7280
+ query += "when dc.stato_restituzione = 0 then 'Prestito in corso' ";
7281
+ query += "when dc.stato_restituzione = 1 then 'Non restituito' ";
7282
+ query += "when dc.stato_restituzione = 2 then 'Restituito' ";
7283
+ query += "when dc.stato_restituzione = 3 then 'Danneggiato' ";
7284
+ query += "when dc.stato_restituzione = 4 then 'Parti mancanti' ";
7277
7285
  query += "else '' ";
7278
7286
  query += "end as Stato, ";
7287
+ query += "case ";
7288
+ query += "when dc.data_restituzione is not null then dc.data_restituzione ";
7289
+ query += "when trim(dc.data_restituzione) <> '' then dc.data_restituzione ";
7290
+ query += "else '' ";
7291
+ query += "end as Restituzione, ";
7279
7292
  //query += "c.note as Note from device_consegne dc ";
7280
- query += "c.note as Note from consegna_beni dc ";
7293
+ query += "dc.note as Note from consegna_beni dc ";
7281
7294
  query += "inner join consegne c on c.id = dc.id_consegna ";
7282
- query += "where dc.id_device = :id_device";
7295
+ query += "where dc.id_bene = :id_device";
7283
7296
  return query;
7284
7297
  }
7285
7298
 
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.132",
7
+ "version": "3.0.134",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",