alsmanager_lib 2.0.39 → 2.0.41

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 +17 -17
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2332,29 +2332,29 @@ function getDevicesSelectByPlaceSQLite(id_place, dev_type) {
2332
2332
  }
2333
2333
 
2334
2334
  function getDevicesSelectByPlaceMySQL(id_place, dev_type) {
2335
- var query = "select DISTINCT devices.id, devices.type as Tipo, devices.manifacturer as Marca, devices.model as modello, ";
2335
+ var query = "select DISTINCT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as modello, ";
2336
2336
  query += "case ";
2337
- query += "when inv_ict3_number != '' and inv_ict3_number is not null then inv_ict3_number ";
2338
- query += "when inv_pnrr_number != '' and inv_pnrr_number is not null then inv_pnrr_number ";
2339
- query += "when inv_tn_number != '' and inv_tn_number is not null then concat(inv_tn_number,'(TN)') ";
2340
- query += "when inv_tndigit_number != '' and inv_tndigit_number is not null then concat(inv_tndigit_number,'(TNDigit)') ";
2341
- query += "when serial_no != '' and serial_no is not null then concat(serial_no,'(S/N)') ";
2337
+ query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then d.inv_ict3_number ";
2338
+ query += "when d.inv_pnrr_number != '' and d.inv_pnrr_number is not null then d.inv_pnrr_number ";
2339
+ query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number,'(TN)') ";
2340
+ query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
2341
+ query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
2342
2342
  query += "end as Codice, ";
2343
2343
  query += "case ";
2344
- query += "when trim(inv_pnrr_number) is null then '' ";
2345
- query += "when trim(inv_pnrr_number) = '' then '' ";
2344
+ query += "when trim(d.inv_pnrr_number) is null then '' ";
2345
+ query += "when trim(d.inv_pnrr_number) = '' then '' ";
2346
2346
  query += "else 'SI' ";
2347
2347
  query += "end as PNRR ";
2348
- query += " from devices ";
2349
- query += "inner join device_site on device_site.id_device = devices.id ";
2350
- query += "inner join sites on sites.id = device_site.id_site ";
2351
- query += "where (CURDATE() >= device_site.date_in and CURDATE() <= device_site.date_out) ";
2352
- query += "and (devices.is_removed is null or devices.is_removed = 0) ";
2353
- query += "and sites.id_place = :id_place ";
2348
+ query += " from devices d ";
2349
+ query += "inner join device_site ds on ds.id_device = d.id ";
2350
+ query += "inner join sites s on s.id = ds.id_site ";
2351
+ query += "where (CURDATE() >= ds.date_in and CURDATE() <= ds.date_out) ";
2352
+ query += "and (d.is_removed is null or d.is_removed = 0) ";
2353
+ query += "and s.id_place = :id_place ";
2354
2354
  if (dev_type && dev_type != '') {
2355
- query += "and devices.type = :dev_type ";
2355
+ query += "and d.type = :dev_type ";
2356
2356
  }
2357
- query += "order by devices.type ";
2357
+ query += "order by d.type ";
2358
2358
  return query;
2359
2359
  }
2360
2360
  function getDevicesSelectByPlace(db_used, id_place, dev_type) {
@@ -7961,7 +7961,7 @@ function queryFunzioneByPlaceAndFloorMySQL(id_place, piano) {
7961
7961
  query += " JOIN sites s ON s.id = sd.id_site"
7962
7962
  if (id_place) {
7963
7963
  query += " where CURDATE() >= sd.date_start and CURDATE() <= sd.date_end";
7964
- query += " and sd.id_place = ':id_place'";
7964
+ query += " and sd.id_place = :id_place";
7965
7965
  if (piano) {
7966
7966
  query += " and s.floor = :piano";
7967
7967
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alsmanager_lib",
3
- "version": "2.0.39",
3
+ "version": "2.0.41",
4
4
  "description": "Funzioni per ALSManager",
5
5
  "license": "ISC",
6
6
  "author": "Luca Cattani",