@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.
@@ -17016,9 +17016,35 @@ class dati_aggiuntivi {
17016
17016
  }
17017
17017
  }
17018
17018
  back(edit_button) {
17019
- let arrx = this.uti_s.get_diff_doc(this.old_doc, this.m_obj);
17020
- console.log('arrx ', arrx);
17021
- if (!edit_button || arrx.length == 0)
17019
+ let arrd = this.uti_s.get_diff_doc(this.old_doc, this.getfieldvalues());
17020
+ console.log(arrd);
17021
+ let flt = [];
17022
+ for (let i = 0; i < arrd.length; i++) {
17023
+ if (arrd[i].val == '-1')
17024
+ arrd[i].val = '';
17025
+ if (arrd[i].oldVal == '-1')
17026
+ arrd[i].oldVal = '';
17027
+ if (arrd[i].val == ' ')
17028
+ arrd[i].val = '';
17029
+ if (arrd[i].oldVal == ' ')
17030
+ arrd[i].oldVal = '';
17031
+ if (arrd[i].val instanceof Number && arrd[i].oldVal instanceof String) {
17032
+ arrd[i].oldVal = Number(arrd[i].oldVal.split(',').join('.'));
17033
+ }
17034
+ }
17035
+ for (let i = 0; i < arrd.length; i++)
17036
+ if (!(arrd[i].op == 'update' && (arrd[i].val == 'date' || arrd[i].val == 'string')))
17037
+ if (!(arrd[i].op == 'add' && arrd[i].val == null && arrd[i].oldVal == ''))
17038
+ if (!(arrd[i].val == arrd[i].oldVal))
17039
+ if (!(arrd[i].val == '' && arrd[i].oldVal == '0'))
17040
+ if (!(arrd[i].val instanceof Date))
17041
+ flt.push(arrd[i]);
17042
+ for (let i = 0; i < arrd.length; i++)
17043
+ if (arrd[i].val instanceof Date)
17044
+ if (new Date(arrd[i].val).getTime() != new Date(arrd[i].oldVal).getTime())
17045
+ flt.push(arrd[i]);
17046
+ console.log('arrx ', flt);
17047
+ if (!edit_button || flt.length == 0)
17022
17048
  this.m_router.navigate([this.app_info.modulo_swf]);
17023
17049
  else {
17024
17050
  let dialogRef = this.m_dialog.open(win_salva_annulla, {
@@ -17789,7 +17815,7 @@ class dati_aggiuntivi {
17789
17815
  }
17790
17816
  ok_load_document(o) {
17791
17817
  this.m_obj = (JSON.parse(JSON.stringify(o)));
17792
- this.old_doc = (JSON.parse(JSON.stringify(o)));
17818
+ this.old_doc = (JSON.parse(JSON.stringify(this.getfieldvalues())));
17793
17819
  this.edit_b(false, false);
17794
17820
  this.save_to_app_state();
17795
17821
  let p = new QParam();
@@ -24160,9 +24186,35 @@ class dati_aggiuntivi_v2 {
24160
24186
  setTimeout(() => { this.reset_updw(); }, 800);
24161
24187
  }
24162
24188
  back(edit_button) {
24163
- let arrx = this.uti_s.get_diff_doc(this.old_doc, this.m_obj);
24164
- console.log('arrx ', arrx);
24165
- if (!edit_button || arrx.length == 0)
24189
+ let arrd = this.uti_s.get_diff_doc(this.old_doc, this.getfieldvalues());
24190
+ console.log(arrd);
24191
+ let flt = [];
24192
+ for (let i = 0; i < arrd.length; i++) {
24193
+ if (arrd[i].val == '-1')
24194
+ arrd[i].val = '';
24195
+ if (arrd[i].oldVal == '-1')
24196
+ arrd[i].oldVal = '';
24197
+ if (arrd[i].val == ' ')
24198
+ arrd[i].val = '';
24199
+ if (arrd[i].oldVal == ' ')
24200
+ arrd[i].oldVal = '';
24201
+ if (arrd[i].val instanceof Number && arrd[i].oldVal instanceof String) {
24202
+ arrd[i].oldVal = Number(arrd[i].oldVal.split(',').join('.'));
24203
+ }
24204
+ }
24205
+ for (let i = 0; i < arrd.length; i++)
24206
+ if (!(arrd[i].op == 'update' && (arrd[i].val == 'date' || arrd[i].val == 'string')))
24207
+ if (!(arrd[i].op == 'add' && arrd[i].val == null && arrd[i].oldVal == ''))
24208
+ if (!(arrd[i].val == arrd[i].oldVal))
24209
+ if (!(arrd[i].val == '' && arrd[i].oldVal == '0'))
24210
+ if (!(arrd[i].val instanceof Date))
24211
+ flt.push(arrd[i]);
24212
+ for (let i = 0; i < arrd.length; i++)
24213
+ if (arrd[i].val instanceof Date)
24214
+ if (new Date(arrd[i].val).getTime() != new Date(arrd[i].oldVal).getTime())
24215
+ flt.push(arrd[i]);
24216
+ console.log('arrx ', flt);
24217
+ if (!edit_button || flt.length == 0)
24166
24218
  this.m_router.navigate([this.app_info.modulo_swf]);
24167
24219
  else {
24168
24220
  let dialogRef = this.m_dialog.open(win_salva_annulla_v2, {
@@ -24499,7 +24551,7 @@ class dati_aggiuntivi_v2 {
24499
24551
  }
24500
24552
  ok_load_document(o) {
24501
24553
  this.m_obj = (JSON.parse(JSON.stringify(o)));
24502
- this.old_doc = (JSON.parse(JSON.stringify(o)));
24554
+ this.old_doc = (JSON.parse(JSON.stringify(this.getfieldvalues())));
24503
24555
  this.edit_b(false);
24504
24556
  this.save_to_app_state();
24505
24557
  let p = new QParam();