@fluxhub/fluxhub-lib 10.0.484 → 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,7 +17814,35 @@
17814
17814
  };
17815
17815
  dati_aggiuntivi.prototype.back = function (edit_button) {
17816
17816
  var _this = this;
17817
- if (!edit_button)
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)
17818
17846
  this.m_router.navigate([this.app_info.modulo_swf]);
17819
17847
  else {
17820
17848
  var dialogRef = this.m_dialog.open(win_salva_annulla, {
@@ -18601,6 +18629,7 @@
18601
18629
  dati_aggiuntivi.prototype.ok_load_document = function (o) {
18602
18630
  var _this = this;
18603
18631
  this.m_obj = (JSON.parse(JSON.stringify(o)));
18632
+ this.old_doc = (JSON.parse(JSON.stringify(this.getfieldvalues())));
18604
18633
  this.edit_b(false, false);
18605
18634
  this.save_to_app_state();
18606
18635
  var p = new QParam();
@@ -20790,7 +20819,35 @@
20790
20819
  };
20791
20820
  dati_aggiuntivi_v2.prototype.back = function (edit_button) {
20792
20821
  var _this = this;
20793
- if (!edit_button)
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)
20794
20851
  this.m_router.navigate([this.app_info.modulo_swf]);
20795
20852
  else {
20796
20853
  var dialogRef = this.m_dialog.open(win_salva_annulla_v2, {
@@ -21142,6 +21199,7 @@
21142
21199
  dati_aggiuntivi_v2.prototype.ok_load_document = function (o) {
21143
21200
  var _this = this;
21144
21201
  this.m_obj = (JSON.parse(JSON.stringify(o)));
21202
+ this.old_doc = (JSON.parse(JSON.stringify(this.getfieldvalues())));
21145
21203
  this.edit_b(false);
21146
21204
  this.save_to_app_state();
21147
21205
  var p = new QParam();