@fluxhub/fluxhub-lib 10.0.485 → 10.0.486

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.
@@ -17814,9 +17814,35 @@
17814
17814
  };
17815
17815
  dati_aggiuntivi.prototype.back = function (edit_button) {
17816
17816
  var _this = this;
17817
- var arrx = this.uti_s.get_diff_doc(this.old_doc, this.m_obj);
17818
- console.log('arrx ', arrx);
17819
- if (!edit_button || arrx.length == 0)
17817
+ var arrd = this.uti_s.get_diff_doc(this.old_doc, this.getfieldvalues());
17818
+ console.log(arrd);
17819
+ var flt = [];
17820
+ for (var i = 0; i < arrd.length; i++) {
17821
+ if (arrd[i].val == '-1')
17822
+ arrd[i].val = '';
17823
+ if (arrd[i].oldVal == '-1')
17824
+ arrd[i].oldVal = '';
17825
+ if (arrd[i].val == ' ')
17826
+ arrd[i].val = '';
17827
+ if (arrd[i].oldVal == ' ')
17828
+ arrd[i].oldVal = '';
17829
+ if (arrd[i].val instanceof Number && arrd[i].oldVal instanceof String) {
17830
+ arrd[i].oldVal = Number(arrd[i].oldVal.split(',').join('.'));
17831
+ }
17832
+ }
17833
+ for (var i = 0; i < arrd.length; i++)
17834
+ if (!(arrd[i].op == 'update' && (arrd[i].val == 'date' || arrd[i].val == 'string')))
17835
+ if (!(arrd[i].op == 'add' && arrd[i].val == null && arrd[i].oldVal == ''))
17836
+ if (!(arrd[i].val == arrd[i].oldVal))
17837
+ if (!(arrd[i].val == '' && arrd[i].oldVal == '0'))
17838
+ if (!(arrd[i].val instanceof Date))
17839
+ flt.push(arrd[i]);
17840
+ for (var i = 0; i < arrd.length; i++)
17841
+ if (arrd[i].val instanceof Date)
17842
+ if (new Date(arrd[i].val).getTime() != new Date(arrd[i].oldVal).getTime())
17843
+ flt.push(arrd[i]);
17844
+ console.log('arrx ', flt);
17845
+ if (!edit_button || flt.length == 0)
17820
17846
  this.m_router.navigate([this.app_info.modulo_swf]);
17821
17847
  else {
17822
17848
  var dialogRef = this.m_dialog.open(win_salva_annulla, {
@@ -18603,7 +18629,7 @@
18603
18629
  dati_aggiuntivi.prototype.ok_load_document = function (o) {
18604
18630
  var _this = this;
18605
18631
  this.m_obj = (JSON.parse(JSON.stringify(o)));
18606
- this.old_doc = (JSON.parse(JSON.stringify(o)));
18632
+ this.old_doc = (JSON.parse(JSON.stringify(this.getfieldvalues())));
18607
18633
  this.edit_b(false, false);
18608
18634
  this.save_to_app_state();
18609
18635
  var p = new QParam();
@@ -20793,9 +20819,35 @@
20793
20819
  };
20794
20820
  dati_aggiuntivi_v2.prototype.back = function (edit_button) {
20795
20821
  var _this = this;
20796
- var arrx = this.uti_s.get_diff_doc(this.old_doc, this.m_obj);
20797
- console.log('arrx ', arrx);
20798
- if (!edit_button || arrx.length == 0)
20822
+ var arrd = this.uti_s.get_diff_doc(this.old_doc, this.getfieldvalues());
20823
+ console.log(arrd);
20824
+ var flt = [];
20825
+ for (var i = 0; i < arrd.length; i++) {
20826
+ if (arrd[i].val == '-1')
20827
+ arrd[i].val = '';
20828
+ if (arrd[i].oldVal == '-1')
20829
+ arrd[i].oldVal = '';
20830
+ if (arrd[i].val == ' ')
20831
+ arrd[i].val = '';
20832
+ if (arrd[i].oldVal == ' ')
20833
+ arrd[i].oldVal = '';
20834
+ if (arrd[i].val instanceof Number && arrd[i].oldVal instanceof String) {
20835
+ arrd[i].oldVal = Number(arrd[i].oldVal.split(',').join('.'));
20836
+ }
20837
+ }
20838
+ for (var i = 0; i < arrd.length; i++)
20839
+ if (!(arrd[i].op == 'update' && (arrd[i].val == 'date' || arrd[i].val == 'string')))
20840
+ if (!(arrd[i].op == 'add' && arrd[i].val == null && arrd[i].oldVal == ''))
20841
+ if (!(arrd[i].val == arrd[i].oldVal))
20842
+ if (!(arrd[i].val == '' && arrd[i].oldVal == '0'))
20843
+ if (!(arrd[i].val instanceof Date))
20844
+ flt.push(arrd[i]);
20845
+ for (var i = 0; i < arrd.length; i++)
20846
+ if (arrd[i].val instanceof Date)
20847
+ if (new Date(arrd[i].val).getTime() != new Date(arrd[i].oldVal).getTime())
20848
+ flt.push(arrd[i]);
20849
+ console.log('arrx ', flt);
20850
+ if (!edit_button || flt.length == 0)
20799
20851
  this.m_router.navigate([this.app_info.modulo_swf]);
20800
20852
  else {
20801
20853
  var dialogRef = this.m_dialog.open(win_salva_annulla_v2, {
@@ -21147,7 +21199,7 @@
21147
21199
  dati_aggiuntivi_v2.prototype.ok_load_document = function (o) {
21148
21200
  var _this = this;
21149
21201
  this.m_obj = (JSON.parse(JSON.stringify(o)));
21150
- this.old_doc = (JSON.parse(JSON.stringify(o)));
21202
+ this.old_doc = (JSON.parse(JSON.stringify(this.getfieldvalues())));
21151
21203
  this.edit_b(false);
21152
21204
  this.save_to_app_state();
21153
21205
  var p = new QParam();