alsmanager_lib 2.0.44 → 2.0.45
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 +25 -1
- package/package.json +1 -1
package/lib/modules.js
CHANGED
|
@@ -7762,7 +7762,7 @@ function getBeniConsumo() {
|
|
|
7762
7762
|
return query;
|
|
7763
7763
|
}
|
|
7764
7764
|
|
|
7765
|
-
function
|
|
7765
|
+
function getBeniConsumoNotNullSQLite() {
|
|
7766
7766
|
var query = "select id, Tipo, Marca, Modello, Quantitativo, "
|
|
7767
7767
|
query += " (select count() from device_beniconsumo where id_bene = bc.id) as Usati"
|
|
7768
7768
|
query += " from beniconsumo bc";
|
|
@@ -7770,6 +7770,30 @@ function getBeniConsumoNotNull() {
|
|
|
7770
7770
|
query += " order by Tipo";
|
|
7771
7771
|
return query;
|
|
7772
7772
|
}
|
|
7773
|
+
|
|
7774
|
+
function getBeniConsumoNotNullMySQL() {
|
|
7775
|
+
var query = "select id, Tipo, Marca, Modello, Quantitativo, "
|
|
7776
|
+
query += " (select count() from device_beniconsumo where id_bene = bc.id) as Usati"
|
|
7777
|
+
query += " from beniconsumo bc";
|
|
7778
|
+
query += " where bc.Quantitativo - Usati > 0"
|
|
7779
|
+
query += " order by Tipo";
|
|
7780
|
+
return query;
|
|
7781
|
+
}
|
|
7782
|
+
|
|
7783
|
+
function getBeniConsumoNotNull(db_used) {
|
|
7784
|
+
var query = "";
|
|
7785
|
+
if (db_used) {
|
|
7786
|
+
switch (db_used) {
|
|
7787
|
+
case 'SQLITE':
|
|
7788
|
+
query = getBeniConsumoNotNullSQLite();
|
|
7789
|
+
break;
|
|
7790
|
+
case 'MYSQL':
|
|
7791
|
+
query = getBeniConsumoNotNullMySQL();
|
|
7792
|
+
break;
|
|
7793
|
+
}
|
|
7794
|
+
}
|
|
7795
|
+
return query;
|
|
7796
|
+
}
|
|
7773
7797
|
//
|
|
7774
7798
|
function getBeneConsumoUsatoSQLite(id_device, id_bene) {
|
|
7775
7799
|
var query = "select b.id, b.tipo, b.marca, b.modello, db.numero from device_beniconsumo db ";
|