alsmanager_lib 3.0.48 → 3.0.50
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 +22 -3
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -5813,7 +5813,7 @@ function getDevicesNotAllocatedComboSQLite(id_site, id_place, sel_type, sel_make
|
|
|
5813
5813
|
query += "and (dc.id_consegna is null) ";
|
|
5814
5814
|
query += "and (cb.id is null or (cb.tipo_bene = 'DEVICE' and cb.stato_restituzione = 2)) ";
|
|
5815
5815
|
query += "and (ds.id_place is null ";
|
|
5816
|
-
query += "or ((ds.date_in <= date('now') and ds.date_out >= date('now') and sd.type
|
|
5816
|
+
query += "or ((ds.date_in <= date('now') and ds.date_out >= date('now') and sd.type in ('MAGAZZINO', 'CARRELLO DISPOSITIVI'))) and (ds.id_place <> '" + id_place + "' and ds.id_site <> " + id_site + ")) ";
|
|
5817
5817
|
if (sel_type_str.trim() != '') {
|
|
5818
5818
|
query += "and d.type = '" + sel_type_str.trim() + "' ";
|
|
5819
5819
|
}
|
|
@@ -5856,7 +5856,7 @@ function getDevicesNotAllocatedComboMySQL(id_site, id_place, sel_type, sel_maker
|
|
|
5856
5856
|
query += "and (dc.id_consegna is null) ";
|
|
5857
5857
|
query += "and (cb.id is null or (cb.tipo_bene = 'DEVICE' and cb.stato_restituzione = 2)) ";
|
|
5858
5858
|
query += "and (ds.id_place is null ";
|
|
5859
|
-
query += "or ((ds.date_in <= CURDATE() and ds.date_out >= CURDATE() and sd.type
|
|
5859
|
+
query += "or ((ds.date_in <= CURDATE() and ds.date_out >= CURDATE() and sd.type in ('MAGAZZINO', 'CARRELLO DISPOSITIVI'))) and (ds.id_place <> :id_place and ds.id_site <> :id_site)) ";
|
|
5860
5860
|
if (sel_type_str.trim() != '') {
|
|
5861
5861
|
query += "and d.type = :dev_type ";
|
|
5862
5862
|
}
|
|
@@ -5899,7 +5899,7 @@ function getDevicesNotAllocatedComboMySQL2(id_site, id_place, sel_type, sel_make
|
|
|
5899
5899
|
query += "and (dc.id_consegna is null) ";
|
|
5900
5900
|
query += "and (cb.id is null or (cb.tipo_bene = 'DEVICE' and cb.stato_restituzione = 2)) ";
|
|
5901
5901
|
query += "and (ds.id_place is null ";
|
|
5902
|
-
query += "or ((ds.date_in <= CURDATE() and ds.date_out >= CURDATE() and sd.type
|
|
5902
|
+
query += "or ((ds.date_in <= CURDATE() and ds.date_out >= CURDATE() and sd.type in ('MAGAZZINO', 'CARRELLO DISPOSITIVI'))) and (ds.id_place <> '" + id_place + "' and ds.id_site <> " + id_site + ")) ";
|
|
5903
5903
|
if (sel_type_str.trim() != '') {
|
|
5904
5904
|
query += "and d.type = '" + sel_type_str.trim() + "' ";
|
|
5905
5905
|
}
|
|
@@ -6882,6 +6882,24 @@ function queryConsegnaById(db_used,id_consegna) {
|
|
|
6882
6882
|
}
|
|
6883
6883
|
|
|
6884
6884
|
//Creazione email sollecito consegna
|
|
6885
|
+
function getDatiConsegneAttive() {
|
|
6886
|
+
var query = "select c.richiedente_adulto as Nominativo, c.email_adulto as Email, concat('Consegna n.', c.id, ' del ', STRFTIME('%d/%m/%Y', c.data_consegna)) as Consegna, ";
|
|
6887
|
+
query += "case ";
|
|
6888
|
+
query += "when d.id is not null and d.inv_ict3_number is not null and trim(d.inv_ict3_number) <> '' then concat(d.manifacturer, ' - ', d.model, ' - Inv.', d.inv_ict3_number) ";
|
|
6889
|
+
query += "when d.id is not null and d.serial_no is not null and trim(d.serial_no) <> '' then concat(d.manifacturer, ' - ', d.model, ' - S/N:', d.serial_no) ";
|
|
6890
|
+
query += "when s.id is not null and s.inv_ict3_number is not null and trim(s.inv_ict3_number) <> '' then concat(s.maker, ' - ', s.model, ' - Inv.', s.inv_ict3_number) ";
|
|
6891
|
+
query += "when s.id is not null and s.serial_no is not null and trim(s.serial_no) <> '' then concat(s.maker, ' - ', s.model, ' - S/N:', s.serial_no) ";
|
|
6892
|
+
query += "else '' ";
|
|
6893
|
+
query += "end as bene_consegnato ";
|
|
6894
|
+
query += "from consegna_beni cb ";
|
|
6895
|
+
query += "join consegne c on c.id = cb.id_consegna ";
|
|
6896
|
+
query += "left join devices d on cb.id_bene = d.id ";
|
|
6897
|
+
query += "left join softwares s on cb.id_bene = s.id ";
|
|
6898
|
+
query += "where cb.stato_restituzione = 0 ";
|
|
6899
|
+
return query;
|
|
6900
|
+
}
|
|
6901
|
+
|
|
6902
|
+
|
|
6885
6903
|
function createConsegnaMessage(consegna, listBeni, data_limite) {
|
|
6886
6904
|
var msgObj = {};
|
|
6887
6905
|
if (consegna) {
|
|
@@ -14252,6 +14270,7 @@ module.exports = {
|
|
|
14252
14270
|
getLastGestioneDeviceByIdDevice,
|
|
14253
14271
|
queryConsegne,
|
|
14254
14272
|
queryConsegnaById,
|
|
14273
|
+
getDatiConsegneAttive,
|
|
14255
14274
|
createConsegnaMessage,
|
|
14256
14275
|
createConsegnaMySQLObj,
|
|
14257
14276
|
insertConsegna,
|