alsmanager_lib 2.0.23 → 2.0.25
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 +162 -0
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -3347,6 +3347,167 @@ function getBeniDaInventari(db_used, table_name, inv_code, include_imp, is_pnrr,
|
|
|
3347
3347
|
}
|
|
3348
3348
|
return query;
|
|
3349
3349
|
}
|
|
3350
|
+
//
|
|
3351
|
+
function getBeniDaInventariNonAllocatiSQLite(table_name, is_pnrr, is_dismissione) {
|
|
3352
|
+
var query = "";
|
|
3353
|
+
if (table_name && table_name != '') {
|
|
3354
|
+
if (table_name == "ImportRevisione2024") {
|
|
3355
|
+
query = "Select ";
|
|
3356
|
+
query += "inv_ict3 as Inventario, ";
|
|
3357
|
+
query += "ex_inv as Precedente, ";
|
|
3358
|
+
query += "descrizione_bene as Descrizione, ";
|
|
3359
|
+
query += "collocazione as Luogo, ";
|
|
3360
|
+
query += "sede as Plesso, ";
|
|
3361
|
+
query += "marca as 'Marca bene', ";
|
|
3362
|
+
query += "modello_serie as Modello, ";
|
|
3363
|
+
query += "targa_matricola as Matricola, ";
|
|
3364
|
+
query += "data_presa_in_carico as 'Data acq.', ";
|
|
3365
|
+
query += "prezzo as Costo, ";
|
|
3366
|
+
query += "data_scarico as 'Data scarico', ";
|
|
3367
|
+
query += "concat(imp.NOTE, ' ', NOTE_2, ' ', NOTE_3, ' ', NOTE_4, ' ', NOTE_5, ' ', NOTE_6, ' ', NOTE_7, ' ', NOTE_8) as 'Note bene' ";
|
|
3368
|
+
query += "from " + table_name + " imp ";
|
|
3369
|
+
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3370
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3371
|
+
query += "where ds.id is null and d.id is not null"
|
|
3372
|
+
}
|
|
3373
|
+
else if (table_name == "devices") {
|
|
3374
|
+
query = getDevicesSelectForInventarioRawSQLite(inv_code);
|
|
3375
|
+
}
|
|
3376
|
+
else if (is_pnrr == 1) {
|
|
3377
|
+
query = "Select ";
|
|
3378
|
+
query += "inventario as Inventario, ";
|
|
3379
|
+
query += "Tipo, ";
|
|
3380
|
+
query += "marca as 'Marca bene', ";
|
|
3381
|
+
query += "Descrizione, ";
|
|
3382
|
+
query += "Plesso as Luogo ";
|
|
3383
|
+
query += "from " + table_name + " imp ";
|
|
3384
|
+
query += "left join devices d on imp.inventario = d.inv_ict3_number "
|
|
3385
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3386
|
+
query += "where ds.id is null and d.id is not null"
|
|
3387
|
+
}
|
|
3388
|
+
else if (is_dismissione == 1) {
|
|
3389
|
+
query = "Select ";
|
|
3390
|
+
query += "inv_ict3 as Inventario, ";
|
|
3391
|
+
query += "Descrizione, ";
|
|
3392
|
+
query += "Plesso, ";
|
|
3393
|
+
query += "Costo, ";
|
|
3394
|
+
query += "Note as 'Note bene' ";
|
|
3395
|
+
query += "from " + table_name + " imp ";
|
|
3396
|
+
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3397
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3398
|
+
query += "where ds.id is null and d.id is not null"
|
|
3399
|
+
}
|
|
3400
|
+
else {
|
|
3401
|
+
query = "Select ";
|
|
3402
|
+
query += "inv_ict3 as Inventario, ";
|
|
3403
|
+
query += "ex_inventario as Precedente, ";
|
|
3404
|
+
query += "descrizione_bene as Descrizione, ";
|
|
3405
|
+
query += "collocazione as Luogo, ";
|
|
3406
|
+
query += "sede as Plesso, ";
|
|
3407
|
+
query += "marca as 'Marca bene', ";
|
|
3408
|
+
query += "modello_serie as Modello, ";
|
|
3409
|
+
query += "targa_matricola as Matricola, ";
|
|
3410
|
+
query += "data_presa_in_carico as 'Data acq.', ";
|
|
3411
|
+
query += "prezzo as Costo, ";
|
|
3412
|
+
query += "data_scarico as 'Data scarico', ";
|
|
3413
|
+
query += "concat(imp.note, ' ', note_2, ' ', note_3) as 'Note bene' ";
|
|
3414
|
+
query += "from " + table_name + " imp ";
|
|
3415
|
+
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3416
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3417
|
+
query += "where ds.id is null and d.id is not null"
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
return query;
|
|
3421
|
+
|
|
3422
|
+
}
|
|
3423
|
+
function getBeniDaInventariNonAllocatiMySQL(table_name, is_pnrr, is_dismissione) {
|
|
3424
|
+
if (table_name && table_name != '') {
|
|
3425
|
+
if (table_name == "ImportRevisione2024") {
|
|
3426
|
+
query = "Select ";
|
|
3427
|
+
query += "inv_ict3 as Inventario, ";
|
|
3428
|
+
query += "ex_inv as Precedente, ";
|
|
3429
|
+
query += "descrizione_bene as Descrizione, ";
|
|
3430
|
+
query += "collocazione as Luogo, ";
|
|
3431
|
+
query += "sede as Plesso, ";
|
|
3432
|
+
query += "marca as 'Marca bene', ";
|
|
3433
|
+
query += "modello_serie as Modello, ";
|
|
3434
|
+
query += "targa_matricola as Matricola, ";
|
|
3435
|
+
query += "data_presa_in_carico as 'Data acq.', ";
|
|
3436
|
+
query += "prezzo as Costo, ";
|
|
3437
|
+
query += "data_scarico as 'Data scarico', ";
|
|
3438
|
+
query += "concat(imp.NOTE, ' ', NOTE_2, ' ', NOTE_3, ' ', NOTE_4, ' ', NOTE_5, ' ', NOTE_6, ' ', NOTE_7, ' ', NOTE_8) as 'Note bene' ";
|
|
3439
|
+
query += "from :table_name imp ";
|
|
3440
|
+
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3441
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3442
|
+
query += "where ds.id is null and d.id is not null"
|
|
3443
|
+
}
|
|
3444
|
+
else if (table_name == "devices") {
|
|
3445
|
+
query = getDevicesSelectForInventarioRawMySQL(inv_code);
|
|
3446
|
+
}
|
|
3447
|
+
else if (is_pnrr == 1) {
|
|
3448
|
+
query = "Select ";
|
|
3449
|
+
query += "inventario as Inventario, ";
|
|
3450
|
+
query += "Tipo, ";
|
|
3451
|
+
query += "marca as 'Marca bene', ";
|
|
3452
|
+
query += "Descrizione, ";
|
|
3453
|
+
query += "Plesso as Luogo ";
|
|
3454
|
+
query += "from :table_name imp ";
|
|
3455
|
+
query += "left join devices d on imp.inventario = d.inv_ict3_number "
|
|
3456
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3457
|
+
query += "where ds.id is null and d.id is not null"
|
|
3458
|
+
}
|
|
3459
|
+
else if (is_dismissione == 1) {
|
|
3460
|
+
query = "Select ";
|
|
3461
|
+
query += "inv_ict3 as Inventario, ";
|
|
3462
|
+
query += "Descrizione, ";
|
|
3463
|
+
query += "Plesso, ";
|
|
3464
|
+
query += "Costo, ";
|
|
3465
|
+
query += "Note as 'Note bene' ";
|
|
3466
|
+
query += "from :table_name imp ";
|
|
3467
|
+
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3468
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3469
|
+
query += "where ds.id is null and d.id is not null"
|
|
3470
|
+
}
|
|
3471
|
+
else {
|
|
3472
|
+
query = "Select ";
|
|
3473
|
+
query += "inv_ict3 as Inventario, ";
|
|
3474
|
+
query += "ex_inventario as Precedente, ";
|
|
3475
|
+
query += "descrizione_bene as Descrizione, ";
|
|
3476
|
+
query += "collocazione as Luogo, ";
|
|
3477
|
+
query += "sede as Plesso, ";
|
|
3478
|
+
query += "marca as 'Marca bene', ";
|
|
3479
|
+
query += "modello_serie as Modello, ";
|
|
3480
|
+
query += "targa_matricola as Matricola, ";
|
|
3481
|
+
query += "data_presa_in_carico as 'Data acq.', ";
|
|
3482
|
+
query += "prezzo as Costo, ";
|
|
3483
|
+
query += "data_scarico as 'Data scarico', ";
|
|
3484
|
+
query += "concat(imp.note, ' ', note_2, ' ', note_3) as 'Note bene' ";
|
|
3485
|
+
query += "from :table_name imp ";
|
|
3486
|
+
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3487
|
+
query += "left join device_site ds on d.id = ds.id_device "
|
|
3488
|
+
query += "where ds.id is null and d.id is not null"
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3492
|
+
return query;
|
|
3493
|
+
}
|
|
3494
|
+
function getBeniDaInventariNonAllocati(db_used, table_name, is_pnrr, is_dismissione) {
|
|
3495
|
+
var query = "";
|
|
3496
|
+
if (db_used) {
|
|
3497
|
+
switch (db_used) {
|
|
3498
|
+
case 'SQLITE':
|
|
3499
|
+
query = getBeniDaInventariNonAllocatiSQLite(table_name, table_name, is_pnrr, is_dismissione);
|
|
3500
|
+
break;
|
|
3501
|
+
case 'MYSQL':
|
|
3502
|
+
query = getBeniDaInventariNonAllocatiMySQL(table_name, table_name, is_pnrr, is_dismissione);
|
|
3503
|
+
break;
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
return query;
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
//
|
|
3510
|
+
|
|
3350
3511
|
// Su modello
|
|
3351
3512
|
function getBeniDaInventariOnDescriptionSQLite(table_name, search_string, include_imp, is_pnrr, is_dismissione) {
|
|
3352
3513
|
var query = "";
|
|
@@ -9397,6 +9558,7 @@ module.exports = {
|
|
|
9397
9558
|
insertDeviceSiteFromInventario,
|
|
9398
9559
|
getBeniDaInventari,
|
|
9399
9560
|
getBeniDaInventariOnDescription,
|
|
9561
|
+
getBeniDaInventariNonAllocati,
|
|
9400
9562
|
getNetworksOnDevice,
|
|
9401
9563
|
getImportedPropertiesByIdDevice,
|
|
9402
9564
|
getSetInfoByIdSet,
|