@fluxhub/fluxhub-lib 9.0.128 → 9.0.130

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.
@@ -705,13 +705,26 @@
705
705
  console.log(p.types[i] + " " + String(p.values[i]));
706
706
  }
707
707
  };
708
+ UtilityService.prototype.calcolda_diff_doc = function (old_doc, new_doc) {
709
+ if (old_doc === void 0) { old_doc = null; }
710
+ if (new_doc === void 0) { new_doc = null; }
711
+ var diff1 = [];
712
+ if (old_doc == null && new_doc == null)
713
+ return diff1;
714
+ var diff = recursiveDiff.getDiff(old_doc, new_doc, true);
715
+ for (var index = 0; index < diff.length; index++) {
716
+ if (diff[index].path + '' != 'uiid' && diff[index].path + '' != 'id')
717
+ diff1.push(diff[index]);
718
+ }
719
+ return diff1;
720
+ };
708
721
  UtilityService.prototype.insert_log = function (dt, app, k, descri, operazione, link, old_doc, new_doc) {
709
722
  if (link === void 0) { link = null; }
710
723
  if (old_doc === void 0) { old_doc = null; }
711
724
  if (new_doc === void 0) { new_doc = null; }
712
725
  var diff = null;
713
726
  if (old_doc != null && new_doc != null)
714
- diff = recursiveDiff.getDiff(old_doc, new_doc, true);
727
+ diff = this.calcolda_diff_doc(old_doc, new_doc);
715
728
  var p = new QParam();
716
729
  if (diff != null || link != null) {
717
730
  p.sql = "INSERT_LOG_N2";
@@ -963,15 +976,25 @@
963
976
  if (queryp.types[i] == 'date') {
964
977
  queryp.values[i] = this.uti_s.sql_date(queryp.values[i]);
965
978
  if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN')
966
- queryp.values[i] = null;
979
+ queryp.values[i] = 'dbnull';
967
980
  }
968
981
  if (queryp.types[i] == 'datetime') {
969
982
  queryp.values[i] = this.uti_s.sql_date_time(queryp.values[i]);
970
983
  if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN NaN:NaN')
971
- queryp.values[i] = null;
984
+ queryp.values[i] = 'dbnull';
972
985
  }
973
986
  if (queryp.types[i] == 'string' && queryp.values[i] == null)
974
987
  queryp.values[i] = 'dbnull';
988
+ if (queryp.types[i] == 'decimal') {
989
+ if (queryp.values[i] + '' == '')
990
+ queryp.values[i] = 'dbnull';
991
+ else {
992
+ if (isNaN(queryp.values[i]))
993
+ queryp.values[i] = '0';
994
+ else
995
+ queryp.values[i] = '' + queryp.values[i];
996
+ }
997
+ }
975
998
  }
976
999
  }
977
1000
  //console.log('queryp after ',queryp);