alsmanager_lib 3.0.229 → 3.0.231
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.
- package/lib/modules.js +79 -15
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -17105,6 +17105,7 @@ function removeDismissioneAltroBeneFromDismissione(db_used, id_benedismiss, id_d
|
|
|
17105
17105
|
|
|
17106
17106
|
|
|
17107
17107
|
//End Manage altri beni
|
|
17108
|
+
//Manage Maps
|
|
17108
17109
|
function getMapScript(map_tag) {
|
|
17109
17110
|
var text = "<script>";
|
|
17110
17111
|
text += "(function($scope) {";
|
|
@@ -17192,6 +17193,25 @@ function getMapPointsById(id_point) {
|
|
|
17192
17193
|
query += "where id = " + id_point;
|
|
17193
17194
|
return query;
|
|
17194
17195
|
}
|
|
17196
|
+
|
|
17197
|
+
function getMapByPlaceAndFloor(id_place, floor) {
|
|
17198
|
+
var query = "select id, id_place, piano, initial_zoom, filename from maps ";
|
|
17199
|
+
query += "where id_place = '" + id_place + "' ";
|
|
17200
|
+
query += "and piano = " + floor + " ";
|
|
17201
|
+
query += "limit 1";
|
|
17202
|
+
return query;
|
|
17203
|
+
}
|
|
17204
|
+
|
|
17205
|
+
function getMapLastRefByIdMap(id_map) {
|
|
17206
|
+
var query = "select date_ref from maps_cronology ";
|
|
17207
|
+
query += "where id_map = " + id_map + " ";
|
|
17208
|
+
query += "order by date_ref desc ";
|
|
17209
|
+
query += "limit 1";
|
|
17210
|
+
return query;
|
|
17211
|
+
}
|
|
17212
|
+
|
|
17213
|
+
|
|
17214
|
+
//End Manage Maps
|
|
17195
17215
|
// Printer management
|
|
17196
17216
|
/*
|
|
17197
17217
|
CREATE TABLE "printer_cost_per_copy" (
|
|
@@ -17384,46 +17404,81 @@ CREATE TABLE `printer_cartridges` (
|
|
|
17384
17404
|
`descrizione` varchar(50) DEFAULT NULL,
|
|
17385
17405
|
`color` char(20) DEFAULT NULL,
|
|
17386
17406
|
`numero` int(11) NOT NULL,
|
|
17387
|
-
`
|
|
17407
|
+
`data_ultimo_acq` char(10) NOT NULL,
|
|
17388
17408
|
`note` varchar(100) DEFAULT NULL,
|
|
17389
17409
|
PRIMARY KEY (`id`)
|
|
17390
17410
|
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
17391
17411
|
*/
|
|
17412
|
+
var query = "select id, tipo, marca, modello, color, numero, data_ultimo_acq, note from printer_cartridges ";
|
|
17413
|
+
query += "order by marca, modello";
|
|
17414
|
+
return query;
|
|
17392
17415
|
}
|
|
17393
17416
|
|
|
17394
17417
|
function selectPrinterCartridgeById(id_cart) {
|
|
17395
|
-
|
|
17418
|
+
var query = "select id, tipo, marca, modello, color, numero, data_ultimo_acq, note from printer_cartridges ";
|
|
17419
|
+
query += "where id = " + id_cart;
|
|
17420
|
+
return query;
|
|
17396
17421
|
}
|
|
17397
17422
|
|
|
17398
|
-
function insertPrinterCartridge() {
|
|
17423
|
+
function insertPrinterCartridge(tipo, marca, modello, color, numero, data_ultimo_acq, note) {
|
|
17424
|
+
var query = "insert into printer_cartridges (tipo, marca, modello, color, numero, data_ultimo_acq, note) values ";
|
|
17425
|
+
query += "(";
|
|
17426
|
+
query += "'" + tipo + "', ";
|
|
17427
|
+
query += "'" + marca + "', ";
|
|
17428
|
+
query += "'" + modello + "', ";
|
|
17429
|
+
query += "'" + color + "', ";
|
|
17430
|
+
query += numero + ", ";
|
|
17431
|
+
query += "'" + data_ultimo_acq + "', ";
|
|
17432
|
+
query += "'" + note + "' ";
|
|
17433
|
+
query += ")";
|
|
17434
|
+
return query;
|
|
17399
17435
|
|
|
17400
17436
|
}
|
|
17401
17437
|
|
|
17402
|
-
function updatePrinterCartridge(id_cart) {
|
|
17403
|
-
|
|
17438
|
+
function updatePrinterCartridge(id_cart, tipo, marca, modello, color, numero, data_ultimo_acq, note) {
|
|
17439
|
+
var query = "update printer_cartridges tipo, marca, modello, color, numero, data_ultimo_acq, note ";
|
|
17440
|
+
var dt_ultimo_acq_str = convertDateToStringDB(data_ultimo_acq);
|
|
17441
|
+
query += "set ";
|
|
17442
|
+
query += "tipo = '" + tipo + "', ";
|
|
17443
|
+
query += "marca = '" + marca + "', ";
|
|
17444
|
+
query += "modello = '" + modello + "', ";
|
|
17445
|
+
query += "color = '" + color + "', ";
|
|
17446
|
+
query += "numero = " + numero + ", ";
|
|
17447
|
+
query += "data_ultimo_acq = '" + dt_ultimo_acq_str + "', ";
|
|
17448
|
+
query += "note = '" + note + "' ";
|
|
17449
|
+
query += "where id = " + id_cart;
|
|
17450
|
+
return query;
|
|
17404
17451
|
}
|
|
17405
17452
|
|
|
17406
17453
|
function removePrinterCartridge(id_cart) {
|
|
17454
|
+
var query = "delete from printer_cartridges ";
|
|
17455
|
+
query += "where id = " + id_cart;
|
|
17456
|
+
return query;
|
|
17407
17457
|
|
|
17408
17458
|
}
|
|
17409
17459
|
|
|
17410
17460
|
function installPrinterCartridge(id_cart, id_device, date_install) {
|
|
17411
17461
|
/*
|
|
17412
|
-
-- ALS.
|
|
17462
|
+
-- ALS.printer_cart_install definition
|
|
17413
17463
|
|
|
17414
|
-
CREATE TABLE `
|
|
17464
|
+
CREATE TABLE `printer_cart_install` (
|
|
17415
17465
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
17416
|
-
`
|
|
17417
|
-
`
|
|
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,
|
|
17466
|
+
`id_cart` int(11) DEFAULT NULL,
|
|
17467
|
+
`id_device` int(11) DEFAULT NULL,
|
|
17422
17468
|
`note` varchar(100) DEFAULT NULL,
|
|
17469
|
+
`date_install` char(10) DEFAULT NULL,
|
|
17423
17470
|
PRIMARY KEY (`id`)
|
|
17424
|
-
) ENGINE=InnoDB
|
|
17471
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
|
|
17425
17472
|
*/
|
|
17426
|
-
|
|
17473
|
+
var date_install_str = convertDateToStringDB(date_install);
|
|
17474
|
+
var query = "insert into printer_cart_install (id_cart, id_device, note, date_install) values ";
|
|
17475
|
+
query += "(";
|
|
17476
|
+
query += id_cart + ", ";
|
|
17477
|
+
query += id_device + ", ";
|
|
17478
|
+
query += "'" + note + "', ";
|
|
17479
|
+
query += "'" + date_install_str + "' ";
|
|
17480
|
+
query += ")";
|
|
17481
|
+
return query;
|
|
17427
17482
|
}
|
|
17428
17483
|
|
|
17429
17484
|
|
|
@@ -17939,6 +17994,8 @@ module.exports = {
|
|
|
17939
17994
|
removeMapPointByPlace,
|
|
17940
17995
|
queryMapPointsByPlaceAndFloor,
|
|
17941
17996
|
getMapPointsById,
|
|
17997
|
+
getMapByPlaceAndFloor,
|
|
17998
|
+
getMapLastRefByIdMap,
|
|
17942
17999
|
//
|
|
17943
18000
|
selectPrinters,
|
|
17944
18001
|
selectCountersPrinters,
|
|
@@ -17956,6 +18013,13 @@ module.exports = {
|
|
|
17956
18013
|
updateCountersPrinterRechargeUser,
|
|
17957
18014
|
deleteCountersPrinterRechargeUser,
|
|
17958
18015
|
//
|
|
18016
|
+
selectPrinterCartridges,
|
|
18017
|
+
selectPrinterCartridgeById,
|
|
18018
|
+
insertPrinterCartridge,
|
|
18019
|
+
updatePrinterCartridge,
|
|
18020
|
+
removePrinterCartridge,
|
|
18021
|
+
installPrinterCartridge,
|
|
18022
|
+
//
|
|
17959
18023
|
getNotesByIdDevice
|
|
17960
18024
|
};
|
|
17961
18025
|
// end of source
|