alsmanager_lib 3.0.31 → 3.0.32
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 +56 -2
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -3474,6 +3474,58 @@ function queryDeviceById(db_used, id_device) {
|
|
|
3474
3474
|
}
|
|
3475
3475
|
return query;
|
|
3476
3476
|
}
|
|
3477
|
+
function queryDeviceForConsegneByIdSQLite(id_device) {
|
|
3478
|
+
var query = "SELECT d.id, d.type as Tipo, ";
|
|
3479
|
+
query += "d.manifacturer as Marca, d.model as Modello, ";
|
|
3480
|
+
query += "d.manifacturer as Marca, d.model as Modello, ";
|
|
3481
|
+
query += "case ";
|
|
3482
|
+
query += "when d.no_inventario is not null and d.no_inventario > 0 then concat(d.id, '(ID)') ";
|
|
3483
|
+
query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number) ";
|
|
3484
|
+
query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number, '(TN)') ";
|
|
3485
|
+
query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
|
|
3486
|
+
query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
|
|
3487
|
+
query += "else concat(d.id, '(ID)') "
|
|
3488
|
+
query += "end as Codice, ";
|
|
3489
|
+
query += "d.note, d.num_objects, d.no_inventario from devices d ";
|
|
3490
|
+
query += "where d.id = " + id_device;
|
|
3491
|
+
return query;
|
|
3492
|
+
}
|
|
3493
|
+
function queryDeviceForConsegneByIdMySQL(id_device) {
|
|
3494
|
+
var query = "SELECT d.id, d.type as Tipo, ";
|
|
3495
|
+
query += "d.manifacturer as Marca, d.model as Modello, ";
|
|
3496
|
+
query += "case ";
|
|
3497
|
+
query += "when d.no_inventario is not null and d.no_inventario > 0 then concat(d.id, '(ID)') ";
|
|
3498
|
+
query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number) ";
|
|
3499
|
+
query += "when d.inv_tn_number != '' and d.inv_tn_number is not null then concat(d.inv_tn_number, '(TN)') ";
|
|
3500
|
+
query += "when d.inv_tndigit_number != '' and d.inv_tndigit_number is not null then concat(d.inv_tndigit_number,'(TNDigit)') ";
|
|
3501
|
+
query += "when d.serial_no != '' and d.serial_no is not null then concat(d.serial_no,'(S/N)') ";
|
|
3502
|
+
query += "else concat(d.id, '(ID)') "
|
|
3503
|
+
query += "end as Codice, ";
|
|
3504
|
+
query += "d.note, d.num_objects, d.no_inventario from devices d ";
|
|
3505
|
+
query += "where d.id = :id_device";
|
|
3506
|
+
return query;
|
|
3507
|
+
}
|
|
3508
|
+
function queryDeviceForConsegneById(db_used, id_device) {
|
|
3509
|
+
var query = "";
|
|
3510
|
+
if (db_used) {
|
|
3511
|
+
switch (db_used) {
|
|
3512
|
+
case 'SQLITE':
|
|
3513
|
+
query = queryDeviceForConsegneByIdSQLite(id_device);
|
|
3514
|
+
break;
|
|
3515
|
+
case 'MYSQL':
|
|
3516
|
+
query = queryDeviceForConsegneByIdMySQL(id_device);
|
|
3517
|
+
break;
|
|
3518
|
+
case 'MYSQL2':
|
|
3519
|
+
query = queryDeviceForConsegneByIdSQLite(id_device);
|
|
3520
|
+
break;
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
return query;
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3526
|
+
|
|
3527
|
+
|
|
3528
|
+
|
|
3477
3529
|
//End Get Device by Id
|
|
3478
3530
|
//Get Device by Identificativo
|
|
3479
3531
|
function queryDeviceByIdentificativoSQLite(identificativo) {
|
|
@@ -7945,8 +7997,9 @@ function selectDeviceConsegna(db_used, id_consegna, id_device) {
|
|
|
7945
7997
|
return query;
|
|
7946
7998
|
}
|
|
7947
7999
|
|
|
8000
|
+
|
|
7948
8001
|
function selectDeviceInDepositoSQLite(inv_code) {
|
|
7949
|
-
var query = "SELECT d.id, d.type, d.manifacturer, d.model, ";
|
|
8002
|
+
var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
|
|
7950
8003
|
query += "case ";
|
|
7951
8004
|
query += "when inv_ict3_number != '' and inv_ict3_number is not null then inv_ict3_number ";
|
|
7952
8005
|
query += "when inv_pnrr_number != '' and inv_pnrr_number is not null then inv_pnrr_number ";
|
|
@@ -7966,7 +8019,7 @@ function selectDeviceInDepositoSQLite(inv_code) {
|
|
|
7966
8019
|
return query;
|
|
7967
8020
|
}
|
|
7968
8021
|
function selectDeviceInDepositoMySQL(inv_code) {
|
|
7969
|
-
var query = "SELECT d.id, d.type, d.manifacturer, d.model, ";
|
|
8022
|
+
var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
|
|
7970
8023
|
query += "case ";
|
|
7971
8024
|
query += "when inv_ict3_number != '' and inv_ict3_number is not null then inv_ict3_number ";
|
|
7972
8025
|
query += "when inv_pnrr_number != '' and inv_pnrr_number is not null then inv_pnrr_number ";
|
|
@@ -13750,6 +13803,7 @@ module.exports = {
|
|
|
13750
13803
|
getDevicesSelectBySite,
|
|
13751
13804
|
queryDeviceById,
|
|
13752
13805
|
queryDeviceByIdentificativo,
|
|
13806
|
+
queryDeviceForConsegneById,
|
|
13753
13807
|
getDevicesCounterBySite,
|
|
13754
13808
|
getDevicesCounterByPlace,
|
|
13755
13809
|
queryDeviceStatus,
|