alsmanager_lib 1.0.17 → 1.0.19

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 +20 -2
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -2530,7 +2530,7 @@ function getBeniConsumoByIdDeviceMySQL(id_device) {
2530
2530
  function selectDismissioniByYearSQLite(sel_year) {
2531
2531
  var query = "select id, data, descrizione from dismissioni ";
2532
2532
  if (sel_year && sel_year > 0) {
2533
- query += "where data >= concat(" + sel_year + ", '-01-01') && data <= concat(" + sel_year + ", '-12-31')";
2533
+ query += "where data >= concat(" + sel_year + ", '-01-01') and data <= concat(" + sel_year + ", '-12-31')";
2534
2534
  }
2535
2535
  return query;
2536
2536
  }
@@ -2538,7 +2538,7 @@ function selectDismissioniByYearSQLite(sel_year) {
2538
2538
  function selectDismissioniByYearMySQL(sel_year) {
2539
2539
  var query = "select id, data, descrizione from dismissioni ";
2540
2540
  if (sel_year && sel_year > 0) {
2541
- query += "where data >= concat(:sel_year, '-01-01') && data <= concat(:sel_year, '-12-31')";
2541
+ query += "where data >= concat(:sel_year, '-01-01') and data <= concat(:sel_year, '-12-31')";
2542
2542
  }
2543
2543
  return query;
2544
2544
  }
@@ -2923,6 +2923,23 @@ function loadMotivoDismissioneCombo() {
2923
2923
  var query = "select id, descrizione from motivo_dismissione ";
2924
2924
  return query;
2925
2925
  }
2926
+
2927
+ function loadDeviceDaDismettereCombo() {
2928
+ var query = "SELECT dm.id, ";
2929
+ query += "case ";
2930
+ query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number, ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
2931
+ query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number, '(TN)', ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
2932
+ query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)', ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
2933
+ query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)', ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
2934
+ query += "else '' "
2935
+ query += "end as Descrizione ";
2936
+ query += "from device_dismissioni dm ";
2937
+ query += "join devices d on dm.id_device = d.id ";
2938
+ query += "where (dm.id_dismissione is null or dm.id_dismissione = 0) "
2939
+ query += "order by d.inv_ict3_number";
2940
+ return query;
2941
+ }
2942
+
2926
2943
  //End manage dismissioni
2927
2944
 
2928
2945
 
@@ -4223,6 +4240,7 @@ module.exports = {
4223
4240
  selectDismissioneDevicesByIdDismiss,
4224
4241
  loadDismissioniAttiveCombo,
4225
4242
  loadMotivoDismissioneCombo,
4243
+ loadDeviceDaDismettereCombo,
4226
4244
  //
4227
4245
  assignCategoryFromDBSQLite,
4228
4246
  assignCategoryFromDBMySQL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alsmanager_lib",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Funzioni per ALSManager",
5
5
  "license": "ISC",
6
6
  "author": "Luca Cattani",