alsmanager_lib 2.0.43 → 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.
Files changed (2) hide show
  1. package/lib/modules.js +27 -3
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -4573,10 +4573,10 @@ function getDevicesNotAllocatedComboMySQL(id_site, id_place, sel_type, sel_maker
4573
4573
  query += "and (ds.id_place is null ";
4574
4574
  query += "or ((ds.date_in <= CURDATE() and ds.date_out >= CURDATE() and sd.type = 'MAGAZZINO')) and (ds.id_place <> :id_place and ds.id_site <> :id_site)) ";
4575
4575
  if (sel_type_str.trim() != '') {
4576
- query += "and d.type = ':dev_type' ";
4576
+ query += "and d.type = :dev_type ";
4577
4577
  }
4578
4578
  if (sel_maker_str.trim() != '') {
4579
- query += "and d.manifacturer = ':dev_manifacturer' ";
4579
+ query += "and d.manifacturer = :dev_manifacturer ";
4580
4580
  }
4581
4581
  if (ordered_by && ordered_by == "ID") {
4582
4582
  query += "order by d.id desc";
@@ -7762,7 +7762,7 @@ function getBeniConsumo() {
7762
7762
  return query;
7763
7763
  }
7764
7764
 
7765
- function getBeniConsumoNotNull() {
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 ";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alsmanager_lib",
3
- "version": "2.0.43",
3
+ "version": "2.0.45",
4
4
  "description": "Funzioni per ALSManager",
5
5
  "license": "ISC",
6
6
  "author": "Luca Cattani",