alsmanager_lib 2.0.25 → 2.0.27
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 +75 -18
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -3368,7 +3368,7 @@ function getBeniDaInventariNonAllocatiSQLite(table_name, is_pnrr, is_dismissione
|
|
|
3368
3368
|
query += "from " + table_name + " imp ";
|
|
3369
3369
|
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3370
3370
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3371
|
-
query += "where ds.
|
|
3371
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3372
3372
|
}
|
|
3373
3373
|
else if (table_name == "devices") {
|
|
3374
3374
|
query = getDevicesSelectForInventarioRawSQLite(inv_code);
|
|
@@ -3383,7 +3383,7 @@ function getBeniDaInventariNonAllocatiSQLite(table_name, is_pnrr, is_dismissione
|
|
|
3383
3383
|
query += "from " + table_name + " imp ";
|
|
3384
3384
|
query += "left join devices d on imp.inventario = d.inv_ict3_number "
|
|
3385
3385
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3386
|
-
query += "where ds.
|
|
3386
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3387
3387
|
}
|
|
3388
3388
|
else if (is_dismissione == 1) {
|
|
3389
3389
|
query = "Select ";
|
|
@@ -3395,7 +3395,7 @@ function getBeniDaInventariNonAllocatiSQLite(table_name, is_pnrr, is_dismissione
|
|
|
3395
3395
|
query += "from " + table_name + " imp ";
|
|
3396
3396
|
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3397
3397
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3398
|
-
query += "where ds.
|
|
3398
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3399
3399
|
}
|
|
3400
3400
|
else {
|
|
3401
3401
|
query = "Select ";
|
|
@@ -3414,7 +3414,7 @@ function getBeniDaInventariNonAllocatiSQLite(table_name, is_pnrr, is_dismissione
|
|
|
3414
3414
|
query += "from " + table_name + " imp ";
|
|
3415
3415
|
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3416
3416
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3417
|
-
query += "where ds.
|
|
3417
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3418
3418
|
}
|
|
3419
3419
|
}
|
|
3420
3420
|
return query;
|
|
@@ -3439,7 +3439,7 @@ function getBeniDaInventariNonAllocatiMySQL(table_name, is_pnrr, is_dismissione)
|
|
|
3439
3439
|
query += "from :table_name imp ";
|
|
3440
3440
|
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3441
3441
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3442
|
-
query += "where ds.
|
|
3442
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3443
3443
|
}
|
|
3444
3444
|
else if (table_name == "devices") {
|
|
3445
3445
|
query = getDevicesSelectForInventarioRawMySQL(inv_code);
|
|
@@ -3454,7 +3454,7 @@ function getBeniDaInventariNonAllocatiMySQL(table_name, is_pnrr, is_dismissione)
|
|
|
3454
3454
|
query += "from :table_name imp ";
|
|
3455
3455
|
query += "left join devices d on imp.inventario = d.inv_ict3_number "
|
|
3456
3456
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3457
|
-
query += "where ds.
|
|
3457
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3458
3458
|
}
|
|
3459
3459
|
else if (is_dismissione == 1) {
|
|
3460
3460
|
query = "Select ";
|
|
@@ -3466,7 +3466,7 @@ function getBeniDaInventariNonAllocatiMySQL(table_name, is_pnrr, is_dismissione)
|
|
|
3466
3466
|
query += "from :table_name imp ";
|
|
3467
3467
|
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3468
3468
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3469
|
-
query += "where ds.
|
|
3469
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3470
3470
|
}
|
|
3471
3471
|
else {
|
|
3472
3472
|
query = "Select ";
|
|
@@ -3485,7 +3485,7 @@ function getBeniDaInventariNonAllocatiMySQL(table_name, is_pnrr, is_dismissione)
|
|
|
3485
3485
|
query += "from :table_name imp ";
|
|
3486
3486
|
query += "left join devices d on imp.inv_ict3 = d.inv_ict3_number "
|
|
3487
3487
|
query += "left join device_site ds on d.id = ds.id_device "
|
|
3488
|
-
query += "where ds.
|
|
3488
|
+
query += "where ds.id_site is null and d.id is not null"
|
|
3489
3489
|
}
|
|
3490
3490
|
}
|
|
3491
3491
|
|
|
@@ -4479,7 +4479,15 @@ function queryDeviceTypes() {
|
|
|
4479
4479
|
return query;
|
|
4480
4480
|
}
|
|
4481
4481
|
// Define getDevicesNotAllocatedCombo
|
|
4482
|
-
function getDevicesNotAllocatedComboSQLite(ordered_by) {
|
|
4482
|
+
function getDevicesNotAllocatedComboSQLite(sel_type, sel_maker, ordered_by) {
|
|
4483
|
+
var sel_type_str = "";
|
|
4484
|
+
if (sel_type) {
|
|
4485
|
+
sel_type_str = sel_type;
|
|
4486
|
+
}
|
|
4487
|
+
var sel_maker_str = "";
|
|
4488
|
+
if (sel_maker) {
|
|
4489
|
+
sel_maker_str = sel_maker;
|
|
4490
|
+
}
|
|
4483
4491
|
var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
|
|
4484
4492
|
query += "case ";
|
|
4485
4493
|
query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number, ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
|
|
@@ -4494,6 +4502,12 @@ function getDevicesNotAllocatedComboSQLite(ordered_by) {
|
|
|
4494
4502
|
query += "where (d.is_removed is null or d.is_removed = 0) "
|
|
4495
4503
|
query += "and (ds.id_place is null ";
|
|
4496
4504
|
query += "or (ds.date_in <= date('now') and ds.date_out >= date('now') and sd.type = 'MAGAZZINO')) ";
|
|
4505
|
+
if (sel_type_str.trim() != '') {
|
|
4506
|
+
query += "and d.type = '" + sel_type_str.trim() + "' ";
|
|
4507
|
+
}
|
|
4508
|
+
if (sel_maker_str.trim() != '') {
|
|
4509
|
+
query += "and d.manifacturer = '" + sel_maker_str.trim() + "' ";
|
|
4510
|
+
}
|
|
4497
4511
|
if (ordered_by && ordered_by == "ID") {
|
|
4498
4512
|
query += "order by d.id desc";
|
|
4499
4513
|
}
|
|
@@ -4503,7 +4517,15 @@ function getDevicesNotAllocatedComboSQLite(ordered_by) {
|
|
|
4503
4517
|
return query;
|
|
4504
4518
|
}
|
|
4505
4519
|
|
|
4506
|
-
function getDevicesNotAllocatedComboMySQL(ordered_by) {
|
|
4520
|
+
function getDevicesNotAllocatedComboMySQL(sel_type, sel_maker,ordered_by) {
|
|
4521
|
+
var sel_type_str = "";
|
|
4522
|
+
if (sel_type) {
|
|
4523
|
+
sel_type_str = sel_type;
|
|
4524
|
+
}
|
|
4525
|
+
var sel_maker_str = "";
|
|
4526
|
+
if (sel_maker) {
|
|
4527
|
+
sel_maker_str = sel_maker;
|
|
4528
|
+
}
|
|
4507
4529
|
var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
|
|
4508
4530
|
query += "case ";
|
|
4509
4531
|
query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number, ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
|
|
@@ -4518,6 +4540,12 @@ function getDevicesNotAllocatedComboMySQL(ordered_by) {
|
|
|
4518
4540
|
query += "where (d.is_removed is null or d.is_removed = 0) "
|
|
4519
4541
|
query += "and (ds.id_place is null ";
|
|
4520
4542
|
query += "or (ds.date_in <= CURDATE() and ds.date_out >= CURDATE() and sd.type = 'MAGAZZINO')) ";
|
|
4543
|
+
if (sel_type_str.trim() != '') {
|
|
4544
|
+
query += "and d.type = :dev_type ";
|
|
4545
|
+
}
|
|
4546
|
+
if (sel_maker_str.trim() != '') {
|
|
4547
|
+
query += "and d.manifacturer = :dev_manifacturer ";
|
|
4548
|
+
}
|
|
4521
4549
|
if (ordered_by && ordered_by == "ID") {
|
|
4522
4550
|
query += "order by d.id desc";
|
|
4523
4551
|
}
|
|
@@ -4526,15 +4554,15 @@ function getDevicesNotAllocatedComboMySQL(ordered_by) {
|
|
|
4526
4554
|
}
|
|
4527
4555
|
return query;
|
|
4528
4556
|
}
|
|
4529
|
-
function getDevicesNotAllocatedCombo(db_used,ordered_by) {
|
|
4557
|
+
function getDevicesNotAllocatedCombo(db_used, sel_type, sel_maker, ordered_by) {
|
|
4530
4558
|
var query = "";
|
|
4531
4559
|
if (db_used) {
|
|
4532
4560
|
switch (db_used) {
|
|
4533
4561
|
case 'SQLITE':
|
|
4534
|
-
query = getDevicesNotAllocatedComboSQLite(ordered_by);
|
|
4562
|
+
query = getDevicesNotAllocatedComboSQLite(sel_type, sel_maker, ordered_by);
|
|
4535
4563
|
break;
|
|
4536
4564
|
case 'MYSQL':
|
|
4537
|
-
query = getDevicesNotAllocatedComboMySQL(ordered_by);
|
|
4565
|
+
query = getDevicesNotAllocatedComboMySQL(sel_type, sel_maker, ordered_by);
|
|
4538
4566
|
break;
|
|
4539
4567
|
}
|
|
4540
4568
|
}
|
|
@@ -4542,7 +4570,16 @@ function getDevicesNotAllocatedCombo(db_used,ordered_by) {
|
|
|
4542
4570
|
}
|
|
4543
4571
|
// End getDevicesNotAllocatedCombo
|
|
4544
4572
|
// Define getDevicesAllocatedCombo
|
|
4545
|
-
function getDevicesAllocatedComboSQLite(id_site, id_place, ordered_by) {
|
|
4573
|
+
function getDevicesAllocatedComboSQLite(id_site, id_place, sel_type, sel_maker, ordered_by) {
|
|
4574
|
+
var sel_type_str = "";
|
|
4575
|
+
if (sel_type) {
|
|
4576
|
+
sel_type_str = sel_type;
|
|
4577
|
+
}
|
|
4578
|
+
var sel_maker_str = "";
|
|
4579
|
+
if (sel_maker) {
|
|
4580
|
+
sel_maker_str = sel_maker;
|
|
4581
|
+
}
|
|
4582
|
+
|
|
4546
4583
|
var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
|
|
4547
4584
|
query += "case ";
|
|
4548
4585
|
query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number, ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
|
|
@@ -4557,6 +4594,12 @@ function getDevicesAllocatedComboSQLite(id_site, id_place, ordered_by) {
|
|
|
4557
4594
|
query += "where (d.is_removed is null or d.is_removed = 0) "
|
|
4558
4595
|
query += "and (ds.id_place is not null ";
|
|
4559
4596
|
query += "or (ds.date_in <= date('now') and ds.date_out >= date('now') and ds.id_site <> " + id_site + " and ds.id_place <> '" + id_place + "')) ";
|
|
4597
|
+
if (sel_type_str.trim() != '') {
|
|
4598
|
+
query += "and d.type = '" + sel_type_str.trim() + "' ";
|
|
4599
|
+
}
|
|
4600
|
+
if (sel_maker_str.trim() != '') {
|
|
4601
|
+
query += "and d.manifacturer = '" + sel_maker_str.trim() + "' ";
|
|
4602
|
+
}
|
|
4560
4603
|
if (ordered_by && ordered_by == "ID") {
|
|
4561
4604
|
query += "order by d.id desc";
|
|
4562
4605
|
}
|
|
@@ -4565,7 +4608,15 @@ function getDevicesAllocatedComboSQLite(id_site, id_place, ordered_by) {
|
|
|
4565
4608
|
}
|
|
4566
4609
|
return query;
|
|
4567
4610
|
}
|
|
4568
|
-
function getDevicesAllocatedComboMySQL(id_site, id_place, ordered_by) {
|
|
4611
|
+
function getDevicesAllocatedComboMySQL(id_site, id_place, sel_type, sel_maker, ordered_by) {
|
|
4612
|
+
var sel_type_str = "";
|
|
4613
|
+
if (sel_type) {
|
|
4614
|
+
sel_type_str = sel_type;
|
|
4615
|
+
}
|
|
4616
|
+
var sel_maker_str = "";
|
|
4617
|
+
if (sel_maker) {
|
|
4618
|
+
sel_maker_str = sel_maker;
|
|
4619
|
+
}
|
|
4569
4620
|
var query = "SELECT d.id, d.type as Tipo, d.manifacturer as Marca, d.model as Modello, ";
|
|
4570
4621
|
query += "case ";
|
|
4571
4622
|
query += "when d.inv_ict3_number != '' and d.inv_ict3_number is not null then concat(d.inv_ict3_number, ' - ', d.type, ' - ', d.manifacturer, ' - ', d.model) ";
|
|
@@ -4580,6 +4631,12 @@ function getDevicesAllocatedComboMySQL(id_site, id_place, ordered_by) {
|
|
|
4580
4631
|
query += "where (d.is_removed is null or d.is_removed = 0) "
|
|
4581
4632
|
query += "and (ds.id_place is not null ";
|
|
4582
4633
|
query += "or (ds.date_in <= CURDATE() and ds.date_out >= CURDATE() and ds.id_site <> :id_site and ds.id_place <> :id_place)) ";
|
|
4634
|
+
if (sel_type_str.trim() != '') {
|
|
4635
|
+
query += "and d.type = :dev_type ";
|
|
4636
|
+
}
|
|
4637
|
+
if (sel_maker_str.trim() != '') {
|
|
4638
|
+
query += "and d.manifacturer = :dev_manifacturer ";
|
|
4639
|
+
}
|
|
4583
4640
|
if (ordered_by && ordered_by == "ID") {
|
|
4584
4641
|
query += "order by d.id desc";
|
|
4585
4642
|
}
|
|
@@ -4588,15 +4645,15 @@ function getDevicesAllocatedComboMySQL(id_site, id_place, ordered_by) {
|
|
|
4588
4645
|
}
|
|
4589
4646
|
return query;
|
|
4590
4647
|
}
|
|
4591
|
-
function getDevicesAllocatedCombo(db_used, id_site, id_place, ordered_by) {
|
|
4648
|
+
function getDevicesAllocatedCombo(db_used, id_site, id_place, sel_type, sel_maker, ordered_by) {
|
|
4592
4649
|
var query = "";
|
|
4593
4650
|
if (db_used) {
|
|
4594
4651
|
switch (db_used) {
|
|
4595
4652
|
case 'SQLITE':
|
|
4596
|
-
query = getDevicesAllocatedComboSQLite(id_site, id_place, ordered_by);
|
|
4653
|
+
query = getDevicesAllocatedComboSQLite(id_site, id_place, sel_type, sel_maker, ordered_by);
|
|
4597
4654
|
break;
|
|
4598
4655
|
case 'MYSQL':
|
|
4599
|
-
query = getDevicesAllocatedComboMySQL(id_site, id_place, ordered_by);
|
|
4656
|
+
query = getDevicesAllocatedComboMySQL(id_site, id_place, sel_type, sel_maker, ordered_by);
|
|
4600
4657
|
break;
|
|
4601
4658
|
}
|
|
4602
4659
|
}
|