alsmanager_lib 3.0.227 → 3.0.229

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 +85 -2
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -13223,7 +13223,7 @@ function updateSiteDestination(id_site, id_place, date_start, date_end, name, fu
13223
13223
  return query;
13224
13224
  }
13225
13225
 
13226
- function updateSiteDestinationAfterMove(id_site, id_place, date_start, name, funzione, date_start_ref) {
13226
+ function updateSiteDestinationAfterMoveSQLite(id_site, id_place, date_start, name, funzione, date_start_ref) {
13227
13227
  var dt_end = convertDateToStringDB(date_start_ref);
13228
13228
  var dt_start = convertDateToStringDB(date_start);
13229
13229
  var query = "update site_destinations set ";
@@ -13234,6 +13234,34 @@ function updateSiteDestinationAfterMove(id_site, id_place, date_start, name, fun
13234
13234
  return query;
13235
13235
  }
13236
13236
 
13237
+ function updateSiteDestinationAfterMoveMySQL2(id_site, id_place, date_start, name, funzione, date_start_ref) {
13238
+ var dt_end = convertDateToStringDB(date_start_ref);
13239
+ var dt_start = convertDateToStringDB(date_start);
13240
+ var query = "update site_destinations set ";
13241
+ query += "date_end = DATE_SUB('" + dt_end + "', INTERVAL 1 DAY) ";
13242
+ query += "where id_site = " + id_site + " and id_place = '" + id_place + "' ";
13243
+ query += "and date_start = '" + dt_start + "' ";
13244
+ query += "and name = '" + name + "' and type = '" + funzione + "'";
13245
+ return query;
13246
+ }
13247
+
13248
+ function updateSiteDestinationAfterMove(db_used, id_site, id_place, date_start, name, funzione, date_start_ref) {
13249
+ var query = "";
13250
+ if (db_used) {
13251
+ switch (db_used) {
13252
+ case 'SQLITE':
13253
+ query = updateSiteDestinationAfterMoveSQLite(id_site, id_place, date_start, name, funzione, date_start_ref);
13254
+ break;
13255
+ case 'MYSQL':
13256
+ break;
13257
+ case 'MYSQL2':
13258
+ query = updateSiteDestinationAfterMoveMySQL2(id_site, id_place, date_start, name, funzione, date_start_ref);
13259
+ break;
13260
+ }
13261
+ }
13262
+ return query;
13263
+ }
13264
+
13237
13265
  function getSiteDestinationsByIdSite(id_site, id_place) {
13238
13266
  var query = "select date_start, date_end, name, type from site_destinations ";
13239
13267
  query += "where id_site = " + id_site + " and id_place = '" + id_place + "' ";
@@ -14388,7 +14416,7 @@ function updateSiteBySetMySQL(id_device) {
14388
14416
  return query;
14389
14417
  }
14390
14418
  function updateSiteBySetMySQL2(id_device) {
14391
- var query = "update device_site set date_out = date('now','-1 day'), date_in = date('now','-1 day') where id_device in "
14419
+ var query = "update device_site set date_out = DATE_SUB(CURDATE(), INTERVAL 1 DAY), date_in = DATE_SUB(CURDATE(), INTERVAL 1 DAY) where id_device in "
14392
14420
  query += "(select dt.id_relateddevice from device_set dt ";
14393
14421
  query += "where dt.id_maindevice = " + id_device + ") ";
14394
14422
  query += "and CURDATE() >= date_in and CURDATE() <= date_out"
@@ -17345,6 +17373,61 @@ function deleteCountersPrinterRechargeUser(id_counteruser) {
17345
17373
  return query;
17346
17374
  }
17347
17375
 
17376
+ function selectPrinterCartridges() {
17377
+ /*
17378
+ -- ALS.printer_cartridges definition
17379
+
17380
+ CREATE TABLE `printer_cartridges` (
17381
+ `id` int(11) NOT NULL AUTO_INCREMENT,
17382
+ `tipo` text NOT NULL,
17383
+ `marca` varchar(50) DEFAULT NULL,
17384
+ `descrizione` varchar(50) DEFAULT NULL,
17385
+ `color` char(20) DEFAULT NULL,
17386
+ `numero` int(11) NOT NULL,
17387
+ `data_ultimo` char(10) NOT NULL,
17388
+ `note` varchar(100) DEFAULT NULL,
17389
+ PRIMARY KEY (`id`)
17390
+ ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
17391
+ */
17392
+ }
17393
+
17394
+ function selectPrinterCartridgeById(id_cart) {
17395
+
17396
+ }
17397
+
17398
+ function insertPrinterCartridge() {
17399
+
17400
+ }
17401
+
17402
+ function updatePrinterCartridge(id_cart) {
17403
+
17404
+ }
17405
+
17406
+ function removePrinterCartridge(id_cart) {
17407
+
17408
+ }
17409
+
17410
+ function installPrinterCartridge(id_cart, id_device, date_install) {
17411
+ /*
17412
+ -- ALS.printer_cartridges definition
17413
+
17414
+ CREATE TABLE `printer_cartridges` (
17415
+ `id` int(11) NOT NULL AUTO_INCREMENT,
17416
+ `tipo` text NOT NULL,
17417
+ `marca` varchar(50) DEFAULT NULL,
17418
+ `descrizione` varchar(50) DEFAULT NULL,
17419
+ `color` char(20) DEFAULT NULL,
17420
+ `numero` int(11) NOT NULL,
17421
+ `data_ultimo` char(10) NOT NULL,
17422
+ `note` varchar(100) DEFAULT NULL,
17423
+ PRIMARY KEY (`id`)
17424
+ ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
17425
+ */
17426
+
17427
+ }
17428
+
17429
+
17430
+
17348
17431
 
17349
17432
  // End Printer management
17350
17433
  // Notes for devices
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.227",
7
+ "version": "3.0.229",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",