alsmanager_lib 2.0.62 → 2.0.64
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 +10 -4
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -2175,12 +2175,15 @@ function getDevicesSelectSQLite(search_type, inv_code, dev_type, marca, is_PNRR,
|
|
|
2175
2175
|
}
|
|
2176
2176
|
if (is_PNRR && is_PNRR > 0) {
|
|
2177
2177
|
where_clause += " (d.inv_pnrr_number <> '' and inv_pnrr_number is not null) ";
|
|
2178
|
-
if (dev_status) {
|
|
2178
|
+
if (dev_status || dev_gestione) {
|
|
2179
2179
|
where_clause += " and ";
|
|
2180
2180
|
}
|
|
2181
2181
|
}
|
|
2182
2182
|
if (dev_status) {
|
|
2183
2183
|
where_clause += " du.status = " + dev_status + " and date('now') >= du.date_status";
|
|
2184
|
+
if (dev_gestione) {
|
|
2185
|
+
where_clause += " and ";
|
|
2186
|
+
}
|
|
2184
2187
|
}
|
|
2185
2188
|
if (dev_gestione) {
|
|
2186
2189
|
where_clause += " dg.id_gestione = " + dev_gestione + " and date('now') >= dg.date_start and date('now') <= dg.date_end";
|
|
@@ -2246,12 +2249,15 @@ function getDevicesSelectMySQL(search_type, inv_code, dev_type, marca, is_PNRR,
|
|
|
2246
2249
|
}
|
|
2247
2250
|
if (is_PNRR && is_PNRR > 0) {
|
|
2248
2251
|
where_clause += " (d.inv_pnrr_number <> '' and inv_pnrr_number is not null) ";
|
|
2249
|
-
if (dev_status) {
|
|
2252
|
+
if (dev_status || dev_gestione) {
|
|
2250
2253
|
where_clause += " and ";
|
|
2251
2254
|
}
|
|
2252
2255
|
}
|
|
2253
2256
|
if (dev_status) {
|
|
2254
|
-
where_clause += " du.status = :dev_status and
|
|
2257
|
+
where_clause += " du.status = :dev_status and CURDATE() >= du.date_status";
|
|
2258
|
+
if (dev_gestione) {
|
|
2259
|
+
where_clause += " and ";
|
|
2260
|
+
}
|
|
2255
2261
|
}
|
|
2256
2262
|
if (dev_gestione) {
|
|
2257
2263
|
where_clause += " dg.id_gestione = :dev_gestione and CURDATE() >= dg.date_start and CURDATE() <= dg.date_end";
|
|
@@ -5102,7 +5108,7 @@ function selectTabellaInventarioByName(db_used, tab_name) {
|
|
|
5102
5108
|
|
|
5103
5109
|
function queryCloseGestioneDeviceSQLite(id_gestione) {
|
|
5104
5110
|
var query = "update device_gestioni ";
|
|
5105
|
-
query += "set date_end = date('now' -
|
|
5111
|
+
query += "set date_end = date('now', '-1 day') ";
|
|
5106
5112
|
query += "where id = " + id_gestione + " ";
|
|
5107
5113
|
query += "and date_start < date('now')";
|
|
5108
5114
|
return query;
|