alsmanager_lib 3.0.133 → 3.0.135

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 +33 -17
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2822,14 +2822,15 @@ 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 + "' ";
2825
- query += "order dt.os";
2825
+ query += "and dt.os is not null ";
2826
+ query += "order by dt.os";
2826
2827
  return query;
2827
2828
  }
2828
2829
 
2829
2830
  function queryOSVersionByFilter(os) {
2830
2831
  var query = "select distinct dt.os_version as version from device_pc dt ";
2831
2832
  query += "where dt.os = '" + os + "' ";
2832
- query += "order dt.os_version";
2833
+ query += "order by dt.os_version";
2833
2834
  return query;
2834
2835
  }
2835
2836
 
@@ -6514,8 +6515,9 @@ function checkEsistenzaInInventario(db_used,codice) {
6514
6515
 
6515
6516
  function selectTabelleInventariComboSQLite(only_dismiss, only_pnrr) {
6516
6517
  var query = "select name, description from table_inventari "
6518
+ query += "where is_active = 1 ";
6517
6519
  if ((only_dismiss && only_dismiss == 1)|| (only_pnrr && only_pnrr == 1)) {
6518
- query += "where ";
6520
+ query += "and ";
6519
6521
  if (only_dismiss && only_dismiss == 1) {
6520
6522
  query += "is_dismissione = 1";
6521
6523
  if (only_pnrr && only_pnrr == 1)
@@ -6530,8 +6532,9 @@ function selectTabelleInventariComboSQLite(only_dismiss, only_pnrr) {
6530
6532
 
6531
6533
  function selectTabelleInventariComboMySQL(only_dismiss, only_pnrr) {
6532
6534
  var query = "select name, description from table_inventari "
6535
+ query += "where is_active = 1 ";
6533
6536
  if ((only_dismiss && only_dismiss == 1)|| (only_pnrr && only_pnrr == 1)) {
6534
- query += "where ";
6537
+ query += "and ";
6535
6538
  if (only_dismiss && only_dismiss == 1) {
6536
6539
  query += "is_dismissione = 1";
6537
6540
  if (only_pnrr && only_pnrr == 1)
@@ -7247,18 +7250,26 @@ function deleteBeneInLimbo(id_limbo) {
7247
7250
  return query;
7248
7251
  }
7249
7252
 
7253
+
7254
+
7255
+
7250
7256
  //End Beni in Limbo
7251
7257
  // Beni in consegna
7252
7258
  function queryConsegneByIdDeviceSQLite(id_device) {
7253
- var query = "select c.data_consegna as Consegna, ";
7259
+ var query = "select dc.data_consegna as Consegna, ";
7254
7260
  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' ";
7261
+ query += "when dc.stato_restituzione = 0 then 'Prestito in corso' ";
7262
+ query += "when dc.stato_restituzione = 1 then 'Non restituito' ";
7263
+ query += "when dc.stato_restituzione = 2 then 'Restituito' ";
7264
+ query += "when dc.stato_restituzione = 3 then 'Danneggiato' ";
7265
+ query += "when dc.stato_restituzione = 4 then 'Parti mancanti' ";
7260
7266
  query += "else '' ";
7261
7267
  query += "end as Stato, ";
7268
+ query += "case ";
7269
+ query += "when dc.data_restituzione is not null then dc.data_restituzione ";
7270
+ query += "when trim(dc.data_restituzione) <> '' then dc.data_restituzione ";
7271
+ query += "else '' ";
7272
+ query += "end as Restituzione, ";
7262
7273
  //query += "c.note as Note from device_consegne dc ";
7263
7274
  query += "c.note as Note from consegna_beni dc ";
7264
7275
  query += "inner join consegne c on c.id = dc.id_consegna ";
@@ -7267,17 +7278,22 @@ function queryConsegneByIdDeviceSQLite(id_device) {
7267
7278
  }
7268
7279
 
7269
7280
  function queryConsegneByIdDeviceMySQL(id_device) {
7270
- var query = "select c.data_consegna as Consegna, ";
7281
+ var query = "select dc.data_consegna as Consegna, ";
7271
7282
  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' ";
7283
+ query += "when dc.stato_restituzione = 0 then 'Prestito in corso' ";
7284
+ query += "when dc.stato_restituzione = 1 then 'Non restituito' ";
7285
+ query += "when dc.stato_restituzione = 2 then 'Restituito' ";
7286
+ query += "when dc.stato_restituzione = 3 then 'Danneggiato' ";
7287
+ query += "when dc.stato_restituzione = 4 then 'Parti mancanti' ";
7277
7288
  query += "else '' ";
7278
7289
  query += "end as Stato, ";
7290
+ query += "case ";
7291
+ query += "when dc.data_restituzione is not null then dc.data_restituzione ";
7292
+ query += "when trim(dc.data_restituzione) <> '' then dc.data_restituzione ";
7293
+ query += "else '' ";
7294
+ query += "end as Restituzione, ";
7279
7295
  //query += "c.note as Note from device_consegne dc ";
7280
- query += "c.note as Note from consegna_beni dc ";
7296
+ query += "dc.note as Note from consegna_beni dc ";
7281
7297
  query += "inner join consegne c on c.id = dc.id_consegna ";
7282
7298
  query += "where dc.id_bene = :id_device";
7283
7299
  return query;
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.133",
7
+ "version": "3.0.135",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",