alsmanager_lib 1.0.45 → 1.0.47
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 +18 -15
- 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
|
}
|
|
@@ -5680,16 +5682,12 @@ function getDocumentByIdDoc(db_used, id_doc) {
|
|
|
5680
5682
|
return query;
|
|
5681
5683
|
}
|
|
5682
5684
|
|
|
5683
|
-
function selectDocumentoByIdSQLite(id_doc) {
|
|
5684
|
-
|
|
5685
|
-
query += "where id = " + id_doc;
|
|
5686
|
-
return query;
|
|
5685
|
+
function selectDocumentoByIdSQLite(id_doc) {
|
|
5686
|
+
return getDocumentByIdDocSQLite(id_doc);
|
|
5687
5687
|
}
|
|
5688
5688
|
|
|
5689
5689
|
function selectDocumentoByIdMySQL(id_doc) {
|
|
5690
|
-
|
|
5691
|
-
query += "where id = :id_doc";
|
|
5692
|
-
return query;
|
|
5690
|
+
return getDocumentByIdDocMySQL(id_doc);
|
|
5693
5691
|
}
|
|
5694
5692
|
function selectDocumentoById(db_used, id_doc) {
|
|
5695
5693
|
var query = "";
|
|
@@ -5710,6 +5708,10 @@ function queryDocumentoTypes() {
|
|
|
5710
5708
|
return "select tipo, descrizione from documento_types order by tipo";
|
|
5711
5709
|
}
|
|
5712
5710
|
|
|
5711
|
+
function queryDocumentoMotivo() {
|
|
5712
|
+
return "select scopo, descrizione from documento_scopo order by scopo";
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5713
5715
|
function selectDocumentiComboSQLite(tipo, anno_emissione) {
|
|
5714
5716
|
var where_clause = "";
|
|
5715
5717
|
var query = "select id, concat(tipo, ' - ', descrizione, ' - ', data_emissione, ' - ', riferimento) as doc from documenti ";
|
|
@@ -7451,6 +7453,7 @@ module.exports = {
|
|
|
7451
7453
|
removeDocumento,
|
|
7452
7454
|
getDocumentByIdDoc,
|
|
7453
7455
|
queryDocumentoTypes,
|
|
7456
|
+
queryDocumentoMotivo,
|
|
7454
7457
|
checkDocumentoDevice,
|
|
7455
7458
|
selectDocumentoDeviceById,
|
|
7456
7459
|
//
|