alsmanager_lib 2.0.62 → 2.0.63

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 +9 -3
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2175,12 +2175,15 @@ function getDevicesSelectSQLite(search_type, inv_code, dev_type, marca, is_PNRR,
2175
2175
  }
2176
2176
  if (is_PNRR && is_PNRR > 0) {
2177
2177
  where_clause += " (d.inv_pnrr_number <> '' and inv_pnrr_number is not null) ";
2178
- if (dev_status) {
2178
+ if (dev_status || dev_gestione) {
2179
2179
  where_clause += " and ";
2180
2180
  }
2181
2181
  }
2182
2182
  if (dev_status) {
2183
2183
  where_clause += " du.status = " + dev_status + " and date('now') >= du.date_status";
2184
+ if (dev_gestione) {
2185
+ where_clause += " and ";
2186
+ }
2184
2187
  }
2185
2188
  if (dev_gestione) {
2186
2189
  where_clause += " dg.id_gestione = " + dev_gestione + " and date('now') >= dg.date_start and date('now') <= dg.date_end";
@@ -2246,12 +2249,15 @@ function getDevicesSelectMySQL(search_type, inv_code, dev_type, marca, is_PNRR,
2246
2249
  }
2247
2250
  if (is_PNRR && is_PNRR > 0) {
2248
2251
  where_clause += " (d.inv_pnrr_number <> '' and inv_pnrr_number is not null) ";
2249
- if (dev_status) {
2252
+ if (dev_status || dev_gestione) {
2250
2253
  where_clause += " and ";
2251
2254
  }
2252
2255
  }
2253
2256
  if (dev_status) {
2254
- where_clause += " du.status = :dev_status and CURRDATE() >= du.date_status";
2257
+ where_clause += " du.status = :dev_status and CURDATE() >= du.date_status";
2258
+ if (dev_gestione) {
2259
+ where_clause += " and ";
2260
+ }
2255
2261
  }
2256
2262
  if (dev_gestione) {
2257
2263
  where_clause += " dg.id_gestione = :dev_gestione and CURDATE() >= dg.date_start and CURDATE() <= dg.date_end";
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.62",
7
+ "version": "2.0.63",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",