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