alsmanager_lib 3.0.111 → 3.0.113
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 +52 -20
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -1224,8 +1224,8 @@ function getVoIPDevices() {
|
|
|
1224
1224
|
|
|
1225
1225
|
// End manage Voip
|
|
1226
1226
|
// Software management
|
|
1227
|
-
function getSoftwares(db_used, maker, model, platform,
|
|
1228
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no,
|
|
1227
|
+
function getSoftwares(db_used, maker, model, platform, license_type) {
|
|
1228
|
+
var query = "select id, maker, model, support, platform, release_year, version, build_no, license_type, license_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_license, no_inventario ";
|
|
1229
1229
|
query += "from softwares ";
|
|
1230
1230
|
query += "where (is_removed is null or is_removed = 0) ";
|
|
1231
1231
|
if (maker) {
|
|
@@ -1237,27 +1237,27 @@ function getSoftwares(db_used, maker, model, platform, licence_type) {
|
|
|
1237
1237
|
if (platform) {
|
|
1238
1238
|
query += "and platform = '" + platform + "' ";
|
|
1239
1239
|
}
|
|
1240
|
-
if (
|
|
1241
|
-
query += "and
|
|
1240
|
+
if (license_type) {
|
|
1241
|
+
query += "and license_type = '" + license_type + "' ";
|
|
1242
1242
|
}
|
|
1243
1243
|
return query;
|
|
1244
1244
|
}
|
|
1245
1245
|
function getSoftwareByCodice(db_used, codice) {
|
|
1246
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no,
|
|
1246
|
+
var query = "select id, maker, model, support, platform, release_year, version, build_no, license_type, license_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_license, no_inventario ";
|
|
1247
1247
|
query += "from softwares ";
|
|
1248
1248
|
query += "where (is_removed is null or is_removed = 0) ";
|
|
1249
1249
|
query += "and inv_ict3_number = '" + codice + "' or serial_no = '" + codice + "'";
|
|
1250
1250
|
return query;
|
|
1251
1251
|
}
|
|
1252
1252
|
function getSoftwareById(db_used, id_sw) {
|
|
1253
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no,
|
|
1253
|
+
var query = "select id, maker, model, support, platform, release_year, version, build_no, license_type, license_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_license, no_inventario ";
|
|
1254
1254
|
query += "from softwares ";
|
|
1255
1255
|
query += "where (is_removed is null or is_removed = 0) ";
|
|
1256
1256
|
query += "and id = " + id_sw;
|
|
1257
1257
|
return query;
|
|
1258
1258
|
}
|
|
1259
1259
|
function getSoftwareForConsegnaById(db_used, id_sw) {
|
|
1260
|
-
var query = "select id, maker, model, support, platform, release_year, version, build_no,
|
|
1260
|
+
var query = "select s.id, s.maker, s.model, s.support, s.platform, s.release_year, s.version, s.build_no, s.license_type, s.license_key, s.expired_date, s.is_pnrr, s.inv_ict3_number, s.serial_no, s.architettura, s.life_license, s.no_inventario, ";
|
|
1261
1261
|
query += "case ";
|
|
1262
1262
|
query += "when s.no_inventario is not null and s.no_inventario > 0 then concat(s.id,'(ID)') ";
|
|
1263
1263
|
query += "when s.inv_ict3_number != '' and s.inv_ict3_number is not null then s.inv_ict3_number ";
|
|
@@ -1269,7 +1269,8 @@ function getSoftwareForConsegnaById(db_used, id_sw) {
|
|
|
1269
1269
|
return query;
|
|
1270
1270
|
}
|
|
1271
1271
|
function insertSoftware(db_used, software) {
|
|
1272
|
-
var
|
|
1272
|
+
var dt_scadenza = convertDateToStringDB(software.data_scadenza);
|
|
1273
|
+
var query = "insert into softwares (maker, model, support, platform, release_year, version, build_no, license_type, license_key, expired_date, is_pnrr, inv_ict3_number, serial_no, architettura, life_license, no_inventario) values (";
|
|
1273
1274
|
query += "'" + software.marca + "', ";
|
|
1274
1275
|
query += "'" + software.modello + "', ";
|
|
1275
1276
|
query += "'" + software.supporto + "', ";
|
|
@@ -1277,19 +1278,31 @@ function insertSoftware(db_used, software) {
|
|
|
1277
1278
|
query += "'" + software.release_year + "', ";
|
|
1278
1279
|
query += "'" + software.version + "', ";
|
|
1279
1280
|
query += "'" + software.build_no + "', ";
|
|
1280
|
-
query += "'" + software.
|
|
1281
|
-
query += "'" + software.
|
|
1282
|
-
query += "'" +
|
|
1281
|
+
query += "'" + software.license_type + "', ";
|
|
1282
|
+
query += "'" + software.license_key + "', ";
|
|
1283
|
+
query += "'" + dt_scadenza + "', ";
|
|
1283
1284
|
query += software.is_pnrr + ", ";
|
|
1284
|
-
|
|
1285
|
+
if (!software.inventario) {
|
|
1286
|
+
query += "'', ";
|
|
1287
|
+
}
|
|
1288
|
+
else {
|
|
1289
|
+
query += "'" + software.inventario + "', ";
|
|
1290
|
+
}
|
|
1285
1291
|
query += "'" + software.serial_no + "', ";
|
|
1286
1292
|
query += "'" + software.architettura + "', ";
|
|
1287
|
-
query += software.
|
|
1293
|
+
query += software.life_license + ", ";
|
|
1294
|
+
if (software.no_inventario) {
|
|
1295
|
+
query += "0 ";
|
|
1296
|
+
}
|
|
1297
|
+
else {
|
|
1298
|
+
query += software.no_inventario + " ";
|
|
1299
|
+
}
|
|
1288
1300
|
query += ")";
|
|
1289
1301
|
return query;
|
|
1290
1302
|
}
|
|
1291
1303
|
|
|
1292
1304
|
function updateSoftware(db_used, id_sw, software) {
|
|
1305
|
+
var dt_scadenza = convertDateToStringDB(software.data_scadenza);
|
|
1293
1306
|
var query = "update softwares set ";
|
|
1294
1307
|
query += "maker = '" + software.marca + "', ";
|
|
1295
1308
|
query += "model = '" + software.modello + "', ";
|
|
@@ -1298,14 +1311,25 @@ function updateSoftware(db_used, id_sw, software) {
|
|
|
1298
1311
|
query += "release_year = '" + software.release_year + "', ";
|
|
1299
1312
|
query += "version = '" + software.version + "', ";
|
|
1300
1313
|
query += "build_no = '" + software.build_no + "', ";
|
|
1301
|
-
query += "
|
|
1302
|
-
query += "
|
|
1303
|
-
query += "expired_date = '" +
|
|
1314
|
+
query += "license_type = '" + software.license_type + "', ";
|
|
1315
|
+
query += "license_key = '" + software.license_key + "', ";
|
|
1316
|
+
query += "expired_date = '" + dt_scadenza + "', ";
|
|
1304
1317
|
query += "is_pnrr = " + software.is_pnrr + ", ";
|
|
1305
|
-
|
|
1318
|
+
if (!software.inventario) {
|
|
1319
|
+
query += "inv_ict3_number = '', ";
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
query += "inv_ict3_number = '" + software.inventario + "', ";
|
|
1323
|
+
}
|
|
1306
1324
|
query += "serial_no = '" + software.serial_no + "', ";
|
|
1307
1325
|
query += "architettura = '" + software.architettura + "', ";
|
|
1308
|
-
query += "
|
|
1326
|
+
query += "life_license = " + software.life_license + ", ";
|
|
1327
|
+
if (software.no_inventario) {
|
|
1328
|
+
query += "no_inventario = 0 ";
|
|
1329
|
+
}
|
|
1330
|
+
else {
|
|
1331
|
+
query += "no_inventario = " + software.no_inventario + " ";
|
|
1332
|
+
}
|
|
1309
1333
|
query += "where id = " + id_sw;
|
|
1310
1334
|
return query;
|
|
1311
1335
|
}
|
|
@@ -8584,7 +8608,7 @@ function selectSoftwareConsegna(db_used, id_consegna, id_software) {
|
|
|
8584
8608
|
}
|
|
8585
8609
|
|
|
8586
8610
|
function selectSoftwaresInDepositoSQLite(inv_code) {
|
|
8587
|
-
var query = "SELECT s.id, s.support, s.platform, s.version, s.
|
|
8611
|
+
var query = "SELECT s.id, s.support, s.platform, s.version, s.license_type, s.maker, s.model, ";
|
|
8588
8612
|
query += "case ";
|
|
8589
8613
|
query += "when s.inv_ict3_number != '' and s.inv_ict3_number is not null then s.inv_ict3_number ";
|
|
8590
8614
|
query += "when s.serial_no != '' and s.serial_no is not null then concat(s.serial_no,'(S/N)') ";
|
|
@@ -8598,7 +8622,7 @@ function selectSoftwaresInDepositoSQLite(inv_code) {
|
|
|
8598
8622
|
return query;
|
|
8599
8623
|
}
|
|
8600
8624
|
function selectSoftwaresInDepositoMySQL(inv_code) {
|
|
8601
|
-
var query = "SELECT s.id, s.support, s.platform, s.version, s.
|
|
8625
|
+
var query = "SELECT s.id, s.support, s.platform, s.version, s.license_type, s.maker, s.model, ";
|
|
8602
8626
|
query += "case ";
|
|
8603
8627
|
query += "when s.inv_ict3_number != '' and s.inv_ict3_number is not null then s.inv_ict3_number ";
|
|
8604
8628
|
query += "when s.serial_no != '' and s.serial_no is not null then concat(s.serial_no,'(S/N)') ";
|
|
@@ -12603,6 +12627,14 @@ function convertDateToStringDB(date_to_conv) {
|
|
|
12603
12627
|
return date_str;
|
|
12604
12628
|
}
|
|
12605
12629
|
|
|
12630
|
+
function convertDateFromStringDBToDisplay(date_db) {
|
|
12631
|
+
var date_str = "";
|
|
12632
|
+
if (date_db & date_db.trim() != '') {
|
|
12633
|
+
var d = new Date(date_db);
|
|
12634
|
+
date_str = ("0" + d.getDate()).slice(-2) + '/' + ("0"+(d.getMonth()+1)).slice(-2) + '/' + d.getFullYear();
|
|
12635
|
+
}
|
|
12636
|
+
return date_str;
|
|
12637
|
+
}
|
|
12606
12638
|
|
|
12607
12639
|
function tokenizer(marker, input, marker2) {
|
|
12608
12640
|
var retValue = "";
|