@fluxhub/fluxhub-lib 10.0.485 → 10.0.487

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