alsmanager_lib 1.0.45 → 1.0.46
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 +15 -8
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -5300,7 +5300,7 @@ function queryLastDismissioneId(db_used) {
|
|
|
5300
5300
|
}
|
|
5301
5301
|
|
|
5302
5302
|
function selectDocumentiByIdDismissioneSQLite(id_dismiss) {
|
|
5303
|
-
var query = "select distinct doc.
|
|
5303
|
+
var query = "select distinct doc.id_doc, doc.descrizione, doc.data_emissione from device_dismissioni ds ";
|
|
5304
5304
|
query += "join devices d on d.id = ds.id_device ";
|
|
5305
5305
|
query += "join device_doc dc on dc.id_device = ds.id_device ";
|
|
5306
5306
|
query += "join dismissioni dm on dm.id = ds.id_dismissione ";
|
|
@@ -5578,25 +5578,27 @@ function insertDocumentoDevice(db_used, id_device, id_doc, scopo) {
|
|
|
5578
5578
|
}
|
|
5579
5579
|
|
|
5580
5580
|
|
|
5581
|
-
function removeDocumentoDeviceSQLite(
|
|
5581
|
+
function removeDocumentoDeviceSQLite(id_device, id_doc) {
|
|
5582
5582
|
var query = "delete from device_doc ";
|
|
5583
|
-
query += "where
|
|
5583
|
+
query += "where id_device = " + id_device + " and ";
|
|
5584
|
+
query += "id_doc = " + id_doc;
|
|
5584
5585
|
return query;
|
|
5585
5586
|
}
|
|
5586
|
-
function removeDocumentoDeviceMySQL(
|
|
5587
|
+
function removeDocumentoDeviceMySQL(id_device, id_doc) {
|
|
5587
5588
|
var query = "delete from device_doc ";
|
|
5588
|
-
query += "where
|
|
5589
|
+
query += "where id_device = :id_device and ";
|
|
5590
|
+
query += "id_doc = :id_doc";
|
|
5589
5591
|
return query;
|
|
5590
5592
|
}
|
|
5591
|
-
function removeDocumentoDevice(db_used,
|
|
5593
|
+
function removeDocumentoDevice(db_used, id_device, id_doc) {
|
|
5592
5594
|
var query = "";
|
|
5593
5595
|
if (db_used) {
|
|
5594
5596
|
switch (db_used) {
|
|
5595
5597
|
case 'SQLITE':
|
|
5596
|
-
query = removeDocumentoDeviceSQLite(
|
|
5598
|
+
query = removeDocumentoDeviceSQLite(id_device, id_doc);
|
|
5597
5599
|
break;
|
|
5598
5600
|
case 'MYSQL':
|
|
5599
|
-
query = removeDocumentoDeviceMySQL(
|
|
5601
|
+
query = removeDocumentoDeviceMySQL(id_device, id_doc);
|
|
5600
5602
|
break;
|
|
5601
5603
|
}
|
|
5602
5604
|
}
|
|
@@ -5710,6 +5712,10 @@ function queryDocumentoTypes() {
|
|
|
5710
5712
|
return "select tipo, descrizione from documento_types order by tipo";
|
|
5711
5713
|
}
|
|
5712
5714
|
|
|
5715
|
+
function queryDocumentoMotivo() {
|
|
5716
|
+
return "select scopo, descrizione from documento_scopo order by scopo";
|
|
5717
|
+
}
|
|
5718
|
+
|
|
5713
5719
|
function selectDocumentiComboSQLite(tipo, anno_emissione) {
|
|
5714
5720
|
var where_clause = "";
|
|
5715
5721
|
var query = "select id, concat(tipo, ' - ', descrizione, ' - ', data_emissione, ' - ', riferimento) as doc from documenti ";
|
|
@@ -7451,6 +7457,7 @@ module.exports = {
|
|
|
7451
7457
|
removeDocumento,
|
|
7452
7458
|
getDocumentByIdDoc,
|
|
7453
7459
|
queryDocumentoTypes,
|
|
7460
|
+
queryDocumentoMotivo,
|
|
7454
7461
|
checkDocumentoDevice,
|
|
7455
7462
|
selectDocumentoDeviceById,
|
|
7456
7463
|
//
|