@magic-xpa/engine 4.801.0-dev481.389 → 4.801.0-dev481.392

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.
@@ -4132,9 +4132,10 @@ class Scrambler {
4132
4132
  if (high > (sqrt / 2))
4133
4133
  high = Math.floor(sqrt / 2);
4134
4134
  delta = (Math.random() * (high - low)) + low;
4135
+ delta = Math.floor(delta);
4135
4136
  if (delta === Scrambler.XML_ILLEGAL_RANDOM)
4136
4137
  delta++;
4137
- return Math.floor(delta);
4138
+ return delta;
4138
4139
  }
4139
4140
  static UnScramble(inVal, beginOffSet, endOffSet) {
4140
4141
  if (!Scrambler.ScramblingEnabled) {
@@ -23023,6 +23024,7 @@ class Task extends TaskBase {
23023
23024
  result = await this.DataviewManager.Execute(dataViewCommand);
23024
23025
  if (!result.Success)
23025
23026
  return null;
23027
+ this.ResumeSubformLayout();
23026
23028
  }
23027
23029
  nonInteractiveTask = await this.StartSubTasks(moveToFirstControl, nonInteractiveTask, callByDestSubForm);
23028
23030
  this.InStartProcess = false;
@@ -26924,7 +26926,7 @@ class EventsManager {
26924
26926
  val = Manager.GetCtrlVal(ctrl);
26925
26927
  task.CurrentEditingControl = null;
26926
26928
  if (!task.cancelWasRaised() &&
26927
- (ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && ctrl._field.getType() === StorageAttribute.DATE || val !== null) && typeof val != 'undefined' &&
26929
+ (ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && (ctrl._field.getType() === StorageAttribute.DATE || ctrl._field.getType() == StorageAttribute.NUMERIC) || val !== null) && typeof val != 'undefined' &&
26928
26930
  !await ctrl.validateAndSetValue(val, true))) {
26929
26931
  this.setStopExecution(true);
26930
26932
  return false;
@@ -29516,7 +29518,7 @@ class CommandsTable {
29516
29518
  }
29517
29519
  }
29518
29520
 
29519
- let CurrentClientVersion = '4.801.0-dev481.389';
29521
+ let CurrentClientVersion = '4.801.0-dev481.392';
29520
29522
 
29521
29523
  class ClientManager {
29522
29524
  constructor() {
@@ -29777,15 +29779,20 @@ class ClientManager {
29777
29779
  }
29778
29780
  return pic;
29779
29781
  }
29780
- static GetFormattedValue(taskId, controlName, value) {
29782
+ static GetFormattedValue(taskId, controlName, value, rowId) {
29781
29783
  let pic = null;
29782
29784
  let task = MGDataCollection.Instance.GetTaskByID(taskId);
29783
29785
  let control = null;
29784
29786
  let newValue = value;
29785
- if (controlName !== null)
29787
+ if (controlName !== null && task !== null)
29786
29788
  control = task.getForm().GetCtrl(controlName);
29787
29789
  if (control != null && control.DataType == StorageAttribute.NUMERIC) {
29788
- pic = control.getPIC();
29790
+ if (control.isRepeatable() && control.getProp(PropInterface.PROP_TYPE_FORMAT).isExpression()) {
29791
+ let picval = control.getProp(PropInterface.PROP_TYPE_FORMAT).getPrevValue(+rowId);
29792
+ pic = new PIC(picval, StorageAttribute.NUMERIC, control.getForm().getTask().getCompIdx());
29793
+ }
29794
+ else
29795
+ pic = control.getPIC();
29789
29796
  let dispValue = String(value);
29790
29797
  let newPic = pic.getUnformattedNumericPic();
29791
29798
  let num = DisplayConvertor.Instance.toNum(dispValue, newPic, 0);
@@ -29886,8 +29893,8 @@ class MagicBridge {
29886
29893
  static GetControlPictureMask(taskId, controlName) {
29887
29894
  return ClientManager.GetControlPictureMask(taskId, controlName);
29888
29895
  }
29889
- static GetFormattedValue(taskId, controlName, value) {
29890
- return ClientManager.GetFormattedValue(taskId, controlName, value);
29896
+ static GetFormattedValue(taskId, controlName, value, rowId) {
29897
+ return ClientManager.GetFormattedValue(taskId, controlName, value, rowId);
29891
29898
  }
29892
29899
  static GetRangedValue(taskId, controlName, value) {
29893
29900
  return ClientManager.GetRangedValue(taskId, controlName, value);