@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.
@@ -573,13 +573,26 @@ var UtilityService = /** @class */ (function () {
573
573
  console.log(p.types[i] + " " + String(p.values[i]));
574
574
  }
575
575
  };
576
+ UtilityService.prototype.calcolda_diff_doc = function (old_doc, new_doc) {
577
+ if (old_doc === void 0) { old_doc = null; }
578
+ if (new_doc === void 0) { new_doc = null; }
579
+ var diff1 = [];
580
+ if (old_doc == null && new_doc == null)
581
+ return diff1;
582
+ var diff = getDiff(old_doc, new_doc, true);
583
+ for (var index = 0; index < diff.length; index++) {
584
+ if (diff[index].path + '' != 'uiid' && diff[index].path + '' != 'id')
585
+ diff1.push(diff[index]);
586
+ }
587
+ return diff1;
588
+ };
576
589
  UtilityService.prototype.insert_log = function (dt, app, k, descri, operazione, link, old_doc, new_doc) {
577
590
  if (link === void 0) { link = null; }
578
591
  if (old_doc === void 0) { old_doc = null; }
579
592
  if (new_doc === void 0) { new_doc = null; }
580
593
  var diff = null;
581
594
  if (old_doc != null && new_doc != null)
582
- diff = getDiff(old_doc, new_doc, true);
595
+ diff = this.calcolda_diff_doc(old_doc, new_doc);
583
596
  var p = new QParam();
584
597
  if (diff != null || link != null) {
585
598
  p.sql = "INSERT_LOG_N2";
@@ -831,15 +844,25 @@ var QueryService = /** @class */ (function () {
831
844
  if (queryp.types[i] == 'date') {
832
845
  queryp.values[i] = this.uti_s.sql_date(queryp.values[i]);
833
846
  if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN')
834
- queryp.values[i] = null;
847
+ queryp.values[i] = 'dbnull';
835
848
  }
836
849
  if (queryp.types[i] == 'datetime') {
837
850
  queryp.values[i] = this.uti_s.sql_date_time(queryp.values[i]);
838
851
  if (queryp.values[i].split('0').join('') == 'NaN-NaN-NaN NaN:NaN')
839
- queryp.values[i] = null;
852
+ queryp.values[i] = 'dbnull';
840
853
  }
841
854
  if (queryp.types[i] == 'string' && queryp.values[i] == null)
842
855
  queryp.values[i] = 'dbnull';
856
+ if (queryp.types[i] == 'decimal') {
857
+ if (queryp.values[i] + '' == '')
858
+ queryp.values[i] = 'dbnull';
859
+ else {
860
+ if (isNaN(queryp.values[i]))
861
+ queryp.values[i] = '0';
862
+ else
863
+ queryp.values[i] = '' + queryp.values[i];
864
+ }
865
+ }
843
866
  }
844
867
  }
845
868
  //console.log('queryp after ',queryp);