alsmanager_lib 3.0.197 → 3.0.199

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 +13 -3
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -16418,7 +16418,7 @@ CREATE TABLE "printer_stampe_user" (
16418
16418
  */
16419
16419
 
16420
16420
  function selectPrinters(id_place, only_external) {
16421
- var query = "select d.id, concat(d.manifacturer, ' - ', d.model, ' (', p.name, ' - ', sd.name, ' - p.no : ', s.floor, ')') as descrizione, ";
16421
+ var query = "select distinct d.id, concat(d.manifacturer, ' - ', d.model, ' (', p.name, ' - ', sd.name, ' - p.no : ', s.floor, ')') as descrizione, ";
16422
16422
  query += "case ";
16423
16423
  query += "when dg.id is not null then gf.name ";
16424
16424
  query += "else 'Interno' ";
@@ -16458,6 +16458,16 @@ function readCountersPrinter(id_device) {
16458
16458
  return query;
16459
16459
  }
16460
16460
 
16461
+ function readCountersPrinterBeforeDate(id_device, operazione, date_ref) {
16462
+ var dr_str = convertDateToStringDB(date_ref);
16463
+ var query = "select id, id_device, date_read, operation, num_bw, num_colors from printer_counters ";
16464
+ query += "where id_device = " + id_device + " ";
16465
+ query += "and operazione = '" + operazione + "' ";
16466
+ query += "and date_read < '" + dr_str + "' ";
16467
+ query += "order by date_read desc limit 1";
16468
+ return query;
16469
+ }
16470
+
16461
16471
  function writeCountersPrinter(id_device, date_read, operation, num_bw, num_colors) {
16462
16472
  var dr_str = convertDateToStringDB(date_read);
16463
16473
  var query = "insert into printer_counters (id_device, date_read, operation, num_bw, num_colors) values (";
@@ -16465,10 +16475,9 @@ function writeCountersPrinter(id_device, date_read, operation, num_bw, num_color
16465
16475
  return query;
16466
16476
  }
16467
16477
 
16468
- function updateCountersPrinter(id_prnread, id_device, date_read, operation, num_bw, num_colors, ) {
16478
+ function updateCountersPrinter(id_prnread, date_read, operation, num_bw, num_colors) {
16469
16479
  var dr_str = convertDateToStringDB(date_read);
16470
16480
  var query = "update printer_counters set ";
16471
- query += "id_device = " + id_device + ", ";
16472
16481
  query += "date_read = '" + dr_str + "',";
16473
16482
  query += "operation = '" + operation + "', ";
16474
16483
  query += "num_bw = " + num_bw + ", ";
@@ -17020,6 +17029,7 @@ module.exports = {
17020
17029
  selectPrinters,
17021
17030
  selectCountersPrinters,
17022
17031
  readCountersPrinter,
17032
+ readCountersPrinterBeforeDate,
17023
17033
  writeCountersPrinter,
17024
17034
  updateCountersPrinter,
17025
17035
  deleteCountersPrinter,
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.197",
7
+ "version": "3.0.199",
8
8
  "description": "Funzioni per ALSManager",
9
9
  "license": "ISC",
10
10
  "author": "Luca Cattani",