[js-format] Applied new format
authorJavier Armendáriz <javier.armendariz@openbravo.com>
Wed, 12 Jun 2019 10:59:13 +0200
changeset 36132 a3916b3d436d
parent 36131 6d9b65973b42
child 36133 3197347b9f8a
[js-format] Applied new format
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addTransaction.js
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-findTransaction.js
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-fundsTransfer.js
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-matchStatement.js
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-manager.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-calendar.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/callback/ob-extra-window-settings-actions.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-help.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-popup.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-window.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/costing/ob-lc-matchfrominvoice.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-characteristics.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-checkbox.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-combo.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-date.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datechooser.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-datetime.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-encrypted.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-image.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-link.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-linkbutton.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-linktitle.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list-filter.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-list.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-minidaterange.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-pickeditgrid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-richtext.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-search-attribute.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-search.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-section-audit.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-section.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-spinner.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-text.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-textarea.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-time.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree-filter.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-tree.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-yesno.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-form-button.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-onchange-registry.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-statusbar.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-attachments.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-linked-items.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form-notes.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-base-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-event-handler-registry.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-layout.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-messagebar.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-notes-datasource.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view-datasource.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-window.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-tab.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/materialmgmt/ob-reservation.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/materialmgmt/ob-reservedGoodMovement.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-help-about-widget.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-logout-widget.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quickrun-widget.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-user-profile-widget.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views-popups.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views-toolbar.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-manage-views.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalization-treegrid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalization.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form-toolbar-button.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/personalization/ob-personalize-form.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-attachment-window-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-base-parameter-window-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-form.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-datasource.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/procurement/ob-procurement.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/return-material/ob-return-material.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-navbar-test.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-property-store-test.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-ui-test.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-utilities-date-test.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-utilities-number-test.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-utilities-valid-url-test.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-clone-order.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/upload/ob-upload-bp-select-button.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/upload/ob-upload-bp-select-popup.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/upload/ob-upload-popup.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/upload/ob-upload-product-button.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-eventhandler.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-external-page.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-function-registry.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-history-manager.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-onchange-functions.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-popup.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-property-store.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-recent-utilities.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-remote-call-manager.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-section-stack.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-test-registry.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-action-def.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-action.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-date.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-style.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js
modules/org.openbravo.client.htmlwidget/web/org.openbravo.client.htmlwidget/js/ob-html-widget.js
modules/org.openbravo.client.kernel/src-test/org/openbravo/client/kernel/test/test-compression.js
modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/ob-i18n.js
modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/js/ob-kernel-utilities.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/form/formitem/ob-formitem-widgetinform.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-about-popup.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-calendar-widget.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-community-branding-widget.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-getting-started-view.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-getting-started-widget.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-showparameter-widget.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-url-widget.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-widget.js
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/test/ob-myopenbravo-test.js
modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-canvas-item.js
modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-view.js
modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js
modules/org.openbravo.client.widgets/web/org.openbravo.client.widgets/js/ob-gcal.js
modules/org.openbravo.client.widgets/web/org.openbravo.client.widgets/js/ob-twitter.js
modules/org.openbravo.service.datasource/web/org.openbravo.service.datasource/js/ob-datasource-utilities.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/classic-skin-variable.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-formitem-fk-combo.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-multi-selector-item.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-filter-select-item.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-link-widget.js
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/FIN_Utilities.js	Wed Jun 12 10:59:13 2019 +0200
@@ -24,14 +24,14 @@
 
 //Global variables definition
 var frm = null,
-    isReceipt = true,
-    isCreditAllowed = true,
-    isCreditCheckedFromBPinGrid = false,
-    isGLItemEnabled = false,
-    globalMaskNumeric = "#0.00",
-    globalDecSeparator = ".",
-    globalGroupSeparator = ",",
-    globalGroupInterval = "3";
+  isReceipt = true,
+  isCreditAllowed = true,
+  isCreditCheckedFromBPinGrid = false,
+  isGLItemEnabled = false,
+  globalMaskNumeric = '#0.00',
+  globalDecSeparator = '.',
+  globalGroupSeparator = ',',
+  globalGroupInterval = '3';
 
 function isTrue(objectName) {
   return frm.elements[objectName].value === 'Y';
@@ -39,11 +39,19 @@
 
 /* exported initFIN_Utilities */
 
-function initFIN_Utilities(_frm, _creditAllowed, _isCreditCheckedFromBPinGrid, _isGLItemEnabled) {
+function initFIN_Utilities(
+  _frm,
+  _creditAllowed,
+  _isCreditCheckedFromBPinGrid,
+  _isGLItemEnabled
+) {
   frm = _frm;
   isReceipt = isTrue('isReceipt');
   isCreditAllowed = _creditAllowed !== undefined ? _creditAllowed : true;
-  isCreditCheckedFromBPinGrid = _isCreditCheckedFromBPinGrid !== undefined ? _isCreditCheckedFromBPinGrid : false;
+  isCreditCheckedFromBPinGrid =
+    _isCreditCheckedFromBPinGrid !== undefined
+      ? _isCreditCheckedFromBPinGrid
+      : false;
   isGLItemEnabled = _isGLItemEnabled !== undefined ? _isGLItemEnabled : false;
   if (!isCreditAllowed) {
     frm.inpUseCredit.checked = false;
@@ -55,7 +63,13 @@
   globalMaskNumeric = formatNameToMask('euroEdition');
   if (!globalMaskNumeric && OB && OB.Format && OB.Format.formats) {
     globalMaskNumeric = OB.Format.formats.euroEdition;
-    globalMaskNumeric = returnMaskChange(globalMaskNumeric, '.', ',', globalDecSeparator, globalGroupSeparator);
+    globalMaskNumeric = returnMaskChange(
+      globalMaskNumeric,
+      '.',
+      ',',
+      globalDecSeparator,
+      globalGroupSeparator
+    );
   }
   globalMaskNumeric = globalMaskNumeric || getDefaultMaskNumeric();
 }
@@ -64,7 +78,7 @@
 
 function processLabels() {
   var receiptlbls = getElementsByName('lblR'),
-      i;
+    i;
   for (i = 0; i < receiptlbls.length; i++) {
     displayLogicElement(receiptlbls[i].id, isReceipt);
   }
@@ -76,10 +90,10 @@
 
 function selectDifferenceAction(value) {
   var diffAction = frm.inpDifferenceAction,
-      i;
+    i;
   for (i = 0; i < diffAction.length; i++) {
     diffAction[i].checked = false;
-    diffAction[i].checked = (diffAction[i].value === value);
+    diffAction[i].checked = diffAction[i].value === value;
   }
 }
 
@@ -91,7 +105,13 @@
  */
 
 function applyFormat(number) {
-  return returnFormattedNumber(number, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  return returnFormattedNumber(
+    number,
+    globalMaskNumeric,
+    globalDecSeparator,
+    globalGroupSeparator,
+    globalGroupInterval
+  );
 }
 
 /**
@@ -106,16 +126,25 @@
   if (!_globalMaskNumeric) {
     _globalMaskNumeric = globalMaskNumeric;
   }
-  return OB.Utilities.Number.JSToOBMasked(number, _globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  return OB.Utilities.Number.JSToOBMasked(
+    number,
+    _globalMaskNumeric,
+    globalDecSeparator,
+    globalGroupSeparator,
+    globalGroupInterval
+  );
 }
 
 /* exported applyFormatOBMaskedToJS */
 
 function applyFormatOBMaskedToJS(number) {
-  return OB.Utilities.Number.OBMaskedToJS(number, globalDecSeparator, globalGroupSeparator);
+  return OB.Utilities.Number.OBMaskedToJS(
+    number,
+    globalDecSeparator,
+    globalGroupSeparator
+  );
 }
 
-
 /**
  * Function to operate with formatted number
  * @param {Number} number1 The first operand
@@ -130,19 +159,27 @@
  * @deprecated TO BE REMOVED ON MP22
  */
 
-function formattedNumberOpTemp(number1, operator, number2, result_maskNumeric, decSeparator, groupSeparator, groupInterval) {
+function formattedNumberOpTemp(
+  number1,
+  operator,
+  number2,
+  result_maskNumeric,
+  decSeparator,
+  groupSeparator,
+  groupInterval
+) {
   var result;
 
-  if (result_maskNumeric === null || result_maskNumeric === "") {
+  if (result_maskNumeric === null || result_maskNumeric === '') {
     result_maskNumeric = getDefaultMaskNumeric();
   }
-  if (decSeparator === null || decSeparator === "") {
+  if (decSeparator === null || decSeparator === '') {
     decSeparator = getGlobalDecSeparator();
   }
-  if (groupSeparator === null || groupSeparator === "") {
+  if (groupSeparator === null || groupSeparator === '') {
     groupSeparator = getGlobalGroupSeparator();
   }
-  if (groupInterval === null || groupInterval === "") {
+  if (groupInterval === null || groupInterval === '') {
     groupInterval = getGlobalGroupInterval();
   }
 
@@ -152,15 +189,21 @@
   number2 = returnFormattedToCalc(number2, decSeparator, groupSeparator);
   number2 = parseFloat(number2);
 
-  if (operator === "sqrt") {
+  if (operator === 'sqrt') {
     result = Math.sqrt(number1);
-  } else if (operator === "round") {
+  } else if (operator === 'round') {
     result = roundNumber(number1, number2);
   } else {
     result = eval('(' + number1 + ')' + operator + '(' + number2 + ')');
   }
-  if (result !== true && result !== false && result !== null && result !== "") {
-    result = returnCalcToFormatted(result, result_maskNumeric, decSeparator, groupSeparator, groupInterval);
+  if (result !== true && result !== false && result !== null && result !== '') {
+    result = returnCalcToFormatted(
+      result,
+      result_maskNumeric,
+      decSeparator,
+      groupSeparator,
+      groupInterval
+    );
   }
   return result;
 }
@@ -174,12 +217,22 @@
 
 function abs(number1) {
   var result;
-  number1 = returnFormattedToCalc(number1, globalDecSeparator, globalGroupSeparator);
+  number1 = returnFormattedToCalc(
+    number1,
+    globalDecSeparator,
+    globalGroupSeparator
+  );
   number1 = parseFloat(number1);
   result = Math.abs(number1);
 
-  if (result !== null && result !== "") {
-    result = returnCalcToFormatted(result, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  if (result !== null && result !== '') {
+    result = returnCalcToFormatted(
+      result,
+      globalMaskNumeric,
+      globalDecSeparator,
+      globalGroupSeparator,
+      globalGroupInterval
+    );
   }
   return result;
 }
@@ -193,7 +246,15 @@
  */
 
 function add(number1, number2) {
-  return formattedNumberOpTemp(number1, '+', number2, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  return formattedNumberOpTemp(
+    number1,
+    '+',
+    number2,
+    globalMaskNumeric,
+    globalDecSeparator,
+    globalGroupSeparator,
+    globalGroupInterval
+  );
 }
 
 /**
@@ -205,7 +266,15 @@
  */
 
 function subtract(number1, number2) {
-  return formattedNumberOpTemp(number1, '-', number2, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  return formattedNumberOpTemp(
+    number1,
+    '-',
+    number2,
+    globalMaskNumeric,
+    globalDecSeparator,
+    globalGroupSeparator,
+    globalGroupInterval
+  );
 }
 
 /**
@@ -218,7 +287,15 @@
 /* exported divide */
 
 function divide(number1, number2) {
-  return formattedNumberOpTemp(number1, '/', number2, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  return formattedNumberOpTemp(
+    number1,
+    '/',
+    number2,
+    globalMaskNumeric,
+    globalDecSeparator,
+    globalGroupSeparator,
+    globalGroupInterval
+  );
 }
 
 /**
@@ -231,7 +308,15 @@
 /* exported multiply */
 
 function multiply(number1, number2) {
-  return formattedNumberOpTemp(number1, '*', number2, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  return formattedNumberOpTemp(
+    number1,
+    '*',
+    number2,
+    globalMaskNumeric,
+    globalDecSeparator,
+    globalGroupSeparator,
+    globalGroupInterval
+  );
 }
 
 /**
@@ -244,7 +329,15 @@
  */
 
 function compare(number1, operator, number2) {
-  return formattedNumberOpTemp(number1, operator, number2, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+  return formattedNumberOpTemp(
+    number1,
+    operator,
+    number2,
+    globalMaskNumeric,
+    globalDecSeparator,
+    globalGroupSeparator,
+    globalGroupInterval
+  );
 }
 
 /**
@@ -254,25 +347,60 @@
 
 function compareWithSign(number1, operator, number2) {
   if (compare(number1, '<', 0) && compare(number2, '<', 0)) {
-    if (operator === '<' || operator === '>' || operator === '<=' || operator === '>=') {
-      return formattedNumberOpTemp(abs(number2), operator, abs(number1), globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+    if (
+      operator === '<' ||
+      operator === '>' ||
+      operator === '<=' ||
+      operator === '>='
+    ) {
+      return formattedNumberOpTemp(
+        abs(number2),
+        operator,
+        abs(number1),
+        globalMaskNumeric,
+        globalDecSeparator,
+        globalGroupSeparator,
+        globalGroupInterval
+      );
     } else {
-      return formattedNumberOpTemp(abs(number1), operator, abs(number2), globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+      return formattedNumberOpTemp(
+        abs(number1),
+        operator,
+        abs(number2),
+        globalMaskNumeric,
+        globalDecSeparator,
+        globalGroupSeparator,
+        globalGroupInterval
+      );
     }
   } else {
-    return formattedNumberOpTemp(number1, operator, number2, globalMaskNumeric, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+    return formattedNumberOpTemp(
+      number1,
+      operator,
+      number2,
+      globalMaskNumeric,
+      globalDecSeparator,
+      globalGroupSeparator,
+      globalGroupInterval
+    );
   }
 }
 
 function isBetweenZeroAndMaxValue(value, maxValue) {
-  return ((compare(value, '>=', 0) && compare(value, '<=', maxValue)) || (compare(value, '<=', 0) && compare(value, '>=', maxValue)));
+  return (
+    (compare(value, '>=', 0) && compare(value, '<=', maxValue)) ||
+    (compare(value, '<=', 0) && compare(value, '>=', maxValue))
+  );
 }
 
 function applyPrecisionToMask(currencyPrecision) {
   var i, c, currentDecimalMask, currentPrecision;
   var toConvertDecimalMask = globalMaskNumeric;
   if (globalMaskNumeric.indexOf(globalDecSeparator) !== -1) {
-    currentDecimalMask = globalMaskNumeric.substring(globalMaskNumeric.indexOf(globalDecSeparator), globalMaskNumeric.length);
+    currentDecimalMask = globalMaskNumeric.substring(
+      globalMaskNumeric.indexOf(globalDecSeparator),
+      globalMaskNumeric.length
+    );
     currentPrecision = currentDecimalMask.length - globalDecSeparator.length;
     if (currentPrecision) {
       toConvertDecimalMask = globalDecSeparator;
@@ -280,7 +408,10 @@
       for (i = 0; i < currencyPrecision; i++) {
         toConvertDecimalMask = toConvertDecimalMask + c;
       }
-      toConvertDecimalMask = globalMaskNumeric.replace(currentDecimalMask, toConvertDecimalMask);
+      toConvertDecimalMask = globalMaskNumeric.replace(
+        currentDecimalMask,
+        toConvertDecimalMask
+      );
     }
   }
   return toConvertDecimalMask;
@@ -288,10 +419,18 @@
 
 function updateConvertedAmounts(recalcExchangeRate) {
   var exchangeRate = frm.inpExchangeRate;
-  var precision = frm.inpFinancialAccountCurrencyPrecision ? frm.inpFinancialAccountCurrencyPrecision.value : 2;
+  var precision = frm.inpFinancialAccountCurrencyPrecision
+    ? frm.inpFinancialAccountCurrencyPrecision.value
+    : 2;
   var roundedMask = applyPrecisionToMask(precision);
   var exchangeRateRoundedMask = OB.Format.formats.generalQtyEdition;
-  exchangeRateRoundedMask = returnMaskChange(exchangeRateRoundedMask, '.', ',', globalDecSeparator, globalGroupSeparator);
+  exchangeRateRoundedMask = returnMaskChange(
+    exchangeRateRoundedMask,
+    '.',
+    ',',
+    globalDecSeparator,
+    globalGroupSeparator
+  );
   var expectedConverted = frm.inpExpectedConverted;
   var actualConverted = frm.inpActualConverted;
   var expectedPayment = frm.inpExpectedPayment;
@@ -301,50 +440,79 @@
     if (recalcExchangeRate) {
       if (actualConverted.value && actualPayment.value) {
         if (compare(actualPayment.value, '!=', 0)) {
-          exchangeRate.value = formattedNumberOpTemp(actualConverted.value, '/', actualPayment.value, exchangeRateRoundedMask, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+          exchangeRate.value = formattedNumberOpTemp(
+            actualConverted.value,
+            '/',
+            actualPayment.value,
+            exchangeRateRoundedMask,
+            globalDecSeparator,
+            globalGroupSeparator,
+            globalGroupInterval
+          );
         }
       } else {
         exchangeRate.value = '';
       }
     } else {
       if (exchangeRate.value) {
-        actualConverted.value = formattedNumberOpTemp(actualPayment.value, '*', exchangeRate.value, roundedMask, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+        actualConverted.value = formattedNumberOpTemp(
+          actualPayment.value,
+          '*',
+          exchangeRate.value,
+          roundedMask,
+          globalDecSeparator,
+          globalGroupSeparator,
+          globalGroupInterval
+        );
       } else {
         actualConverted.value = applyFormat('0');
       }
     }
     if (exchangeRate.value && expectedPayment.value) {
-      expectedConverted.value = formattedNumberOpTemp(expectedPayment.value, '*', exchangeRate.value, roundedMask, globalDecSeparator, globalGroupSeparator, globalGroupInterval);
+      expectedConverted.value = formattedNumberOpTemp(
+        expectedPayment.value,
+        '*',
+        exchangeRate.value,
+        roundedMask,
+        globalDecSeparator,
+        globalGroupSeparator,
+        globalGroupInterval
+      );
     } else {
       expectedConverted.value = applyFormat('0');
     }
   }
 }
 
-function validateSelectedAmounts(recordID, existsPendingAmount, selectedAction) {
-  var pendingAmount = document.frmMain.elements["inpRecordAmt" + recordID].value,
-      amount = document.frmMain.elements["inpPaymentAmount" + recordID].value;
+function validateSelectedAmounts(
+  recordID,
+  existsPendingAmount,
+  selectedAction
+) {
+  var pendingAmount =
+      document.frmMain.elements['inpRecordAmt' + recordID].value,
+    amount = document.frmMain.elements['inpPaymentAmount' + recordID].value;
   if (existsPendingAmount === null) {
     existsPendingAmount = false;
   }
-  if (amount === null || amount === "") {
-    setWindowElementFocus(frm.elements["inpPaymentAmount" + recordID]);
+  if (amount === null || amount === '') {
+    setWindowElementFocus(frm.elements['inpPaymentAmount' + recordID]);
     showJSMessage(7);
     return false;
   }
   if (!isBetweenZeroAndMaxValue(amount, pendingAmount)) {
-    setWindowElementFocus(frm.elements["inpPaymentAmount" + recordID]);
+    setWindowElementFocus(frm.elements['inpPaymentAmount' + recordID]);
     showJSMessage(9);
     return false;
   }
   // Only possible to pay 0 in case of a write off
-  if (selectedAction !== "writeoff" && compare(amount, '==', 0)) {
-    setWindowElementFocus(frm.elements["inpPaymentAmount" + recordID]);
+  if (selectedAction !== 'writeoff' && compare(amount, '==', 0)) {
+    setWindowElementFocus(frm.elements['inpPaymentAmount' + recordID]);
     showJSMessage('APRM_JSZEROUNDERPAYMENT');
     return false;
   }
   if (existsPendingAmount && compare(amount, '<', pendingAmount)) {
-    setWindowElementFocus(frm.elements["inpPaymentAmount" + recordID]);
+    setWindowElementFocus(frm.elements['inpPaymentAmount' + recordID]);
     showJSMessage('APRM_JSNOTALLAMOUTALLOCATED');
     return false;
   }
@@ -352,9 +520,15 @@
 }
 
 function updateDifference() {
-  var expected = (frm.inpExpectedPayment && frm.inpExpectedPayment.value) ? frm.inpExpectedPayment.value : applyFormat('0'),
-      total = (frm.inpTotal && frm.inpTotal.value) ? frm.inpTotal.value : applyFormat('0'),
-      amount = total;
+  var expected =
+      frm.inpExpectedPayment && frm.inpExpectedPayment.value
+        ? frm.inpExpectedPayment.value
+        : applyFormat('0'),
+    total =
+      frm.inpTotal && frm.inpTotal.value
+        ? frm.inpTotal.value
+        : applyFormat('0'),
+    amount = total;
   var exchangeRate = frm.inpExchangeRate;
 
   if (frm.inpActualPayment !== null) {
@@ -370,10 +544,27 @@
   } else {
     frm.inpDifference.value = applyFormat('0');
   }
-  document.getElementById('paramDifference').innerHTML = frm.inpDifference.value;
-  displayLogicElement('sectionDifference', (compare(expected, '!=', total) || compareWithSign(amount, '>', total)));
-  displayLogicElement('sectionDifferenceBox', (compare(expected, '!=', total) || (isCreditAllowed && compareWithSign(amount, '>', total))));
-  if ((frm.strWriteOffLimit.value === 'Y') && (compare(expected, '!=', total)) && (frm.strtypewriteoff.value === 'A') && (compareWithSign((applyFormat((subtract(expected, total)) * exchangeRate.value)), '>', frm.strAmountwriteoff.value))) {
+  document.getElementById('paramDifference').innerHTML =
+    frm.inpDifference.value;
+  displayLogicElement(
+    'sectionDifference',
+    compare(expected, '!=', total) || compareWithSign(amount, '>', total)
+  );
+  displayLogicElement(
+    'sectionDifferenceBox',
+    compare(expected, '!=', total) ||
+      (isCreditAllowed && compareWithSign(amount, '>', total))
+  );
+  if (
+    frm.strWriteOffLimit.value === 'Y' &&
+    compare(expected, '!=', total) &&
+    frm.strtypewriteoff.value === 'A' &&
+    compareWithSign(
+      applyFormat(subtract(expected, total) * exchangeRate.value),
+      '>',
+      frm.strAmountwriteoff.value
+    )
+  ) {
     displayLogicElement('writeofflimit', true);
     displayLogicElement('writeoff', false);
   } else {
@@ -381,9 +572,20 @@
     displayLogicElement('writeoff', compare(expected, '!=', total));
   }
   displayLogicElement('underpayment', compareWithSign(expected, '>', total));
-  displayLogicElement('credit', isCreditAllowed && compareWithSign(amount, '>', total));
-  displayLogicElement('refund', isCreditAllowed && isReceipt && compareWithSign(amount, '>', total));
-  if (!(compare(expected, '!=', total) || (isCreditAllowed && compareWithSign(amount, '>', total)))) {
+  displayLogicElement(
+    'credit',
+    isCreditAllowed && compareWithSign(amount, '>', total)
+  );
+  displayLogicElement(
+    'refund',
+    isCreditAllowed && isReceipt && compareWithSign(amount, '>', total)
+  );
+  if (
+    !(
+      compare(expected, '!=', total) ||
+      (isCreditAllowed && compareWithSign(amount, '>', total))
+    )
+  ) {
     // No action available
     selectDifferenceAction('none');
   } else if (isCreditAllowed && compareWithSign(amount, '>', total)) {
@@ -398,11 +600,15 @@
 function updateTotal() {
   var chk = frm.inpScheduledPaymentDetailId;
   var total = applyFormat('0'),
-      i, invalidSpan;
-  var scheduledPaymentDetailId, pendingAmount, amount, isAnyChecked = false;
+    i,
+    invalidSpan;
+  var scheduledPaymentDetailId,
+    pendingAmount,
+    amount,
+    isAnyChecked = false;
   var selectedBusinessPartners = {
     numberofitems: 0,
-    increase: function (obj) {
+    increase: function(obj) {
       if (obj && obj.value) {
         var key = obj.value;
         var value = this[key];
@@ -414,19 +620,19 @@
         }
       }
     },
-    reset: function () {
+    reset: function() {
       var i;
       this.numberofitems = 0;
       for (i in this) {
         if (this.hasOwnProperty(i)) {
-          if (typeof this[i] !== "function") {
+          if (typeof this[i] !== 'function') {
             this[i] = 0;
           }
         }
       }
     },
-    isMultibpleSelection: function () {
-      return (this.numberofitems > 1);
+    isMultibpleSelection: function() {
+      return this.numberofitems > 1;
     }
   };
 
@@ -442,52 +648,89 @@
     //}
   } else if (!chk.length) {
     scheduledPaymentDetailId = frm.inpRecordId0.value;
-    pendingAmount = frm.elements["inpRecordAmt" + scheduledPaymentDetailId].value;
-    amount = frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value;
-    if (amount !== "" && !isBetweenZeroAndMaxValue(amount, pendingAmount)) {
-      setWindowElementFocus(frm.elements["inpPaymentAmount" + scheduledPaymentDetailId]);
+    pendingAmount =
+      frm.elements['inpRecordAmt' + scheduledPaymentDetailId].value;
+    amount = frm.elements['inpPaymentAmount' + scheduledPaymentDetailId].value;
+    if (amount !== '' && !isBetweenZeroAndMaxValue(amount, pendingAmount)) {
+      setWindowElementFocus(
+        frm.elements['inpPaymentAmount' + scheduledPaymentDetailId]
+      );
     } else {
       initialize_MessageBox('messageBoxID');
     }
     if (chk.checked) {
-      invalidSpan = document.getElementById('paraminvalidSpan' + scheduledPaymentDetailId);
+      invalidSpan = document.getElementById(
+        'paraminvalidSpan' + scheduledPaymentDetailId
+      );
       if (invalidSpan) {
-        document.getElementById('paraminvalidSpan' + scheduledPaymentDetailId).style.display = !isBetweenZeroAndMaxValue(amount, pendingAmount) ? 'block' : 'none';
+        document.getElementById(
+          'paraminvalidSpan' + scheduledPaymentDetailId
+        ).style.display = !isBetweenZeroAndMaxValue(amount, pendingAmount)
+          ? 'block'
+          : 'none';
       }
-      total = (frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value === '') ? "0" : frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value;
-      selectedBusinessPartners.increase(frm.elements['inpRecordBP' + scheduledPaymentDetailId]);
+      total =
+        frm.elements['inpPaymentAmount' + scheduledPaymentDetailId].value === ''
+          ? '0'
+          : frm.elements['inpPaymentAmount' + scheduledPaymentDetailId].value;
+      selectedBusinessPartners.increase(
+        frm.elements['inpRecordBP' + scheduledPaymentDetailId]
+      );
       isAnyChecked = true;
     }
   } else {
     var rows = chk.length;
     for (i = 0; i < rows; i++) {
-      scheduledPaymentDetailId = frm.elements["inpRecordId" + i].value;
-      pendingAmount = frm.elements["inpRecordAmt" + scheduledPaymentDetailId].value;
-      amount = frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value;
-      if (amount !== "" && !isBetweenZeroAndMaxValue(amount, pendingAmount)) {
-        setWindowElementFocus(frm.elements["inpPaymentAmount" + scheduledPaymentDetailId]);
+      scheduledPaymentDetailId = frm.elements['inpRecordId' + i].value;
+      pendingAmount =
+        frm.elements['inpRecordAmt' + scheduledPaymentDetailId].value;
+      amount =
+        frm.elements['inpPaymentAmount' + scheduledPaymentDetailId].value;
+      if (amount !== '' && !isBetweenZeroAndMaxValue(amount, pendingAmount)) {
+        setWindowElementFocus(
+          frm.elements['inpPaymentAmount' + scheduledPaymentDetailId]
+        );
       } else {
         initialize_MessageBox('messageBoxID');
       }
       if (chk[i].checked) {
-        invalidSpan = document.getElementById('paraminvalidSpan' + scheduledPaymentDetailId);
+        invalidSpan = document.getElementById(
+          'paraminvalidSpan' + scheduledPaymentDetailId
+        );
         if (invalidSpan) {
-          document.getElementById('paraminvalidSpan' + scheduledPaymentDetailId).style.display = !isBetweenZeroAndMaxValue(amount, pendingAmount) ? 'block' : 'none';
+          document.getElementById(
+            'paraminvalidSpan' + scheduledPaymentDetailId
+          ).style.display = !isBetweenZeroAndMaxValue(amount, pendingAmount)
+            ? 'block'
+            : 'none';
         }
-        total = (frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value === '') ? total : add(total, frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value);
-        selectedBusinessPartners.increase(frm.elements['inpRecordBP' + scheduledPaymentDetailId]);
+        total =
+          frm.elements['inpPaymentAmount' + scheduledPaymentDetailId].value ===
+          ''
+            ? total
+            : add(
+                total,
+                frm.elements['inpPaymentAmount' + scheduledPaymentDetailId]
+                  .value
+              );
+        selectedBusinessPartners.increase(
+          frm.elements['inpRecordBP' + scheduledPaymentDetailId]
+        );
         isAnyChecked = true;
       }
     }
   }
   if (isGLItemEnabled) {
     frm.inpInvoiceAmount.value = total;
-    document.getElementById('paramInvoicesAmt').innerHTML = frm.inpInvoiceAmount.value;
+    document.getElementById('paramInvoicesAmt').innerHTML =
+      frm.inpInvoiceAmount.value;
     total = add(total, frm.inpGLSumAmount.value);
   }
   frm.inpTotal.value = total;
   document.getElementById('paramTotal').innerHTML = frm.inpTotal.value;
-  var inheritedActualPayment = (frm.paramInheritedActualPayment && frm.paramInheritedActualPayment.value === "Y");
+  var inheritedActualPayment =
+    frm.paramInheritedActualPayment &&
+    frm.paramInheritedActualPayment.value === 'Y';
   if (!isReceipt && !inheritedActualPayment) {
     if (frm.inpUseCredit.checked) {
       if (compare(total, '>', frm.inpCredit.value)) {
@@ -500,7 +743,10 @@
         frm.inpActualPayment.value = frm.inpTotal.value;
       }
       if (frm.inpGeneratedCredit) {
-        frm.inpActualPayment.value = add(frm.inpTotal.value, frm.inpGeneratedCredit.value);
+        frm.inpActualPayment.value = add(
+          frm.inpTotal.value,
+          frm.inpGeneratedCredit.value
+        );
       }
     }
   }
@@ -528,7 +774,8 @@
     return;
   } else if (!chk.length) {
     scheduledPaymentDetailId = frm.inpRecordId0.value;
-    outstandingAmount = frm.elements["inpRecordAmt" + scheduledPaymentDetailId].value;
+    outstandingAmount =
+      frm.elements['inpRecordAmt' + scheduledPaymentDetailId].value;
     if (compare(outstandingAmount, '<', 0) && compare(amount, '<', 0)) {
       if (compare(abs(outstandingAmount), '>', abs(amount))) {
         outstandingAmount = amount;
@@ -538,7 +785,9 @@
         outstandingAmount = amount;
       }
     }
-    frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value = outstandingAmount;
+    frm.elements[
+      'inpPaymentAmount' + scheduledPaymentDetailId
+    ].value = outstandingAmount;
     if (!chk.checked && compare(outstandingAmount, '!=', 0)) {
       chk.checked = true;
       updateData(chk.value, chk.checked);
@@ -547,10 +796,16 @@
     var total = chk.length;
     for (i = 0; i < total; i++) {
       if (chk[i].checked) {
-        distributedAmount = add(distributedAmount, frm.elements["inpPaymentAmount" + chk[i].value].value);
+        distributedAmount = add(
+          distributedAmount,
+          frm.elements['inpPaymentAmount' + chk[i].value].value
+        );
       }
     }
-    if (compare(amount, '>', distributedAmount) || compare(amount, '==', distributedAmount)) {
+    if (
+      compare(amount, '>', distributedAmount) ||
+      compare(amount, '==', distributedAmount)
+    ) {
       amount = subtract(amount, distributedAmount);
       keepSelection = true;
     }
@@ -558,8 +813,9 @@
       if (chk[i].checked && keepSelection) {
         continue;
       }
-      scheduledPaymentDetailId = frm.elements["inpRecordId" + i].value;
-      outstandingAmount = frm.elements["inpRecordAmt" + scheduledPaymentDetailId].value;
+      scheduledPaymentDetailId = frm.elements['inpRecordId' + i].value;
+      outstandingAmount =
+        frm.elements['inpRecordAmt' + scheduledPaymentDetailId].value;
       if (compare(outstandingAmount, '<', 0) && compare(amount, '<', 0)) {
         if (compare(abs(outstandingAmount), '>', abs(amount))) {
           outstandingAmount = amount;
@@ -570,7 +826,7 @@
         }
       }
       if (compare(amount, '==', 0)) {
-        frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value = "";
+        frm.elements['inpPaymentAmount' + scheduledPaymentDetailId].value = '';
         for (j = 0; j < total; j++) {
           if (chk[j].checked && chk[j].value === scheduledPaymentDetailId) {
             chk[j].checked = false;
@@ -578,7 +834,9 @@
           }
         }
       } else {
-        frm.elements["inpPaymentAmount" + scheduledPaymentDetailId].value = outstandingAmount;
+        frm.elements[
+          'inpPaymentAmount' + scheduledPaymentDetailId
+        ].value = outstandingAmount;
         for (j = 0; j < total; j++) {
           if (!chk[j].checked && chk[j].value === scheduledPaymentDetailId) {
             chk[j].checked = true;
@@ -599,20 +857,24 @@
   if (mark === null) {
     mark = false;
   }
-  frm.elements["inpPaymentAmount" + key].disabled = !mark;
+  frm.elements['inpPaymentAmount' + key].disabled = !mark;
   var expectedAmount = frm.inpExpectedPayment.value,
-      invalidSpan;
-  var recordAmount = frm.elements["inpRecordAmt" + key].value;
+    invalidSpan;
+  var recordAmount = frm.elements['inpRecordAmt' + key].value;
 
   if (mark) {
-    frm.elements["inpPaymentAmount" + key].className = frm.elements["inpPaymentAmount" + key].className.replace(' readonly', '');
+    frm.elements['inpPaymentAmount' + key].className = frm.elements[
+      'inpPaymentAmount' + key
+    ].className.replace(' readonly', '');
     frm.inpExpectedPayment.value = add(expectedAmount, recordAmount);
   } else {
-    var classText = frm.elements["inpPaymentAmount" + key].className;
+    var classText = frm.elements['inpPaymentAmount' + key].className;
     if (classText.search('readonly') === -1) {
-      frm.elements["inpPaymentAmount" + key].className = classText.concat(" readonly");
+      frm.elements['inpPaymentAmount' + key].className = classText.concat(
+        ' readonly'
+      );
     }
-    frm.elements["inpPaymentAmount" + key].value = '';
+    frm.elements['inpPaymentAmount' + key].value = '';
     frm.inpExpectedPayment.value = subtract(expectedAmount, recordAmount);
     invalidSpan = document.getElementById('paraminvalidSpan' + key);
     if (invalidSpan) {
@@ -640,16 +902,22 @@
     return;
   } else if (!chk.length) {
     if (!chk.checked) {
-      recordAmount = frm.elements["inpRecordAmt" + chk.value].value;
-      frm.inpExpectedPayment.value = add(frm.inpExpectedPayment.value, recordAmount);
+      recordAmount = frm.elements['inpRecordAmt' + chk.value].value;
+      frm.inpExpectedPayment.value = add(
+        frm.inpExpectedPayment.value,
+        recordAmount
+      );
     }
     updateData(chk.value, chk.checked, drivenByGrid);
   } else {
     var total = chk.length;
     for (i = 0; i < total; i++) {
       if (!chk[i].checked) {
-        recordAmount = frm.elements["inpRecordAmt" + chk[i].value].value;
-        frm.inpExpectedPayment.value = add(frm.inpExpectedPayment.value, recordAmount);
+        recordAmount = frm.elements['inpRecordAmt' + chk[i].value].value;
+        frm.inpExpectedPayment.value = add(
+          frm.inpExpectedPayment.value,
+          recordAmount
+        );
       }
       updateData(chk[i].value, chk[i].checked, drivenByGrid);
     }
@@ -665,16 +933,20 @@
  */
 /* exported validateSelectedPendingPayments */
 
-function validateSelectedPendingPayments(allowNotSelectingPendingPayment, action) {
+function validateSelectedPendingPayments(
+  allowNotSelectingPendingPayment,
+  action
+) {
   if (allowNotSelectingPendingPayment === undefined) {
     allowNotSelectingPendingPayment = false;
   }
   // If no credit usage is allowed we are forced to select at least one pending payment.
-  allowNotSelectingPendingPayment = isCreditAllowed && allowNotSelectingPendingPayment;
+  allowNotSelectingPendingPayment =
+    isCreditAllowed && allowNotSelectingPendingPayment;
   var actualPayment = document.frmMain.inpActualPayment.value;
   var i;
   if (document.frmMain.inpUseCredit.checked) {
-/*if ( compare(expectedPayment, '<=', actualPayment) ) {
+    /*if ( compare(expectedPayment, '<=', actualPayment) ) {
       setWindowElementFocus(document.frmMain.inpUseCredit);
       showJSMessage('APRM_JSCANNOTUSECREDIT');
       return false;
@@ -696,11 +968,20 @@
     return true;
   } else if (!chk.length) {
     if (chk.checked) {
-      if (!validateSelectedAmounts(chk.value, compare(selectedTotal, '<', actualPayment), action)) {
+      if (
+        !validateSelectedAmounts(
+          chk.value,
+          compare(selectedTotal, '<', actualPayment),
+          action
+        )
+      ) {
         return false;
       }
     } else {
-      if (!(typeof OB !== 'undefined' && OB.APRM && OB.APRM.HasGLItems) && (!allowNotSelectingPendingPayment || compare(actualPayment, '==', "0"))) {
+      if (
+        !(typeof OB !== 'undefined' && OB.APRM && OB.APRM.HasGLItems) &&
+        (!allowNotSelectingPendingPayment || compare(actualPayment, '==', '0'))
+      ) {
         showJSMessage('APRM_JSNOTLINESELECTED');
         return false;
       }
@@ -711,12 +992,22 @@
     for (i = 0; i < total; i++) {
       if (chk[i].checked) {
         isAnyChecked = true;
-        if (!validateSelectedAmounts(chk[i].value, compare(selectedTotal, '<', actualPayment), action)) {
+        if (
+          !validateSelectedAmounts(
+            chk[i].value,
+            compare(selectedTotal, '<', actualPayment),
+            action
+          )
+        ) {
           return false;
         }
       }
     }
-    if (!(typeof OB !== 'undefined' && OB.APRM && OB.APRM.HasGLItems) && !isAnyChecked && (!allowNotSelectingPendingPayment || compare(actualPayment, '==', "0"))) {
+    if (
+      !(typeof OB !== 'undefined' && OB.APRM && OB.APRM.HasGLItems) &&
+      !isAnyChecked &&
+      (!allowNotSelectingPendingPayment || compare(actualPayment, '==', '0'))
+    ) {
       showJSMessage('APRM_JSNOTLINESELECTED');
       return false;
     }
@@ -734,22 +1025,25 @@
 /* exported createCombo */
 
 function createCombo(object, innerHTML) {
-  object.innerHTML = "";
-  var selTemp = document.createElement("temp");
+  object.innerHTML = '';
+  var selTemp = document.createElement('temp');
   var opt, i, j;
-  selTemp.id = "temp1";
+  selTemp.id = 'temp1';
   document.body.appendChild(selTemp);
-  selTemp = document.getElementById("temp1");
-  selTemp.style.display = "none";
-  innerHTML = innerHTML.replace(/<option/g, "<span").replace(/<\/option/g, "</span");
+  selTemp = document.getElementById('temp1');
+  selTemp.style.display = 'none';
+  innerHTML = innerHTML
+    .replace(/<option/g, '<span')
+    .replace(/<\/option/g, '</span');
   selTemp.innerHTML = innerHTML;
 
   for (i = 0; i < selTemp.childNodes.length; i++) {
     var spantemp = selTemp.childNodes[i];
 
     if (spantemp.tagName) {
-      opt = document.createElement("option");
-      if (document.all) { //IE
+      opt = document.createElement('option');
+      if (document.all) {
+        //IE
         object.add(opt);
       } else {
         object.appendChild(opt);
@@ -769,7 +1063,7 @@
         }
       }
       //value and text
-      opt.value = spantemp.getAttribute("value");
+      opt.value = spantemp.getAttribute('value');
       opt.text = spantemp.innerHTML;
       //IE
       opt.selected = spantemp.getAttribute('selected');
@@ -791,17 +1085,28 @@
   try {
     f = getFrame('LayoutMDI');
     popup = f && f.OB && f.OB.Layout.ClassicOBCompatibility.Popup;
-    layoutMDI = popup && popup.getPopup('process') && popup.getPopup('process').getIframeHtmlObj() && popup.getPopup('process').getIframeHtmlObj().contentWindow && popup.getPopup('process').getIframeHtmlObj().contentWindow.frames[0];
+    layoutMDI =
+      popup &&
+      popup.getPopup('process') &&
+      popup.getPopup('process').getIframeHtmlObj() &&
+      popup.getPopup('process').getIframeHtmlObj().contentWindow &&
+      popup.getPopup('process').getIframeHtmlObj().contentWindow.frames[0];
     dad = layoutMDI || top.opener;
     if (dad) {
-      if (typeof dad.loadGrid === "function" || typeof dad.loadGrid === "object") {
+      if (
+        typeof dad.loadGrid === 'function' ||
+        typeof dad.loadGrid === 'object'
+      ) {
         dad.loadGrid();
-      } else if (typeof dad.updateGridDataAfterFilter === "function" || typeof dad.updateGridDataAfterFilter === "object") {
+      } else if (
+        typeof dad.updateGridDataAfterFilter === 'function' ||
+        typeof dad.updateGridDataAfterFilter === 'object'
+      ) {
         dad.updateGridDataAfterFilter();
       }
     } else if (f && f.OB.MainView.TabSet.getSelectedTab().pane.view) {
       var theView = f.OB.MainView.TabSet.getSelectedTab().pane.view;
-      theView.refresh(function () {
+      theView.refresh(function() {
         theView.getTabMessage();
         theView.toolBar.refreshCustomButtons();
       });
@@ -821,6 +1126,8 @@
   try {
     return eval('(' + jsonString + ')'); // do the eval
   } catch (e) {
-    throw new SyntaxError("Invalid JSON string: " + e.message + " parsing: " + jsonString);
+    throw new SyntaxError(
+      'Invalid JSON string: ' + e.message + ' parsing: ' + jsonString
+    );
   }
-}
\ No newline at end of file
+}
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Wed Jun 12 10:59:13 2019 +0200
@@ -17,17 +17,35 @@
  ************************************************************************
  */
 OB.APRM.AddPayment = {
-  ordInvDataArrived: function (startRow, endRow) {
-    var i, selectedRecords = this.getSelectedRecords();
+  ordInvDataArrived: function(startRow, endRow) {
+    var i,
+      selectedRecords = this.getSelectedRecords();
     this.Super('dataArrived', arguments);
     for (i = 0; i < selectedRecords; i++) {
-      this.setEditValues(this.getRecordIndex(selectedRecords[i]), selectedRecords[i]);
+      this.setEditValues(
+        this.getRecordIndex(selectedRecords[i]),
+        selectedRecords[i]
+      );
     }
   },
-  ordInvTransformData: function (newData, dsResponse) {
-    var i, j, record, data, ids, grid, editedRecord, isSelected, selectedRecord, curAmount, curOutstandingAmt, curPending, availableAmt, checkContainsAny;
-    checkContainsAny = function (base, arrayCompare) {
-      var i, arrayBase = base.replaceAll(' ', '').split(',');
+  ordInvTransformData: function(newData, dsResponse) {
+    var i,
+      j,
+      record,
+      data,
+      ids,
+      grid,
+      editedRecord,
+      isSelected,
+      selectedRecord,
+      curAmount,
+      curOutstandingAmt,
+      curPending,
+      availableAmt,
+      checkContainsAny;
+    checkContainsAny = function(base, arrayCompare) {
+      var i,
+        arrayBase = base.replaceAll(' ', '').split(',');
       for (i = 0; i < arrayCompare.length; i++) {
         if (arrayBase.contains(arrayCompare[i].trim())) {
           return true;
@@ -50,14 +68,26 @@
       record = data[i];
       ids = OB.APRM.AddPayment.orderAndRemoveDuplicates(record.id);
       record.id = ids;
-      record.invoiceNo = OB.APRM.AddPayment.orderAndRemoveDuplicates(record.invoiceNo);
-      record.salesOrderNo = OB.APRM.AddPayment.orderAndRemoveDuplicates(record.salesOrderNo);
-      if (grid.changedTrxType && grid.editedSelectedRecords && grid.editedSelectedRecords.length >= 1) {
+      record.invoiceNo = OB.APRM.AddPayment.orderAndRemoveDuplicates(
+        record.invoiceNo
+      );
+      record.salesOrderNo = OB.APRM.AddPayment.orderAndRemoveDuplicates(
+        record.salesOrderNo
+      );
+      if (
+        grid.changedTrxType &&
+        grid.editedSelectedRecords &&
+        grid.editedSelectedRecords.length >= 1
+      ) {
         isSelected = false;
         editedRecord = isc.addProperties({}, record);
 
-        curAmount = isc.isA.Number(editedRecord.amount) ? new BigDecimal(String(editedRecord.amount)) : BigDecimal.prototype.ZERO;
-        curOutstandingAmt = isc.isA.Number(editedRecord.outstandingAmount) ? new BigDecimal(String(editedRecord.outstandingAmount)) : BigDecimal.prototype.ZERO;
+        curAmount = isc.isA.Number(editedRecord.amount)
+          ? new BigDecimal(String(editedRecord.amount))
+          : BigDecimal.prototype.ZERO;
+        curOutstandingAmt = isc.isA.Number(editedRecord.outstandingAmount)
+          ? new BigDecimal(String(editedRecord.outstandingAmount))
+          : BigDecimal.prototype.ZERO;
         for (j = 0; j < grid.editedSelectedRecords.length; j++) {
           selectedRecord = grid.editedSelectedRecords[j];
 
@@ -67,7 +97,9 @@
             availableAmt = new BigDecimal(String(selectedRecord.amount));
             if (availableAmt.subtract(curPending).signum() === 1) {
               curAmount = BigDecimal.prototype.ZERO.add(curOutstandingAmt);
-              selectedRecord.amount = Number(availableAmt.subtract(curPending).toString());
+              selectedRecord.amount = Number(
+                availableAmt.subtract(curPending).toString()
+              );
             } else {
               curAmount = curAmount.add(availableAmt);
               selectedRecord.amount = 0;
@@ -92,29 +124,37 @@
   }
 };
 
-OB.APRM.AddPayment.onLoad = function (view) {
+OB.APRM.AddPayment.onLoad = function(view) {
   var form = view.theForm,
-      orderInvoiceGrid = form.getItem('order_invoice').canvas.viewGrid,
-      glitemGrid = form.getItem('glitem').canvas.viewGrid,
-      creditUseGrid = form.getItem('credit_to_use').canvas.viewGrid,
-      overpaymentAction = form.getItem('overpayment_action'),
-      payment = form.getItem('fin_payment_id').getValue(),
-      issotrx = form.getItem('issotrx').getValue(),
-      trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "",
-      trxtypeParam = null,
-      orgParam = null,
-      bankStatementLineAmount = null,
-      bankStatementLineId;
-  if (view && view.callerField && view.callerField.view && view.callerField.view.callerField && view.callerField.view.callerField.record && //
-  typeof view.callerField.view.callerField.record.affinity !== 'undefined' && //
-  typeof view.callerField.view.callerField.record.matchingType !== 'undefined') {
+    orderInvoiceGrid = form.getItem('order_invoice').canvas.viewGrid,
+    glitemGrid = form.getItem('glitem').canvas.viewGrid,
+    creditUseGrid = form.getItem('credit_to_use').canvas.viewGrid,
+    overpaymentAction = form.getItem('overpayment_action'),
+    payment = form.getItem('fin_payment_id').getValue(),
+    issotrx = form.getItem('issotrx').getValue(),
+    trxtype = form.getItem('trxtype') ? form.getItem('trxtype').getValue() : '',
+    trxtypeParam = null,
+    orgParam = null,
+    bankStatementLineAmount = null,
+    bankStatementLineId;
+  if (
+    view &&
+    view.callerField &&
+    view.callerField.view &&
+    view.callerField.view.callerField &&
+    view.callerField.view.callerField.record && //
+    typeof view.callerField.view.callerField.record.affinity !== 'undefined' && //
+    typeof view.callerField.view.callerField.record.matchingType !== 'undefined'
+  ) {
     // If all this conditions are true it means that we are inside the 'Add Payment' process, inside the 'Add Transaction' process, inside the 'Match Statement' process
     // and in this case we need the 'bankStatementLineId'
     bankStatementLineId = view.callerField.view.callerField.record.id;
-    view.theForm.addField(isc.OBTextItem.create({
-      name: 'bankStatementLineId',
-      value: bankStatementLineId
-    }));
+    view.theForm.addField(
+      isc.OBTextItem.create({
+        name: 'bankStatementLineId',
+        value: bankStatementLineId
+      })
+    );
     view.theForm.hideItem('bankStatementLineId');
   }
 
@@ -123,22 +163,29 @@
   glitemGrid.fetchData();
   creditUseGrid.fetchData();
   orderInvoiceGrid.selectionChanged = OB.APRM.AddPayment.selectionChanged;
-  orderInvoiceGrid.userSelectAllRecords = OB.APRM.AddPayment.userSelectAllRecords;
+  orderInvoiceGrid.userSelectAllRecords =
+    OB.APRM.AddPayment.userSelectAllRecords;
   orderInvoiceGrid.deselectAllRecords = OB.APRM.AddPayment.deselectAllRecords;
-  orderInvoiceGrid.dataProperties.transformData = OB.APRM.AddPayment.ordInvTransformData;
+  orderInvoiceGrid.dataProperties.transformData =
+    OB.APRM.AddPayment.ordInvTransformData;
   glitemGrid.removeRecordClick = OB.APRM.AddPayment.removeRecordClick;
   creditUseGrid.selectionChanged = OB.APRM.AddPayment.selectionChangedCredit;
   creditUseGrid.userSelectAllRecords = OB.APRM.AddPayment.userSelectAllRecords;
   creditUseGrid.deselectAllRecords = OB.APRM.AddPayment.deselectAllRecords;
   orderInvoiceGrid.dataArrived = OB.APRM.AddPayment.ordInvDataArrived;
 
-  form.isCreditAllowed = form.getItem('received_from').getValue() !== undefined && form.getItem('received_from').getValue() !== null;
+  form.isCreditAllowed =
+    form.getItem('received_from').getValue() !== undefined &&
+    form.getItem('received_from').getValue() !== null;
   OB.APRM.AddPayment.checkSingleActionAvailable(form);
-  overpaymentAction.originalValueMap = isc.addProperties({}, overpaymentAction.getValueMap());
+  overpaymentAction.originalValueMap = isc.addProperties(
+    {},
+    overpaymentAction.getValueMap()
+  );
   if (issotrx) {
     form.focusInItem(form.getItem('actual_payment'));
   }
-  if (trxtype === "") {
+  if (trxtype === '') {
     trxtypeParam = form.getField(0);
     form.removeField(0);
     orgParam = form.getField(0);
@@ -151,40 +198,50 @@
   }
 };
 
-OB.APRM.AddPayment.addNewGLItem = function (grid) {
+OB.APRM.AddPayment.addNewGLItem = function(grid) {
   var returnObject = isc.addProperties({}, grid.data[0]);
   returnObject.paidOut = 0;
   returnObject.receivedIn = 0;
   return returnObject;
 };
 
-OB.APRM.AddPayment.paymentMethodMulticurrency = function (view, form, recalcConvRate) {
-  var callback, financialAccountId = form.getItem('fin_financial_account_id').getValue(),
-      paymentMethodId = form.getItem('fin_paymentmethod_id').getValue(),
-      isSOTrx = form.getItem('issotrx').getValue(),
-      currencyId = form.getItem('c_currency_id').getValue(),
-      paymentDate = form.getItem('payment_date').getValue(),
-      orgId = form.getItem('ad_org_id').getValue(),
-      trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "";
+OB.APRM.AddPayment.paymentMethodMulticurrency = function(
+  view,
+  form,
+  recalcConvRate
+) {
+  var callback,
+    financialAccountId = form.getItem('fin_financial_account_id').getValue(),
+    paymentMethodId = form.getItem('fin_paymentmethod_id').getValue(),
+    isSOTrx = form.getItem('issotrx').getValue(),
+    currencyId = form.getItem('c_currency_id').getValue(),
+    paymentDate = form.getItem('payment_date').getValue(),
+    orgId = form.getItem('ad_org_id').getValue(),
+    trxtype = form.getItem('trxtype') ? form.getItem('trxtype').getValue() : '';
 
-  callback = function (response, data, request) {
+  callback = function(response, data, request) {
     var isShown = false;
     if (data.currencyId) {
       if (!form.getItem('c_currency_id').valueMap) {
         form.getItem('c_currency_id').valueMap = {};
       }
       form.getItem('c_currency_id').setValue(data.currencyId);
-      form.getItem('c_currency_id').valueMap[data.currencyId] = data.currencyIdIdentifier;
+      form.getItem('c_currency_id').valueMap[data.currencyId] =
+        data.currencyIdIdentifier;
     }
-    isShown = data.isPayIsMulticurrency && currencyId !== data.currencyToId && currencyId !== undefined;
-    if (data.isWrongFinancialAccount && trxtype === "") {
+    isShown =
+      data.isPayIsMulticurrency &&
+      currencyId !== data.currencyToId &&
+      currencyId !== undefined;
+    if (data.isWrongFinancialAccount && trxtype === '') {
       form.getItem('fin_financial_account_id').setValue('');
     } else if (!data.isWrongFinancialAccount) {
       if (!form.getItem('c_currency_to_id').valueMap) {
         form.getItem('c_currency_to_id').valueMap = {};
       }
       form.getItem('c_currency_to_id').setValue(data.currencyToId);
-      form.getItem('c_currency_to_id').valueMap[data.currencyToId] = data.currencyToIdentifier;
+      form.getItem('c_currency_to_id').valueMap[data.currencyToId] =
+        data.currencyToIdentifier;
       if (recalcConvRate) {
         form.getItem('conversion_rate').setValue(data.conversionrate);
         form.getItem('converted_amount').setValue(data.convertedamount);
@@ -197,19 +254,24 @@
     form.redraw();
   };
 
-  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.PaymentMethodMulticurrencyActionHandler', {
-    paymentMethodId: paymentMethodId,
-    currencyId: currencyId,
-    isSOTrx: isSOTrx,
-    financialAccountId: financialAccountId,
-    paymentDate: paymentDate,
-    orgId: orgId
-  }, {}, callback);
+  OB.RemoteCallManager.call(
+    'org.openbravo.advpaymentmngt.actionHandler.PaymentMethodMulticurrencyActionHandler',
+    {
+      paymentMethodId: paymentMethodId,
+      currencyId: currencyId,
+      isSOTrx: isSOTrx,
+      financialAccountId: financialAccountId,
+      paymentDate: paymentDate,
+      orgId: orgId
+    },
+    {},
+    callback
+  );
 };
 
-OB.APRM.AddPayment.checkSingleActionAvailable = function (form) {
+OB.APRM.AddPayment.checkSingleActionAvailable = function(form) {
   var documentAction = form.getItem('document_action');
-  documentAction.fetchData(function (item, dsResponse, data, dsRequest) {
+  documentAction.fetchData(function(item, dsResponse, data, dsRequest) {
     if (dsResponse.totalRows === 1) {
       item.setValueFromRecord(data[0]);
     } else {
@@ -218,46 +280,59 @@
   });
 };
 
-OB.APRM.AddPayment.financialAccountOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.financialAccountOnChange = function(item, view, form, grid) {
   var affectedParams = [];
   OB.APRM.AddPayment.paymentMethodMulticurrency(view, form, true);
   OB.APRM.AddPayment.checkSingleActionAvailable(form);
   affectedParams.push(form.getField('c_currency_id_readonly_logic').paramId);
-  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, view, affectedParams);
+  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(
+    form,
+    view,
+    affectedParams
+  );
 };
 
-OB.APRM.AddPayment.paymentDateOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.paymentDateOnChange = function(item, view, form, grid) {
   OB.APRM.AddPayment.paymentMethodMulticurrency(view, form, true);
 };
 
-OB.APRM.AddPayment.paymentMethodOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.paymentMethodOnChange = function(item, view, form, grid) {
   var ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
-      defaultFilter = ordinvgrid.filterEditor.getEditForm().getValues(),
-      trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "",
-      affectedParams = [];
+    defaultFilter = ordinvgrid.filterEditor.getEditForm().getValues(),
+    trxtype = form.getItem('trxtype') ? form.getItem('trxtype').getValue() : '',
+    affectedParams = [];
   isc.addProperties(defaultFilter, {
     paymentMethodName: item.getElementValue()
   });
   OB.APRM.AddPayment.paymentMethodMulticurrency(view, form, true);
   OB.APRM.AddPayment.checkSingleActionAvailable(form);
-  if (trxtype !== "") {
+  if (trxtype !== '') {
     ordinvgrid.setFilterEditorCriteria(defaultFilter);
     ordinvgrid.filterByEditor();
   }
   affectedParams.push(form.getField('c_currency_id_readonly_logic').paramId);
-  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, view, affectedParams);
+  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(
+    form,
+    view,
+    affectedParams
+  );
 };
 
-OB.APRM.AddPayment.currencyOnChange = function (item, view, form, grid) {
-  var trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "",
-      ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
-      newCriteria;
-  if (trxtype !== "") {
+OB.APRM.AddPayment.currencyOnChange = function(item, view, form, grid) {
+  var trxtype = form.getItem('trxtype')
+      ? form.getItem('trxtype').getValue()
+      : '',
+    ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
+    newCriteria;
+  if (trxtype !== '') {
     OB.APRM.AddPayment.paymentMethodMulticurrency(view, form, true);
 
     // fetch data after change trx type, filters should be preserved and ids of
     // the selected records should be sent
-    newCriteria = ordinvgrid.addSelectedIDsToCriteria(ordinvgrid.getCriteria(), true);
+    newCriteria = ordinvgrid.addSelectedIDsToCriteria(
+      ordinvgrid.getCriteria(),
+      true
+    );
     newCriteria.criteria = newCriteria.criteria || [];
     // add dummy criterion to force fetch
     newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
@@ -267,11 +342,18 @@
   }
 };
 
-OB.APRM.AddPayment.transactionTypeOnChangeFunction = function (item, view, form, grid) {
+OB.APRM.AddPayment.transactionTypeOnChangeFunction = function(
+  item,
+  view,
+  form,
+  grid
+) {
   var ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
-      selectedRecords = ordinvgrid.getSelectedRecords(),
-      editedSelectedRecords = [],
-      editedRecord, i, newCriteria;
+    selectedRecords = ordinvgrid.getSelectedRecords(),
+    editedSelectedRecords = [],
+    editedRecord,
+    i,
+    newCriteria;
 
   if (item.getValue() === item.oldSelectedValue) {
     // only fetch new data if the selected value has changed.
@@ -280,7 +362,9 @@
   item.oldSelectedValue = item.getValue();
   // Load current selection values to redistribute amounts when new data is loaded.
   for (i = 0; i < selectedRecords.length; i++) {
-    editedRecord = ordinvgrid.getEditedRecord(ordinvgrid.getRecordIndex(selectedRecords[i]));
+    editedRecord = ordinvgrid.getEditedRecord(
+      ordinvgrid.getRecordIndex(selectedRecords[i])
+    );
     editedRecord.ids = selectedRecords[i].id.replaceAll(' ', '').split(',');
     editedSelectedRecords.push(editedRecord);
   }
@@ -289,7 +373,10 @@
 
   // fetch data after change trx type, filters should be preserved and ids of
   // the selected records should be sent
-  newCriteria = ordinvgrid.addSelectedIDsToCriteria(ordinvgrid.getCriteria(), true);
+  newCriteria = ordinvgrid.addSelectedIDsToCriteria(
+    ordinvgrid.getCriteria(),
+    true
+  );
   newCriteria.criteria = newCriteria.criteria || [];
   // add dummy criterion to force fetch
   newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
@@ -298,7 +385,7 @@
   form.redraw();
 };
 
-OB.APRM.AddPayment.actualPaymentOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.actualPaymentOnChange = function(item, view, form, grid) {
   var issotrx = form.getItem('issotrx').getValue();
   if (issotrx) {
     OB.APRM.AddPayment.distributeAmount(view, form, true);
@@ -306,14 +393,14 @@
   }
 };
 
-OB.APRM.AddPayment.orderInvoiceOnLoadGrid = function (grid) {
+OB.APRM.AddPayment.orderInvoiceOnLoadGrid = function(grid) {
   var issotrx = this.view.theForm.getItem('issotrx').getValue(),
-      payment = this.view.theForm.getItem('fin_payment_id').getValue();
+    payment = this.view.theForm.getItem('fin_payment_id').getValue();
   grid.isReady = true;
   if (grid.obaprmAllRecordsSelectedByUser) {
     delete grid.obaprmAllRecordsSelectedByUser;
   }
-  if ((issotrx || !payment) && (grid.selectedIds.length === 0)) {
+  if ((issotrx || !payment) && grid.selectedIds.length === 0) {
     OB.APRM.AddPayment.distributeAmount(this.view, this.view.theForm, false);
   } else {
     OB.APRM.AddPayment.updateInvOrderTotal(this.view.theForm, grid);
@@ -321,11 +408,13 @@
   OB.APRM.AddPayment.tryToUpdateActualExpected(this.view.theForm);
 };
 
-OB.APRM.AddPayment.glitemsOnLoadGrid = function (grid) {
+OB.APRM.AddPayment.glitemsOnLoadGrid = function(grid) {
   if (!grid.isReady) {
     // If Gl Items Grid contains records when first opened then section is uncollapsed
     if (grid.getSelectedRecords() && grid.getSelectedRecords().size() > 0) {
-      grid.view.theForm.getItem('7B6B5F5475634E35A85CF7023165E50B').expandSection();
+      grid.view.theForm
+        .getItem('7B6B5F5475634E35A85CF7023165E50B')
+        .expandSection();
     }
     if (grid.autoFitFieldWidths) {
       // There is a problem with the grid calculating the auto fit field width if it is drawn inside an collapsed section.
@@ -340,7 +429,7 @@
   OB.APRM.AddPayment.tryToUpdateActualExpected(this.view.theForm);
 };
 
-OB.APRM.AddPayment.creditOnLoadGrid = function (grid) {
+OB.APRM.AddPayment.creditOnLoadGrid = function(grid) {
   grid.isReady = true;
   if (grid.obaprmAllRecordsSelectedByUser) {
     delete grid.obaprmAllRecordsSelectedByUser;
@@ -349,51 +438,100 @@
   OB.APRM.AddPayment.tryToUpdateActualExpected(this.view.theForm);
 };
 
-OB.APRM.AddPayment.tryToUpdateActualExpected = function (form) {
+OB.APRM.AddPayment.tryToUpdateActualExpected = function(form) {
   var orderInvoiceGrid = form.getItem('order_invoice').canvas.viewGrid,
-      glitemGrid = form.getItem('glitem').canvas.viewGrid,
-      creditGrid = form.getItem('credit_to_use').canvas.viewGrid;
+    glitemGrid = form.getItem('glitem').canvas.viewGrid,
+    creditGrid = form.getItem('credit_to_use').canvas.viewGrid;
 
   if (orderInvoiceGrid.isReady && glitemGrid.isReady && creditGrid.isReady) {
     OB.APRM.AddPayment.updateActualExpected(form);
   }
 };
 
-OB.APRM.AddPayment.orderInvoiceAmountOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.orderInvoiceAmountOnChange = function(
+  item,
+  view,
+  form,
+  grid
+) {
   OB.APRM.AddPayment.updateActualExpected(form);
   OB.APRM.AddPayment.updateInvOrderTotal(form, grid);
 };
 
-OB.APRM.AddPayment.orderInvoiceTotalAmountOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.orderInvoiceTotalAmountOnChange = function(
+  item,
+  view,
+  form,
+  grid
+) {
   OB.APRM.AddPayment.updateActualExpected(form);
   OB.APRM.AddPayment.updateTotal(form);
 };
 
-OB.APRM.AddPayment.glItemTotalAmountOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.glItemTotalAmountOnChange = function(
+  item,
+  view,
+  form,
+  grid
+) {
   OB.APRM.AddPayment.updateActualExpected(form);
   OB.APRM.AddPayment.updateTotal(form);
 };
 
-OB.APRM.AddPayment.distributeAmount = function (view, form, onActualPaymentChange) {
-  var amount = new BigDecimal(String(form.getItem('actual_payment').getValue() || 0)),
-      orderInvoice = form.getItem('order_invoice').canvas.viewGrid,
-      issotrx = form.getItem('issotrx').getValue(),
-      payment = form.getItem('fin_payment_id').getValue(),
-      negativeamt = BigDecimal.prototype.ZERO,
-      differenceamt = BigDecimal.prototype.ZERO,
-      creditamt = new BigDecimal(String(form.getItem('used_credit').getValue() || 0)),
-      glitemamt = new BigDecimal(String(form.getItem('amount_gl_items').getValue() || 0)),
-      orderInvoiceData = orderInvoice.data.localData,
-      total = orderInvoice.data.totalRows,
-      autoDistributeAmt = OB.PropertyStore.get("APRM_AutoDistributeAmt"),
-      writeoff, amt, outstandingAmount, i, showMessageProperty, showMessage, message;
+OB.APRM.AddPayment.distributeAmount = function(
+  view,
+  form,
+  onActualPaymentChange
+) {
+  var amount = new BigDecimal(
+      String(form.getItem('actual_payment').getValue() || 0)
+    ),
+    orderInvoice = form.getItem('order_invoice').canvas.viewGrid,
+    issotrx = form.getItem('issotrx').getValue(),
+    payment = form.getItem('fin_payment_id').getValue(),
+    negativeamt = BigDecimal.prototype.ZERO,
+    differenceamt = BigDecimal.prototype.ZERO,
+    creditamt = new BigDecimal(
+      String(form.getItem('used_credit').getValue() || 0)
+    ),
+    glitemamt = new BigDecimal(
+      String(form.getItem('amount_gl_items').getValue() || 0)
+    ),
+    orderInvoiceData = orderInvoice.data.localData,
+    total = orderInvoice.data.totalRows,
+    autoDistributeAmt = OB.PropertyStore.get('APRM_AutoDistributeAmt'),
+    writeoff,
+    amt,
+    outstandingAmount,
+    i,
+    showMessageProperty,
+    showMessage,
+    message;
 
   if (autoDistributeAmt !== 'N' && autoDistributeAmt !== '"N"') {
-    if (orderInvoice.data.cachedRows < (orderInvoice.data.totalRows)) {
+    if (orderInvoice.data.cachedRows < orderInvoice.data.totalRows) {
       showMessageProperty = OB.PropertyStore.get('APRM_ShowNoDistributeMsg');
-      showMessage = (showMessageProperty !== 'N' && showMessageProperty !== '"N"');
+      showMessage =
+        showMessageProperty !== 'N' && showMessageProperty !== '"N"';
       if (showMessage) {
-        orderInvoice.contentView.messageBar.setMessage(isc.OBMessageBar.TYPE_INFO, '<div><div class="' + OB.Styles.MessageBar.leftMsgContainerStyle + '">' + OB.I18N.getLabel('APRM_NoDistributeMsg') + '</div><div class="' + OB.Styles.MessageBar.rightMsgContainerStyle + '"><a href="#" class="' + OB.Styles.MessageBar.rightMsgTextStyle + '" onclick="' + 'window[\'' + orderInvoice.contentView.messageBar.ID + '\'].hide(); OB.PropertyStore.set(\'APRM_ShowNoDistributeMsg\', \'N\');">' + OB.I18N.getLabel('OBUIAPP_NeverShowMessageAgain') + '</a></div></div>', ' ');
+        orderInvoice.contentView.messageBar.setMessage(
+          isc.OBMessageBar.TYPE_INFO,
+          '<div><div class="' +
+            OB.Styles.MessageBar.leftMsgContainerStyle +
+            '">' +
+            OB.I18N.getLabel('APRM_NoDistributeMsg') +
+            '</div><div class="' +
+            OB.Styles.MessageBar.rightMsgContainerStyle +
+            '"><a href="#" class="' +
+            OB.Styles.MessageBar.rightMsgTextStyle +
+            '" onclick="' +
+            "window['" +
+            orderInvoice.contentView.messageBar.ID +
+            "'].hide(); OB.PropertyStore.set('APRM_ShowNoDistributeMsg', 'N');\">" +
+            OB.I18N.getLabel('OBUIAPP_NeverShowMessageAgain') +
+            '</a></div></div>',
+          ' '
+        );
       }
       OB.APRM.AddPayment.updateInvOrderTotal(form, orderInvoice);
       return;
@@ -410,20 +548,33 @@
     amount = amount.add(creditamt);
 
     for (i = 0; i < total; i++) {
-      if (isc.isA.Object(orderInvoiceData[i]) && !isc.isA.emptyObject(orderInvoiceData[i])) {
-        outstandingAmount = new BigDecimal(String(orderInvoiceData[i].outstandingAmount));
+      if (
+        isc.isA.Object(orderInvoiceData[i]) &&
+        !isc.isA.emptyObject(orderInvoiceData[i])
+      ) {
+        outstandingAmount = new BigDecimal(
+          String(orderInvoiceData[i].outstandingAmount)
+        );
         if (outstandingAmount.signum() < 0) {
-          negativeamt = negativeamt.add(new BigDecimal(Math.abs(outstandingAmount).toString()));
+          negativeamt = negativeamt.add(
+            new BigDecimal(Math.abs(outstandingAmount).toString())
+          );
         }
       }
     }
 
-    if (amount.compareTo(negativeamt.negate()) > 0 && (onActualPaymentChange || payment)) {
+    if (
+      amount.compareTo(negativeamt.negate()) > 0 &&
+      (onActualPaymentChange || payment)
+    ) {
       amount = amount.add(negativeamt);
     }
 
     for (i = 0; i < total; i++) {
-      if (!isc.isA.Object(orderInvoiceData[i]) || isc.isA.emptyObject(orderInvoiceData[i])) {
+      if (
+        !isc.isA.Object(orderInvoiceData[i]) ||
+        isc.isA.emptyObject(orderInvoiceData[i])
+      ) {
         continue;
       }
       writeoff = orderInvoice.getEditValues(i).writeoff;
@@ -436,43 +587,70 @@
         amount = amount.subtract(amt);
         continue;
       } else {
-        outstandingAmount = new BigDecimal(String(orderInvoice.getRecord(i).outstandingAmount));
-        if (payment && !onActualPaymentChange && orderInvoice.getRecord(i).obSelected) {
-          outstandingAmount = new BigDecimal(String(orderInvoice.getRecord(i).amount));
-        } else if ((outstandingAmount.signum() < 0) && (amount.signum() < 0)) {
+        outstandingAmount = new BigDecimal(
+          String(orderInvoice.getRecord(i).outstandingAmount)
+        );
+        if (
+          payment &&
+          !onActualPaymentChange &&
+          orderInvoice.getRecord(i).obSelected
+        ) {
+          outstandingAmount = new BigDecimal(
+            String(orderInvoice.getRecord(i).amount)
+          );
+        } else if (outstandingAmount.signum() < 0 && amount.signum() < 0) {
           if (Math.abs(outstandingAmount) > Math.abs(amount)) {
             differenceamt = outstandingAmount.subtract(amount);
             outstandingAmount = amount;
             amount = amount.subtract(differenceamt);
           }
-        } else if (outstandingAmount.signum() > -1 && amount.signum() > -1 && outstandingAmount.compareTo(amount) > 0) {
+        } else if (
+          outstandingAmount.signum() > -1 &&
+          amount.signum() > -1 &&
+          outstandingAmount.compareTo(amount) > 0
+        ) {
           outstandingAmount = amount;
         }
         // do not distribute again when the selectionChanged method is invoked
         orderInvoice.preventDistributingOnSelectionChanged = true;
         if (amount.signum() === 0) {
-          if (outstandingAmount.signum() < 0 && (onActualPaymentChange || payment)) {
-            orderInvoice.setEditValue((i), 'amount', Number(outstandingAmount.toString()));
+          if (
+            outstandingAmount.signum() < 0 &&
+            (onActualPaymentChange || payment)
+          ) {
+            orderInvoice.setEditValue(
+              i,
+              'amount',
+              Number(outstandingAmount.toString())
+            );
             orderInvoice.selectRecord(i);
           } else {
-            orderInvoice.setEditValue((i), 'amount', Number('0'));
+            orderInvoice.setEditValue(i, 'amount', Number('0'));
             orderInvoice.deselectRecord(i);
           }
         } else if (amount.signum() === 1) {
-          orderInvoice.setEditValue((i), 'amount', Number(outstandingAmount.toString()));
+          orderInvoice.setEditValue(
+            i,
+            'amount',
+            Number(outstandingAmount.toString())
+          );
           orderInvoice.selectRecord(i);
           if (outstandingAmount.signum() >= 0 || amount.signum() <= 0) {
             amount = amount.subtract(outstandingAmount);
           }
         } else {
           if (outstandingAmount.signum() < 0) {
-            orderInvoice.setEditValue((i), 'amount', Number(outstandingAmount.toString()));
+            orderInvoice.setEditValue(
+              i,
+              'amount',
+              Number(outstandingAmount.toString())
+            );
             orderInvoice.selectRecord(i);
             if (outstandingAmount.signum() <= 0 || amount.signum() <= 0) {
               amount = amount.subtract(outstandingAmount);
             }
           } else {
-            orderInvoice.setEditValue((i), 'amount', Number('0'));
+            orderInvoice.setEditValue(i, 'amount', Number('0'));
             orderInvoice.deselectRecord(i);
           }
         }
@@ -484,30 +662,43 @@
   OB.APRM.AddPayment.updateInvOrderTotal(form, orderInvoice);
 };
 
-OB.APRM.AddPayment.updateTotal = function (form) {
+OB.APRM.AddPayment.updateTotal = function(form) {
   var invOrdTotalItem = form.getItem('amount_inv_ords'),
-      glItemsTotalItem = form.getItem('amount_gl_items'),
-      totalItem = form.getItem('total'),
-      totalAmt;
+    glItemsTotalItem = form.getItem('amount_gl_items'),
+    totalItem = form.getItem('total'),
+    totalAmt;
 
   totalAmt = new BigDecimal(String(invOrdTotalItem.getValue() || 0));
-  totalAmt = totalAmt.add(new BigDecimal(String(glItemsTotalItem.getValue() || 0)));
+  totalAmt = totalAmt.add(
+    new BigDecimal(String(glItemsTotalItem.getValue() || 0))
+  );
 
   totalItem.setValue(Number(totalAmt.toString()));
   OB.APRM.AddPayment.updateDifference(form);
 };
 
-OB.APRM.AddPayment.updateDifference = function (form) {
+OB.APRM.AddPayment.updateDifference = function(form) {
   var total = new BigDecimal(String(form.getItem('total').getValue() || 0)),
-      actualPayment = new BigDecimal(String(form.getItem('actual_payment').getValue() || 0)),
-      expectedPayment = new BigDecimal(String(form.getItem('expected_payment').getValue() || 0)),
-      credit = new BigDecimal(String(form.getItem('used_credit').getValue() || 0)),
-      differenceItem = form.getItem('difference'),
-      expectedDifferenceItem = form.getItem('expectedDifference'),
-      totalGLItems = new BigDecimal(String(form.getItem('amount_gl_items').getValue() || 0)),
-      diffAmt = actualPayment.add(credit).subtract(total),
-      expectedDiffAmt = expectedPayment.add(credit).subtract(total).add(totalGLItems),
-      affectedParams = [];
+    actualPayment = new BigDecimal(
+      String(form.getItem('actual_payment').getValue() || 0)
+    ),
+    expectedPayment = new BigDecimal(
+      String(form.getItem('expected_payment').getValue() || 0)
+    ),
+    credit = new BigDecimal(
+      String(form.getItem('used_credit').getValue() || 0)
+    ),
+    differenceItem = form.getItem('difference'),
+    expectedDifferenceItem = form.getItem('expectedDifference'),
+    totalGLItems = new BigDecimal(
+      String(form.getItem('amount_gl_items').getValue() || 0)
+    ),
+    diffAmt = actualPayment.add(credit).subtract(total),
+    expectedDiffAmt = expectedPayment
+      .add(credit)
+      .subtract(total)
+      .add(totalGLItems),
+    affectedParams = [];
   differenceItem.setValue(Number(diffAmt.toString()));
   if (expectedDiffAmt.signum() === 0) {
     expectedDifferenceItem.setValue(Number(diffAmt.toString()));
@@ -517,19 +708,29 @@
   if (diffAmt.signum() !== 0) {
     OB.APRM.AddPayment.updateDifferenceActions(form);
   }
-  affectedParams.push(form.getField('overpayment_action_display_logic').paramId);
-  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, form.paramWindow, affectedParams);
+  affectedParams.push(
+    form.getField('overpayment_action_display_logic').paramId
+  );
+  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(
+    form,
+    form.paramWindow,
+    affectedParams
+  );
 };
 
-OB.APRM.AddPayment.updateDifferenceActions = function (form) {
+OB.APRM.AddPayment.updateDifferenceActions = function(form) {
   var issotrx = form.getItem('issotrx').getValue(),
-      overpaymentAction = form.getItem('overpayment_action'),
-      actualPayment = new BigDecimal(String(form.getItem('actual_payment').getValue() || 0)),
-      newValueMap = {},
-      defaultValue = '',
-      trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "";
-  if (trxtype !== "") {
-    form.isCreditAllowed = form.getItem('received_from').getValue() !== undefined && form.getItem('received_from').getValue() !== null;
+    overpaymentAction = form.getItem('overpayment_action'),
+    actualPayment = new BigDecimal(
+      String(form.getItem('actual_payment').getValue() || 0)
+    ),
+    newValueMap = {},
+    defaultValue = '',
+    trxtype = form.getItem('trxtype') ? form.getItem('trxtype').getValue() : '';
+  if (trxtype !== '') {
+    form.isCreditAllowed =
+      form.getItem('received_from').getValue() !== undefined &&
+      form.getItem('received_from').getValue() !== null;
   }
   // Update difference action available values.
   if (form.isCreditAllowed) {
@@ -545,15 +746,20 @@
   overpaymentAction.setValue(defaultValue);
 };
 
-OB.APRM.AddPayment.updateInvOrderTotal = function (form, grid) {
+OB.APRM.AddPayment.updateInvOrderTotal = function(form, grid) {
   var totalAmt = BigDecimal.prototype.ZERO,
-      amountField = grid.getFieldByColumnName('amount'),
-      selectedRecords = grid.selectedIds,
-      invOrdTotalItem = form.getItem('amount_inv_ords'),
-      amt, i, bdAmt;
+    amountField = grid.getFieldByColumnName('amount'),
+    selectedRecords = grid.selectedIds,
+    invOrdTotalItem = form.getItem('amount_inv_ords'),
+    amt,
+    i,
+    bdAmt;
 
   for (i = 0; i < selectedRecords.length; i++) {
-    amt = grid.getEditedCell(grid.getRecordIndex(grid.data.localData.find('id', grid.selectedIds[i])), amountField);
+    amt = grid.getEditedCell(
+      grid.getRecordIndex(grid.data.localData.find('id', grid.selectedIds[i])),
+      amountField
+    );
     bdAmt = new BigDecimal(String(amt));
     totalAmt = totalAmt.add(bdAmt);
   }
@@ -561,27 +767,41 @@
   OB.APRM.AddPayment.updateTotal(form);
 };
 
-OB.APRM.AddPayment.selectionChanged = function (record, state) {
+OB.APRM.AddPayment.selectionChanged = function(record, state) {
   var orderInvoice = this.view.theForm.getItem('order_invoice').canvas.viewGrid;
   if (!orderInvoice.preventDistributingOnSelectionChanged) {
-    this.fireOnPause('selectionChanged' + record.id, function () {
-      OB.APRM.AddPayment.doSelectionChanged(record, state, this.view);
-    }, 200);
+    this.fireOnPause(
+      'selectionChanged' + record.id,
+      function() {
+        OB.APRM.AddPayment.doSelectionChanged(record, state, this.view);
+      },
+      200
+    );
     this.Super('selectionChanged', arguments);
   }
 };
 
-OB.APRM.AddPayment.doSelectionChanged = function (record, state, view) {
+OB.APRM.AddPayment.doSelectionChanged = function(record, state, view) {
   var orderInvoice = view.theForm.getItem('order_invoice').canvas.viewGrid,
-      amount = new BigDecimal(String(view.theForm.getItem('actual_payment').getValue() || 0)),
-      distributedAmount = new BigDecimal(String(view.theForm.getItem('amount_inv_ords').getValue() || 0)),
-      issotrx = view.theForm.getItem('issotrx').getValue(),
-      outstandingAmount = new BigDecimal(String(record.outstandingAmount)),
-      selectedIds = orderInvoice.selectedIds,
-      glitem = new BigDecimal(String(view.theForm.getItem('amount_gl_items').getValue() || 0)),
-      credit = new BigDecimal(String(view.theForm.getItem('used_credit').getValue() || 0)),
-      bslamount = new BigDecimal(String(view.theForm.getItem('bslamount').getValue() || 0)),
-      i;
+    amount = new BigDecimal(
+      String(view.theForm.getItem('actual_payment').getValue() || 0)
+    ),
+    distributedAmount = new BigDecimal(
+      String(view.theForm.getItem('amount_inv_ords').getValue() || 0)
+    ),
+    issotrx = view.theForm.getItem('issotrx').getValue(),
+    outstandingAmount = new BigDecimal(String(record.outstandingAmount)),
+    selectedIds = orderInvoice.selectedIds,
+    glitem = new BigDecimal(
+      String(view.theForm.getItem('amount_gl_items').getValue() || 0)
+    ),
+    credit = new BigDecimal(
+      String(view.theForm.getItem('used_credit').getValue() || 0)
+    ),
+    bslamount = new BigDecimal(
+      String(view.theForm.getItem('bslamount').getValue() || 0)
+    ),
+    i;
 
   amount = amount.subtract(distributedAmount);
   // subtract glitem amount
@@ -601,10 +821,17 @@
         }
       }
       if (amount.signum() === 0) {
-        orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number('0'));
-
+        orderInvoice.setEditValue(
+          orderInvoice.getRecordIndex(record),
+          'amount',
+          Number('0')
+        );
       } else {
-        orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(outstandingAmount.toString()));
+        orderInvoice.setEditValue(
+          orderInvoice.getRecordIndex(record),
+          'amount',
+          Number(outstandingAmount.toString())
+        );
       }
     }
   } else {
@@ -612,19 +839,33 @@
       if (selectedIds[i] === record.id) {
         if (bslamount.compareTo(BigDecimal.prototype.ZERO) !== 0) {
           if (outstandingAmount.compareTo(amount) > 0) {
-            orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(amount.toString()));
+            orderInvoice.setEditValue(
+              orderInvoice.getRecordIndex(record),
+              'amount',
+              Number(amount.toString())
+            );
           } else {
-            orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(outstandingAmount.toString()));
+            orderInvoice.setEditValue(
+              orderInvoice.getRecordIndex(record),
+              'amount',
+              Number(outstandingAmount.toString())
+            );
           }
         } else {
-          orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(outstandingAmount.toString()));
+          orderInvoice.setEditValue(
+            orderInvoice.getRecordIndex(record),
+            'amount',
+            Number(outstandingAmount.toString())
+          );
         }
-
       }
     }
   }
-  if (!orderInvoice.obaprmAllRecordsSelectedByUser || (orderInvoice.obaprmAllRecordsSelectedByUser && (orderInvoice.getRecordIndex(record) === orderInvoice.getTotalRows() - 1))) {
-
+  if (
+    !orderInvoice.obaprmAllRecordsSelectedByUser ||
+    (orderInvoice.obaprmAllRecordsSelectedByUser &&
+      orderInvoice.getRecordIndex(record) === orderInvoice.getTotalRows() - 1)
+  ) {
     OB.APRM.AddPayment.updateInvOrderTotal(view.theForm, orderInvoice);
     OB.APRM.AddPayment.updateActualExpected(view.theForm);
     OB.APRM.AddPayment.updateDifference(view.theForm);
@@ -634,33 +875,69 @@
   }
 };
 
-OB.APRM.AddPayment.userSelectAllRecords = function () {
+OB.APRM.AddPayment.userSelectAllRecords = function() {
   this.obaprmAllRecordsSelectedByUser = true;
   this.Super('userSelectAllRecords', arguments);
 };
 
-OB.APRM.AddPayment.deselectAllRecords = function () {
+OB.APRM.AddPayment.deselectAllRecords = function() {
   this.obaprmAllRecordsSelectedByUser = true;
   this.Super('deselectAllRecords', arguments);
 };
 
-
-OB.APRM.AddPayment.updateActualExpected = function (form) {
+OB.APRM.AddPayment.updateActualExpected = function(form) {
   var orderInvoice = form.getItem('order_invoice').canvas.viewGrid,
-      issotrx = form.getItem('issotrx').getValue(),
-      totalAmountoutstanding = BigDecimal.prototype.ZERO,
-      totalAmount = BigDecimal.prototype.ZERO,
-      actualPayment = form.getItem('actual_payment'),
-      expectedPayment = form.getItem('expected_payment'),
-      generateCredit = new BigDecimal(String(form.getItem('generateCredit').getValue() || 0)),
-      glitemtotal = new BigDecimal(String(form.getItem('amount_gl_items').getValue() || 0)),
-      credit = new BigDecimal(String(form.getItem('used_credit').getValue() || 0)),
-      bslamount = new BigDecimal(String(form.getItem('bslamount').getValue() || 0)),
-      selectedRecords = orderInvoice.selectedIds,
-      actpayment, i;
+    issotrx = form.getItem('issotrx').getValue(),
+    totalAmountoutstanding = BigDecimal.prototype.ZERO,
+    totalAmount = BigDecimal.prototype.ZERO,
+    actualPayment = form.getItem('actual_payment'),
+    expectedPayment = form.getItem('expected_payment'),
+    generateCredit = new BigDecimal(
+      String(form.getItem('generateCredit').getValue() || 0)
+    ),
+    glitemtotal = new BigDecimal(
+      String(form.getItem('amount_gl_items').getValue() || 0)
+    ),
+    credit = new BigDecimal(
+      String(form.getItem('used_credit').getValue() || 0)
+    ),
+    bslamount = new BigDecimal(
+      String(form.getItem('bslamount').getValue() || 0)
+    ),
+    selectedRecords = orderInvoice.selectedIds,
+    actpayment,
+    i;
   for (i = 0; i < selectedRecords.length; i++) {
-    totalAmountoutstanding = totalAmountoutstanding.add(new BigDecimal(String(orderInvoice.getEditedCell(orderInvoice.getRecordIndex(orderInvoice.data.localData.find('id', orderInvoice.selectedIds[i])), orderInvoice.getFieldByColumnName('outstandingAmount')))));
-    totalAmount = totalAmount.add(new BigDecimal(String(orderInvoice.getEditedCell(orderInvoice.getRecordIndex(orderInvoice.data.localData.find('id', orderInvoice.selectedIds[i])), orderInvoice.getFieldByColumnName('amount')))));
+    totalAmountoutstanding = totalAmountoutstanding.add(
+      new BigDecimal(
+        String(
+          orderInvoice.getEditedCell(
+            orderInvoice.getRecordIndex(
+              orderInvoice.data.localData.find(
+                'id',
+                orderInvoice.selectedIds[i]
+              )
+            ),
+            orderInvoice.getFieldByColumnName('outstandingAmount')
+          )
+        )
+      )
+    );
+    totalAmount = totalAmount.add(
+      new BigDecimal(
+        String(
+          orderInvoice.getEditedCell(
+            orderInvoice.getRecordIndex(
+              orderInvoice.data.localData.find(
+                'id',
+                orderInvoice.selectedIds[i]
+              )
+            ),
+            orderInvoice.getFieldByColumnName('amount')
+          )
+        )
+      )
+    );
   }
   if (selectedRecords.length > 0) {
     expectedPayment.setValue(Number(totalAmountoutstanding));
@@ -694,31 +971,38 @@
   form.redraw();
 };
 
-OB.APRM.AddPayment.removeRecordClick = function (rowNum, record) {
+OB.APRM.AddPayment.removeRecordClick = function(rowNum, record) {
   this.Super('removeRecordClick', rowNum, record);
 
   OB.APRM.AddPayment.updateGLItemsTotal(this.view.theForm, rowNum, true);
 };
 
-OB.APRM.AddPayment.updateGLItemsTotal = function (form, rowNum, remove) {
+OB.APRM.AddPayment.updateGLItemsTotal = function(form, rowNum, remove) {
   var totalAmt = BigDecimal.prototype.ZERO,
-      grid = form.getItem('glitem').canvas.viewGrid,
-      receivedInField = grid.getFieldByColumnName('received_in'),
-      paidOutField = grid.getFieldByColumnName('paid_out'),
-      glItemTotalItem = form.getItem('amount_gl_items'),
-      issotrx = form.getItem('issotrx').getValue(),
-      affectedParams = [],
-      i, receivedInAmt, paidOutAmt, allRecords;
+    grid = form.getItem('glitem').canvas.viewGrid,
+    receivedInField = grid.getFieldByColumnName('received_in'),
+    paidOutField = grid.getFieldByColumnName('paid_out'),
+    glItemTotalItem = form.getItem('amount_gl_items'),
+    issotrx = form.getItem('issotrx').getValue(),
+    affectedParams = [],
+    i,
+    receivedInAmt,
+    paidOutAmt,
+    allRecords;
 
   grid.saveAllEdits();
   // allRecords should be initialized after grid.saveAllEdits()
-  allRecords = (grid.data.allRows) ? grid.data.allRows.length : 0;
+  allRecords = grid.data.allRows ? grid.data.allRows.length : 0;
   for (i = 0; i < allRecords; i++) {
     if (remove && i === rowNum) {
       continue;
     }
-    receivedInAmt = new BigDecimal(String(grid.getEditedCell(i, receivedInField) || 0));
-    paidOutAmt = new BigDecimal(String(grid.getEditedCell(i, paidOutField) || 0));
+    receivedInAmt = new BigDecimal(
+      String(grid.getEditedCell(i, receivedInField) || 0)
+    );
+    paidOutAmt = new BigDecimal(
+      String(grid.getEditedCell(i, paidOutField) || 0)
+    );
 
     if (issotrx) {
       totalAmt = totalAmt.add(receivedInAmt);
@@ -734,16 +1018,26 @@
 
   glItemTotalItem.setValue(Number(totalAmt.toString()));
   OB.APRM.AddPayment.updateTotal(form);
-  affectedParams.push(form.getField('overpayment_action_display_logic').paramId);
-  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, grid.view, affectedParams);
+  affectedParams.push(
+    form.getField('overpayment_action_display_logic').paramId
+  );
+  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(
+    form,
+    grid.view,
+    affectedParams
+  );
   return true;
 };
 
-OB.APRM.AddPayment.glItemAmountOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.glItemAmountOnChange = function(item, view, form, grid) {
   var receivedInField = grid.getFieldByColumnName('received_in'),
-      paidOutField = grid.getFieldByColumnName('paid_out'),
-      receivedInAmt = new BigDecimal(String(grid.getEditedCell(item.rowNum, receivedInField) || 0)),
-      paidOutAmt = new BigDecimal(String(grid.getEditedCell(item.rowNum, paidOutField) || 0));
+    paidOutField = grid.getFieldByColumnName('paid_out'),
+    receivedInAmt = new BigDecimal(
+      String(grid.getEditedCell(item.rowNum, receivedInField) || 0)
+    ),
+    paidOutAmt = new BigDecimal(
+      String(grid.getEditedCell(item.rowNum, paidOutField) || 0)
+    );
 
   if (item.columnName === 'received_in' && receivedInAmt.signum() !== 0) {
     grid.setEditValue(item.rowNum, 'paidOut', Number('0'));
@@ -757,16 +1051,21 @@
   return true;
 };
 
-OB.APRM.AddPayment.updateCreditTotal = function (form) {
+OB.APRM.AddPayment.updateCreditTotal = function(form) {
   var totalAmt = BigDecimal.prototype.ZERO,
-      grid = form.getItem('credit_to_use').canvas.viewGrid,
-      amountField = grid.getFieldByColumnName('paymentAmount'),
-      selectedRecords = grid.getSelectedRecords(),
-      creditTotalItem = form.getItem('used_credit'),
-      i, creditAmt;
+    grid = form.getItem('credit_to_use').canvas.viewGrid,
+    amountField = grid.getFieldByColumnName('paymentAmount'),
+    selectedRecords = grid.getSelectedRecords(),
+    creditTotalItem = form.getItem('used_credit'),
+    i,
+    creditAmt;
 
   for (i = 0; i < selectedRecords.length; i++) {
-    creditAmt = new BigDecimal(String(grid.getEditedCell(grid.getRecordIndex(selectedRecords[i]), amountField)));
+    creditAmt = new BigDecimal(
+      String(
+        grid.getEditedCell(grid.getRecordIndex(selectedRecords[i]), amountField)
+      )
+    );
     totalAmt = totalAmt.add(creditAmt);
   }
   creditTotalItem.setValue(Number(totalAmt.toString()));
@@ -774,7 +1073,7 @@
   return true;
 };
 
-OB.APRM.AddPayment.updateCreditOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.updateCreditOnChange = function(item, view, form, grid) {
   var issotrx = form.getItem('issotrx').getValue();
 
   OB.APRM.AddPayment.updateCreditTotal(form);
@@ -786,71 +1085,119 @@
   return true;
 };
 
-OB.APRM.AddPayment.selectionChangedCredit = function (record, state) {
+OB.APRM.AddPayment.selectionChangedCredit = function(record, state) {
   var creditgrid = this.view.theForm.getItem('credit_to_use').canvas.viewGrid;
 
   if (!creditgrid.preventDistributingOnSelectionChanged) {
-    this.fireOnPause('selectionChangedCredit' + record.id, function () {
-      OB.APRM.AddPayment.doSelectionChangedCredit(record, state, this.view);
-    }, 200);
+    this.fireOnPause(
+      'selectionChangedCredit' + record.id,
+      function() {
+        OB.APRM.AddPayment.doSelectionChangedCredit(record, state, this.view);
+      },
+      200
+    );
     this.Super('selectionChanged', arguments);
   }
 };
 
-OB.APRM.AddPayment.orderInvoiceGridValidation = function (item, validator, value, record) {
+OB.APRM.AddPayment.orderInvoiceGridValidation = function(
+  item,
+  validator,
+  value,
+  record
+) {
   var outstanding = new BigDecimal(String(record.outstandingAmount)),
-      paidamount = new BigDecimal(String(record.amount));
+    paidamount = new BigDecimal(String(record.amount));
 
   if (!isc.isA.Number(record.amount)) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_NotValidNumber'));
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_NotValidNumber')
+    );
     return false;
   }
   if (outstanding.abs().compareTo(paidamount.abs()) < 0) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_MoreAmountThanOutstanding'));
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_MoreAmountThanOutstanding')
+    );
     return false;
   }
-  if ((paidamount.signum() === 0) && (record.writeoff === false)) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_JSZEROUNDERPAYMENT'));
+  if (paidamount.signum() === 0 && record.writeoff === false) {
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_JSZEROUNDERPAYMENT')
+    );
     return false;
   }
-  if ((paidamount.signum() < 0 && outstanding.signum() > 0) || (paidamount.signum() > 0 && outstanding.signum() < 0)) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_ValueOutOfRange'));
+  if (
+    (paidamount.signum() < 0 && outstanding.signum() > 0) ||
+    (paidamount.signum() > 0 && outstanding.signum() < 0)
+  ) {
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_ValueOutOfRange')
+    );
     return false;
   }
   return true;
 };
 
-OB.APRM.AddPayment.creditValidation = function (item, validator, value, record) {
+OB.APRM.AddPayment.creditValidation = function(item, validator, value, record) {
   var outstanding = new BigDecimal(String(record.outstandingAmount)),
-      paidamount = new BigDecimal(String(record.paymentAmount));
+    paidamount = new BigDecimal(String(record.paymentAmount));
 
   if (!isc.isA.Number(record.paymentAmount)) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_NotValidNumber'));
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_NotValidNumber')
+    );
     return false;
   }
   if (outstanding.abs().compareTo(paidamount.abs()) < 0) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_MoreAmountThanOutstanding'));
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_MoreAmountThanOutstanding')
+    );
     return false;
   }
   if (paidamount.signum() === 0) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('aprm_biggerthanzero'));
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('aprm_biggerthanzero')
+    );
     return false;
   }
   return true;
 };
 
-OB.APRM.AddPayment.doSelectionChangedCredit = function (record, state, view) {
+OB.APRM.AddPayment.doSelectionChangedCredit = function(record, state, view) {
   var issotrx = view.theForm.getItem('issotrx'),
-      grid = view.theForm.getItem('credit_to_use').canvas.viewGrid,
-      amountField = grid.getFieldByColumnName('paymentAmount'),
-      outstanding = new BigDecimal(String(record.outstandingAmount));
+    grid = view.theForm.getItem('credit_to_use').canvas.viewGrid,
+    amountField = grid.getFieldByColumnName('paymentAmount'),
+    outstanding = new BigDecimal(String(record.outstandingAmount));
 
   if (state) {
-    grid.setEditValue(grid.getRecordIndex(record), amountField, Number(outstanding));
+    grid.setEditValue(
+      grid.getRecordIndex(record),
+      amountField,
+      Number(outstanding)
+    );
   } else {
     grid.setEditValue(grid.getRecordIndex(record), amountField, '0');
   }
-  if (!grid.obaprmAllRecordsSelectedByUser || (grid.obaprmAllRecordsSelectedByUser && (grid.getRecordIndex(record) === grid.getTotalRows() - 1))) {
+  if (
+    !grid.obaprmAllRecordsSelectedByUser ||
+    (grid.obaprmAllRecordsSelectedByUser &&
+      grid.getRecordIndex(record) === grid.getTotalRows() - 1)
+  ) {
     OB.APRM.AddPayment.updateCreditTotal(view.theForm);
     OB.APRM.AddPayment.updateActualExpected(view.theForm);
     if (issotrx) {
@@ -859,23 +1206,29 @@
   }
 };
 
-OB.APRM.AddPayment.conversionRateOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.conversionRateOnChange = function(item, view, form, grid) {
   OB.APRM.AddPayment.updateConvertedAmount(view, form, false);
 };
 
-OB.APRM.AddPayment.convertedAmountOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.convertedAmountOnChange = function(item, view, form, grid) {
   OB.APRM.AddPayment.updateConvertedAmount(view, form, true);
 };
 
-OB.APRM.AddPayment.updateConvertedAmount = function (view, form, recalcExchangeRate) {
+OB.APRM.AddPayment.updateConvertedAmount = function(
+  view,
+  form,
+  recalcExchangeRate
+) {
   var exchangeRate = form.getItem('conversion_rate').getValue(),
-      actualConverted = form.getItem('converted_amount').getValue(),
-      actualPayment = new BigDecimal(String(form.getItem('actual_payment').getValue() || 0)),
-      actualConvertedItem = form.getItem('converted_amount'),
-      exchangeRateItem = form.getItem('conversion_rate'),
-      newConvertedAmount = BigDecimal.prototype.ZERO,
-      newExchangeRate = BigDecimal.prototype.ONE,
-      currencyPrecision = form.getItem('StdPrecision').getValue();
+    actualConverted = form.getItem('converted_amount').getValue(),
+    actualPayment = new BigDecimal(
+      String(form.getItem('actual_payment').getValue() || 0)
+    ),
+    actualConvertedItem = form.getItem('converted_amount'),
+    exchangeRateItem = form.getItem('conversion_rate'),
+    newConvertedAmount = BigDecimal.prototype.ZERO,
+    newExchangeRate = BigDecimal.prototype.ONE,
+    currencyPrecision = form.getItem('StdPrecision').getValue();
 
   if (!actualConverted && !exchangeRate) {
     return;
@@ -896,7 +1249,9 @@
       exchangeRateItem.setValue(Number(newExchangeRate.toString()));
     }
   } else if (exchangeRate) {
-    newConvertedAmount = actualPayment.multiply(exchangeRate).setScale(currencyPrecision, BigDecimal.prototype.ROUND_HALF_UP);
+    newConvertedAmount = actualPayment
+      .multiply(exchangeRate)
+      .setScale(currencyPrecision, BigDecimal.prototype.ROUND_HALF_UP);
     exchangeRateItem.setValue(Number(exchangeRate.toString()));
     actualConvertedItem.setValue(Number(newConvertedAmount.toString()));
   } else {
@@ -907,11 +1262,14 @@
 /*
  * Retrieves a string of comma separated values and returns it ordered and with the duplicates removed.
  */
-OB.APRM.AddPayment.orderAndRemoveDuplicates = function (val) {
-  var valArray = val.replaceAll(' ', '').split(',').sort(),
-      retVal;
+OB.APRM.AddPayment.orderAndRemoveDuplicates = function(val) {
+  var valArray = val
+      .replaceAll(' ', '')
+      .split(',')
+      .sort(),
+    retVal;
 
-  valArray = valArray.filter(function (elem, pos, self) {
+  valArray = valArray.filter(function(elem, pos, self) {
     return self.indexOf(elem) === pos;
   });
 
@@ -919,13 +1277,16 @@
   return retVal;
 };
 
-OB.APRM.AddPayment.documentOnChange = function (item, view, form, grid) {
-  var document = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "",
-      issotrx = form.getItem('issotrx'),
-      affectedParams = [],
-      ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
-      organization = form.getItem('ad_org_id'),
-      newCriteria, callback;
+OB.APRM.AddPayment.documentOnChange = function(item, view, form, grid) {
+  var document = form.getItem('trxtype')
+      ? form.getItem('trxtype').getValue()
+      : '',
+    issotrx = form.getItem('issotrx'),
+    affectedParams = [],
+    ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
+    organization = form.getItem('ad_org_id'),
+    newCriteria,
+    callback;
   if (document === 'RCIN') {
     issotrx.setValue(true);
   } else {
@@ -940,12 +1301,19 @@
   OB.APRM.AddPayment.reloadLabels(form);
   affectedParams.push(form.getField('credit_to_use_display_logic').paramId);
   affectedParams.push(form.getField('actual_payment_readonly_logic').paramId);
-  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, view, affectedParams);
+  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(
+    form,
+    view,
+    affectedParams
+  );
 
-  if (document !== "") {
+  if (document !== '') {
     // fetch data after change trx type, filters should be preserved and ids of
     // the selected records should be sent
-    newCriteria = ordinvgrid.addSelectedIDsToCriteria(ordinvgrid.getCriteria(), true);
+    newCriteria = ordinvgrid.addSelectedIDsToCriteria(
+      ordinvgrid.getCriteria(),
+      true
+    );
     newCriteria.criteria = newCriteria.criteria || [];
     // add dummy criterion to force fetch
     newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
@@ -953,31 +1321,43 @@
     form.redraw();
   }
 
-  callback = function (response, data, request) {
+  callback = function(response, data, request) {
     form.getItem('payment_documentno').setValue(data.payment_documentno);
   };
 
-  if (document !== "") {
-    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddPaymentDocumentNoActionHandler', {
-      organization: organization.getValue(),
-      issotrx: issotrx.getValue()
-    }, {}, callback);
+  if (document !== '') {
+    OB.RemoteCallManager.call(
+      'org.openbravo.advpaymentmngt.actionHandler.AddPaymentDocumentNoActionHandler',
+      {
+        organization: organization.getValue(),
+        issotrx: issotrx.getValue()
+      },
+      {},
+      callback
+    );
   }
 };
 
-OB.APRM.AddPayment.organizationOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.organizationOnChange = function(item, view, form, grid) {
   var ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
-      organization = (form.getItem('ad_org_id')) ? form.getItem('ad_org_id').getValue() : "",
-      newCriteria, callback;
+    organization = form.getItem('ad_org_id')
+      ? form.getItem('ad_org_id').getValue()
+      : '',
+    newCriteria,
+    callback;
   form.getItem('fin_paymentmethod_id').setValue(null);
   form.getItem('received_from').setValue(null);
   form.getItem('fin_financial_account_id').setValue(null);
-  callback = function (response, data, request) {
+  callback = function(response, data, request) {
     form.getItem('c_currency_id').setValue(data.currency);
-    form.getItem('c_currency_id').valueMap[data.currency] = data.currencyIdIdentifier;
+    form.getItem('c_currency_id').valueMap[data.currency] =
+      data.currencyIdIdentifier;
     // fetch data after change organization, filters should be preserved and ids of
     // the selected records should be sent
-    newCriteria = ordinvgrid.addSelectedIDsToCriteria(ordinvgrid.getCriteria(), true);
+    newCriteria = ordinvgrid.addSelectedIDsToCriteria(
+      ordinvgrid.getCriteria(),
+      true
+    );
     newCriteria.criteria = newCriteria.criteria || [];
     // add dummy criterion to force fetch
     newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
@@ -985,41 +1365,64 @@
     form.redraw();
   };
 
-  if (organization !== "") {
-    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddPaymentOrganizationActionHandler', {
-      organization: organization
-    }, {}, callback);
+  if (organization !== '') {
+    OB.RemoteCallManager.call(
+      'org.openbravo.advpaymentmngt.actionHandler.AddPaymentOrganizationActionHandler',
+      {
+        organization: organization
+      },
+      {},
+      callback
+    );
   }
 };
 
-OB.APRM.AddPayment.receivedFromOnChange = function (item, view, form, grid) {
+OB.APRM.AddPayment.receivedFromOnChange = function(item, view, form, grid) {
   var affectedParams = [],
-      trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "",
-      callback, receivedFrom = form.getItem('received_from').getValue(),
-      isSOTrx = form.getItem('issotrx').getValue(),
-      financialAccount = form.getItem('fin_financial_account_id').getValue(),
-      ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
-      paymentMethodItem = form.getItem('fin_paymentmethod_id'),
-      newCriteria = {};
+    trxtype = form.getItem('trxtype') ? form.getItem('trxtype').getValue() : '',
+    callback,
+    receivedFrom = form.getItem('received_from').getValue(),
+    isSOTrx = form.getItem('issotrx').getValue(),
+    financialAccount = form.getItem('fin_financial_account_id').getValue(),
+    ordinvgrid = form.getItem('order_invoice').canvas.viewGrid,
+    paymentMethodItem = form.getItem('fin_paymentmethod_id'),
+    newCriteria = {};
   affectedParams.push(form.getField('credit_to_use_display_logic').paramId);
-  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, view, affectedParams);
+  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(
+    form,
+    view,
+    affectedParams
+  );
 
-  callback = function (response, data, request) {
+  callback = function(response, data, request) {
     if (data.paymentMethodId !== '') {
       paymentMethodItem.setValue(data.paymentMethodId);
       paymentMethodItem.valueMap[data.paymentMethodId] = data.paymentMethodName;
       form.redraw();
-      OB.APRM.AddPayment.paymentMethodOnChange(paymentMethodItem, view, form, grid);
+      OB.APRM.AddPayment.paymentMethodOnChange(
+        paymentMethodItem,
+        view,
+        form,
+        grid
+      );
     }
   };
 
-  if (trxtype !== "") {
-    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.ReceivedFromPaymentMethodActionHandler', {
-      receivedFrom: receivedFrom,
-      isSOTrx: isSOTrx,
-      financialAccount: financialAccount
-    }, {}, callback);
-    newCriteria = ordinvgrid.addSelectedIDsToCriteria(ordinvgrid.getCriteria(), true);
+  if (trxtype !== '') {
+    OB.RemoteCallManager.call(
+      'org.openbravo.advpaymentmngt.actionHandler.ReceivedFromPaymentMethodActionHandler',
+      {
+        receivedFrom: receivedFrom,
+        isSOTrx: isSOTrx,
+        financialAccount: financialAccount
+      },
+      {},
+      callback
+    );
+    newCriteria = ordinvgrid.addSelectedIDsToCriteria(
+      ordinvgrid.getCriteria(),
+      true
+    );
     newCriteria.criteria = newCriteria.criteria || [];
     // add dummy criterion to force fetch
     newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
@@ -1029,15 +1432,22 @@
   }
 };
 
-OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic = function (form, view, affectedParams) {
-  var callbackDisplayLogicActionHandler, params = {},
-      thisform, thisview, creditUseGrid = form.getItem('credit_to_use').canvas.viewGrid;
+OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic = function(
+  form,
+  view,
+  affectedParams
+) {
+  var callbackDisplayLogicActionHandler,
+    params = {},
+    thisform,
+    thisview,
+    creditUseGrid = form.getItem('credit_to_use').canvas.viewGrid;
   thisform = form;
   thisview = view;
   params.context = form.paramWindow.getContextInfo();
-  // Before sending the context, the grids with the information about orders and invoices, 
-  // gl items and credit used are removed from it. 
-  // This data is not used for calculating the display or read only logic of the rest of the parameters 
+  // Before sending the context, the grids with the information about orders and invoices,
+  // gl items and credit used are removed from it.
+  // This data is not used for calculating the display or read only logic of the rest of the parameters
   // and sending the grid can have an impact in the performance of this process.
   delete params.context.order_invoice;
   delete params.context.credit_to_use;
@@ -1046,9 +1456,12 @@
     params.context.inpwindowId = form.paramWindow.parentWindow.windowId;
   }
 
-  callbackDisplayLogicActionHandler = function (response, data, request) {
-    var i, field, def, values = data.values,
-        newCriteria = {};
+  callbackDisplayLogicActionHandler = function(response, data, request) {
+    var i,
+      field,
+      def,
+      values = data.values,
+      newCriteria = {};
 
     for (i in values) {
       if (values.hasOwnProperty(i)) {
@@ -1062,7 +1475,9 @@
               field.setValue(def.value);
             }
           } else {
-            field.setValue(thisform.paramWindow.getTypeSafeValue(field.typeInstance, def));
+            field.setValue(
+              thisform.paramWindow.getTypeSafeValue(field.typeInstance, def)
+            );
           }
         }
       }
@@ -1071,7 +1486,10 @@
       thisview.handleReadOnlyLogic();
     }
     // If credit grid is now displayed fetch data
-    if (values.credit_to_use_display_logic && values.credit_to_use_display_logic === 'Y') {
+    if (
+      values.credit_to_use_display_logic &&
+      values.credit_to_use_display_logic === 'Y'
+    ) {
       newCriteria.criteria = [];
       // add dummy criterion to force fetch
       newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
@@ -1083,52 +1501,92 @@
     }
   };
 
-  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddPaymentDisplayLogicActionHandler', {
-    affectedParams: affectedParams,
-    params: params
-  }, {}, callbackDisplayLogicActionHandler);
+  OB.RemoteCallManager.call(
+    'org.openbravo.advpaymentmngt.actionHandler.AddPaymentDisplayLogicActionHandler',
+    {
+      affectedParams: affectedParams,
+      params: params
+    },
+    {},
+    callbackDisplayLogicActionHandler
+  );
 };
 
-OB.APRM.AddPayment.reloadLabels = function (form) {
-  var callbackReloadLabelsActionHandler, params = {};
+OB.APRM.AddPayment.reloadLabels = function(form) {
+  var callbackReloadLabelsActionHandler,
+    params = {};
   params.businessPartner = form.getItem('received_from').paramId;
   params.financialAccount = form.getItem('fin_financial_account_id').paramId;
   params.issotrx = form.getItem('issotrx').getValue();
 
-  callbackReloadLabelsActionHandler = function (response, data, request) {
+  callbackReloadLabelsActionHandler = function(response, data, request) {
     form.getItem('received_from').title = data.values.businessPartner;
-    form.getItem('fin_financial_account_id').title = data.values.financialAccount;
+    form.getItem('fin_financial_account_id').title =
+      data.values.financialAccount;
     form.markForRedraw();
   };
 
-  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddPaymentReloadLabelsActionHandler', {}, params, callbackReloadLabelsActionHandler);
+  OB.RemoteCallManager.call(
+    'org.openbravo.advpaymentmngt.actionHandler.AddPaymentReloadLabelsActionHandler',
+    {},
+    params,
+    callbackReloadLabelsActionHandler
+  );
 };
 
-OB.APRM.AddPayment.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
+OB.APRM.AddPayment.onProcess = function(
+  view,
+  actionHandlerCall,
+  clientSideValidationFail
+) {
   var orderInvoiceGrid = view.theForm.getItem('order_invoice').canvas.viewGrid,
-      receivedFrom = view.theForm.getItem('received_from').getValue(),
-      currencyId = view.theForm.getItem('c_currency_id').getValue(),
-      issotrx = view.theForm.getItem('issotrx').getValue(),
-      finFinancialAccount = view.theForm.getItem('fin_financial_account_id').getValue(),
-      amountInvOrds = new BigDecimal(String(view.theForm.getItem('amount_inv_ords').getValue() || 0)),
-      total = new BigDecimal(String(view.theForm.getItem('total').getValue() || 0)),
-      actualPayment = new BigDecimal(String(view.theForm.getItem('actual_payment').getValue() || 0)),
-      overpaymentField = view.theForm.getItem('overpayment_action'),
-      overpaymentAction = overpaymentField.getValue(),
-      creditTotalItem = new BigDecimal(String(view.theForm.getItem('used_credit').getValue() || 0)),
-      document = (view.theForm.getItem('trxtype')) ? view.theForm.getItem('trxtype').getValue() : "",
-      selectedRecords = orderInvoiceGrid.getSelectedRecords(),
-      writeOffLimitPreference = OB.PropertyStore.get('WriteOffLimitPreference', view.windowId),
-      totalWriteOffAmount = BigDecimal.prototype.ZERO,
-      writeOffLineAmount = BigDecimal.prototype.ZERO,
-      totalOustandingAmount = BigDecimal.prototype.ZERO,
-      glitemGrid = view.theForm.getItem('glitem').canvas.viewGrid,
-      outstandingAmount, i, callbackOnProcessActionHandler, writeoff, allRecords, receivedInAmt, paidOutAmt, receivedInField, paidOutField;
-
+    receivedFrom = view.theForm.getItem('received_from').getValue(),
+    currencyId = view.theForm.getItem('c_currency_id').getValue(),
+    issotrx = view.theForm.getItem('issotrx').getValue(),
+    finFinancialAccount = view.theForm
+      .getItem('fin_financial_account_id')
+      .getValue(),
+    amountInvOrds = new BigDecimal(
+      String(view.theForm.getItem('amount_inv_ords').getValue() || 0)
+    ),
+    total = new BigDecimal(
+      String(view.theForm.getItem('total').getValue() || 0)
+    ),
+    actualPayment = new BigDecimal(
+      String(view.theForm.getItem('actual_payment').getValue() || 0)
+    ),
+    overpaymentField = view.theForm.getItem('overpayment_action'),
+    overpaymentAction = overpaymentField.getValue(),
+    creditTotalItem = new BigDecimal(
+      String(view.theForm.getItem('used_credit').getValue() || 0)
+    ),
+    document = view.theForm.getItem('trxtype')
+      ? view.theForm.getItem('trxtype').getValue()
+      : '',
+    selectedRecords = orderInvoiceGrid.getSelectedRecords(),
+    writeOffLimitPreference = OB.PropertyStore.get(
+      'WriteOffLimitPreference',
+      view.windowId
+    ),
+    totalWriteOffAmount = BigDecimal.prototype.ZERO,
+    writeOffLineAmount = BigDecimal.prototype.ZERO,
+    totalOustandingAmount = BigDecimal.prototype.ZERO,
+    glitemGrid = view.theForm.getItem('glitem').canvas.viewGrid,
+    outstandingAmount,
+    i,
+    callbackOnProcessActionHandler,
+    writeoff,
+    allRecords,
+    receivedInAmt,
+    paidOutAmt,
+    receivedInField,
+    paidOutField;
 
   // Check if there is pending amount to distribute that could be distributed
   for (i = 0; i < selectedRecords.length; i++) {
-    outstandingAmount = new BigDecimal(String(selectedRecords[i].outstandingAmount));
+    outstandingAmount = new BigDecimal(
+      String(selectedRecords[i].outstandingAmount)
+    );
     totalOustandingAmount = totalOustandingAmount.add(outstandingAmount);
   }
   for (i = 0; i < orderInvoiceGrid.data.totalRows; i++) {
@@ -1137,77 +1595,143 @@
       writeoff = orderInvoiceGrid.getRecord(i).writeoff;
     }
     if (writeoff) {
-      writeOffLineAmount = new BigDecimal(String(orderInvoiceGrid.getRecord(i).outstandingAmount || 0)).subtract(new BigDecimal(String(orderInvoiceGrid.getEditedRecord(i).amount || 0)));
+      writeOffLineAmount = new BigDecimal(
+        String(orderInvoiceGrid.getRecord(i).outstandingAmount || 0)
+      ).subtract(
+        new BigDecimal(String(orderInvoiceGrid.getEditedRecord(i).amount || 0))
+      );
       totalWriteOffAmount = totalWriteOffAmount.add(writeOffLineAmount);
     }
   }
 
   // If there is Overpayment check it exists a business partner
   if (overpaymentAction && receivedFrom === null) {
-    view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_CreditWithoutBPartner'));
+    view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_CreditWithoutBPartner')
+    );
     return clientSideValidationFail();
   }
   //If Actual Payment amount is negative, it is not necessary to use credit.
-  if ((total.compareTo(BigDecimal.prototype.ZERO) < 0) && (creditTotalItem.signum() !== 0)) {
-    view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_CreditWithNegativeAmt'));
+  if (
+    total.compareTo(BigDecimal.prototype.ZERO) < 0 &&
+    creditTotalItem.signum() !== 0
+  ) {
+    view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_CreditWithNegativeAmt')
+    );
     return clientSideValidationFail();
   }
-  if (actualPayment.compareTo(total.subtract(creditTotalItem)) > 0 && totalOustandingAmount.compareTo(amountInvOrds.add(totalWriteOffAmount)) > 0) {
+  if (
+    actualPayment.compareTo(total.subtract(creditTotalItem)) > 0 &&
+    totalOustandingAmount.compareTo(amountInvOrds.add(totalWriteOffAmount)) > 0
+  ) {
     // Not all the payment amount has been allocated
-    view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_JSNOTALLAMOUTALLOCATED'));
+    view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_JSNOTALLAMOUTALLOCATED')
+    );
     return clientSideValidationFail();
   } else if (total.compareTo(actualPayment.add(creditTotalItem)) > 0) {
     // More than available amount has been distributed
-    view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_JSMOREAMOUTALLOCATED'));
+    view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_JSMOREAMOUTALLOCATED')
+    );
     return clientSideValidationFail();
   }
 
-  if (creditTotalItem.compareTo(BigDecimal.prototype.ZERO) !== 0 && (total.compareTo(creditTotalItem) < 0) && (overpaymentField.isVisible() && overpaymentAction === 'CR')) {
-    view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_MORECREDITAMOUNT'));
+  if (
+    creditTotalItem.compareTo(BigDecimal.prototype.ZERO) !== 0 &&
+    total.compareTo(creditTotalItem) < 0 &&
+    (overpaymentField.isVisible() && overpaymentAction === 'CR')
+  ) {
+    view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_MORECREDITAMOUNT')
+    );
     return clientSideValidationFail();
   }
 
-  if (document !== null && document !== '' && actualPayment.compareTo(BigDecimal.prototype.ZERO) === 0 && view.parentWindow && view.parentWindow.windowId && !overpaymentAction) {
-    view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_ZEROAMOUNTPAYMENTTRANSACTION'));
+  if (
+    document !== null &&
+    document !== '' &&
+    actualPayment.compareTo(BigDecimal.prototype.ZERO) === 0 &&
+    view.parentWindow &&
+    view.parentWindow.windowId &&
+    !overpaymentAction
+  ) {
+    view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_ZEROAMOUNTPAYMENTTRANSACTION')
+    );
     return clientSideValidationFail();
   }
 
   //It is not possible to add a glitem with both amounts equal to 0
-  allRecords = (glitemGrid.data.allRows) ? glitemGrid.data.allRows.length : 0;
+  allRecords = glitemGrid.data.allRows ? glitemGrid.data.allRows.length : 0;
   for (i = 0; i < allRecords; i++) {
     receivedInField = glitemGrid.getFieldByColumnName('received_in');
     paidOutField = glitemGrid.getFieldByColumnName('paid_out');
-    receivedInAmt = new BigDecimal(String(glitemGrid.getEditedCell(i, receivedInField) || 0));
-    paidOutAmt = new BigDecimal(String(glitemGrid.getEditedCell(i, paidOutField) || 0));
+    receivedInAmt = new BigDecimal(
+      String(glitemGrid.getEditedCell(i, receivedInField) || 0)
+    );
+    paidOutAmt = new BigDecimal(
+      String(glitemGrid.getEditedCell(i, paidOutField) || 0)
+    );
     if (receivedInAmt.signum() === 0 && paidOutAmt.signum() === 0) {
-      view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_GLITEMSDIFFERENTZERO'));
+      view.messageBar.setMessage(
+        isc.OBMessageBar.TYPE_ERROR,
+        null,
+        OB.I18N.getLabel('APRM_GLITEMSDIFFERENTZERO')
+      );
       return clientSideValidationFail();
     }
-
   }
-  callbackOnProcessActionHandler = function (response, data, request) {
+  callbackOnProcessActionHandler = function(response, data, request) {
     //Check if there are blocked Business Partners
     if (data.message.severity === 'error') {
-      view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, data.message.title, data.message.text);
+      view.messageBar.setMessage(
+        isc.OBMessageBar.TYPE_ERROR,
+        data.message.title,
+        data.message.text
+      );
       return clientSideValidationFail();
     }
     // Check if the write off limit has been exceeded
     if (writeOffLimitPreference === 'Y') {
       if (totalWriteOffAmount > data.writeofflimit) {
-        view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_NotAllowWriteOff'));
+        view.messageBar.setMessage(
+          isc.OBMessageBar.TYPE_ERROR,
+          null,
+          OB.I18N.getLabel('APRM_NotAllowWriteOff')
+        );
         return clientSideValidationFail();
       }
     }
     actionHandlerCall();
   };
 
-  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddPaymentOnProcessActionHandler', {
-    issotrx: issotrx,
-    receivedFrom: receivedFrom,
-    currencyId: currencyId,
-    usesCredit: creditTotalItem.compareTo(BigDecimal.prototype.ZERO) !== 0,
-    generatesCredit: overpaymentField.isVisible() && overpaymentAction === 'CR',
-    selectedRecords: selectedRecords,
-    finFinancialAccount: finFinancialAccount
-  }, {}, callbackOnProcessActionHandler);
-};
\ No newline at end of file
+  OB.RemoteCallManager.call(
+    'org.openbravo.advpaymentmngt.actionHandler.AddPaymentOnProcessActionHandler',
+    {
+      issotrx: issotrx,
+      receivedFrom: receivedFrom,
+      currencyId: currencyId,
+      usesCredit: creditTotalItem.compareTo(BigDecimal.prototype.ZERO) !== 0,
+      generatesCredit:
+        overpaymentField.isVisible() && overpaymentAction === 'CR',
+      selectedRecords: selectedRecords,
+      finFinancialAccount: finFinancialAccount
+    },
+    {},
+    callbackOnProcessActionHandler
+  );
+};
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addTransaction.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addTransaction.js	Wed Jun 12 10:59:13 2019 +0200
@@ -19,22 +19,28 @@
 
 OB.APRM.AddTransaction = {};
 
-
-OB.APRM.AddTransaction.onLoad = function (view) {
+OB.APRM.AddTransaction.onLoad = function(view) {
   var bankStatementLineId = view.callerField.record.id;
-  view.theForm.addField(isc.OBTextItem.create({
-    name: 'bankStatementLineId',
-    value: bankStatementLineId
-  }));
+  view.theForm.addField(
+    isc.OBTextItem.create({
+      name: 'bankStatementLineId',
+      value: bankStatementLineId
+    })
+  );
   view.theForm.hideItem('bankStatementLineId');
-  view.theForm.getItem('ad_org_id_process').setValue(view.theForm.getItem('ad_org_id').getValue());
+  view.theForm
+    .getItem('ad_org_id_process')
+    .setValue(view.theForm.getItem('ad_org_id').getValue());
 };
 
-
-OB.APRM.AddTransaction.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
+OB.APRM.AddTransaction.onProcess = function(
+  view,
+  actionHandlerCall,
+  clientSideValidationFail
+) {
   var execute;
 
-  execute = function (ok) {
+  execute = function(ok) {
     if (ok) {
       actionHandlerCall();
     } else {
@@ -43,18 +49,31 @@
   };
 
   // Called from Match Statement grid when we have view.callerField.record.match
-  if (view && view.callerField && view.callerField.record && view.callerField.record.match && typeof view.getContextInfo === 'function') {
+  if (
+    view &&
+    view.callerField &&
+    view.callerField.record &&
+    view.callerField.record.match &&
+    typeof view.getContextInfo === 'function'
+  ) {
     var blineAmt = view.callerField.record.amount,
-        trxDepositAmt = view.getContextInfo().depositamt,
-        trxPaymentAmt = view.getContextInfo().withdrawalamt,
-        trxAmt = trxDepositAmt - trxPaymentAmt,
-        paymentId = view.getContextInfo().fin_payment_id,
-        glitemId = view.getContextInfo().c_glitem_id,
-        trxType = view.getContextInfo().trxtype,
-        hideSplitConfirmation = OB.PropertyStore.get('APRM_MATCHSTATEMENT_HIDE_PARTIALMATCH_POPUP', view.windowId);
+      trxDepositAmt = view.getContextInfo().depositamt,
+      trxPaymentAmt = view.getContextInfo().withdrawalamt,
+      trxAmt = trxDepositAmt - trxPaymentAmt,
+      paymentId = view.getContextInfo().fin_payment_id,
+      glitemId = view.getContextInfo().c_glitem_id,
+      trxType = view.getContextInfo().trxtype,
+      hideSplitConfirmation = OB.PropertyStore.get(
+        'APRM_MATCHSTATEMENT_HIDE_PARTIALMATCH_POPUP',
+        view.windowId
+      );
 
-    if (("BPD" === trxType || "BPW" === trxType) && !glitemId && !paymentId) {
-      view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_INVALID_TRANSACTION'));
+    if (('BPD' === trxType || 'BPW' === trxType) && !glitemId && !paymentId) {
+      view.messageBar.setMessage(
+        isc.OBMessageBar.TYPE_ERROR,
+        null,
+        OB.I18N.getLabel('APRM_INVALID_TRANSACTION')
+      );
       clientSideValidationFail();
     } else if (trxAmt !== blineAmt) {
       // Split required
@@ -62,7 +81,25 @@
         // Continue with the match
         actionHandlerCall();
       } else {
-        isc.confirm(OB.I18N.getLabel('APRM_SplitBankStatementLineConfirm', [OB.Utilities.Number.JSToOBMasked(blineAmt, OB.Format.defaultNumericMask, OB.Format.defaultDecimalSymbol, OB.Format.defaultGroupingSymbol, OB.Format.defaultGroupingSize), OB.Utilities.Number.JSToOBMasked(trxAmt, OB.Format.defaultNumericMask, OB.Format.defaultDecimalSymbol, OB.Format.defaultGroupingSymbol, OB.Format.defaultGroupingSize)]), execute);
+        isc.confirm(
+          OB.I18N.getLabel('APRM_SplitBankStatementLineConfirm', [
+            OB.Utilities.Number.JSToOBMasked(
+              blineAmt,
+              OB.Format.defaultNumericMask,
+              OB.Format.defaultDecimalSymbol,
+              OB.Format.defaultGroupingSymbol,
+              OB.Format.defaultGroupingSize
+            ),
+            OB.Utilities.Number.JSToOBMasked(
+              trxAmt,
+              OB.Format.defaultNumericMask,
+              OB.Format.defaultDecimalSymbol,
+              OB.Format.defaultGroupingSymbol,
+              OB.Format.defaultGroupingSize
+            )
+          ]),
+          execute
+        );
       }
     } else {
       // Continue with the match
@@ -73,7 +110,12 @@
   }
 };
 
-OB.APRM.AddTransaction.trxTypeOnChangeFunction = function (item, view, form, grid) {
+OB.APRM.AddTransaction.trxTypeOnChangeFunction = function(
+  item,
+  view,
+  form,
+  grid
+) {
   if (item.getValue() === 'BPW') {
     form.getItem('depositamt').setDisabled(true);
     form.getItem('withdrawalamt').setDisabled(false);
@@ -89,46 +131,80 @@
   }
 };
 
-OB.APRM.AddTransaction.paymentOnChangeFunction = function (item, view, form, grid) {
-  var callback, strPaymentId = item.getValue(),
-      strDescription = form.getItem('description').getValue();
+OB.APRM.AddTransaction.paymentOnChangeFunction = function(
+  item,
+  view,
+  form,
+  grid
+) {
+  var callback,
+    strPaymentId = item.getValue(),
+    strDescription = form.getItem('description').getValue();
 
-  callback = function (response, data, request) {
+  callback = function(response, data, request) {
     form.getItem('description').setValue(data.description);
     form.getItem('depositamt').setValue(data.depositamt);
     form.getItem('withdrawalamt').setValue(data.paymentamt);
     form.getItem('c_bpartner_id').setValue(data.cBpartnerId);
   };
 
-  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddTransactionOnChangePaymentActionHandler', {
-    strPaymentId: strPaymentId,
-    strDescription: strDescription
-  }, {}, callback);
+  OB.RemoteCallManager.call(
+    'org.openbravo.advpaymentmngt.actionHandler.AddTransactionOnChangePaymentActionHandler',
+    {
+      strPaymentId: strPaymentId,
+      strDescription: strDescription
+    },
+    {},
+    callback
+  );
 };
 
-OB.APRM.AddTransaction.glitemOnChangeFunction = function (item, view, form, grid) {
-  var callback, strGLItemId = item.getValue(),
-      strDescription = form.getItem('description').getValue();
+OB.APRM.AddTransaction.glitemOnChangeFunction = function(
+  item,
+  view,
+  form,
+  grid
+) {
+  var callback,
+    strGLItemId = item.getValue(),
+    strDescription = form.getItem('description').getValue();
 
-  callback = function (response, data, request) {
+  callback = function(response, data, request) {
     form.getItem('description').setValue(data.description);
   };
 
-  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.GLItemTransactionActionHandler', {
-    strGLItemId: strGLItemId,
-    strDescription: strDescription
-  }, {}, callback);
+  OB.RemoteCallManager.call(
+    'org.openbravo.advpaymentmngt.actionHandler.GLItemTransactionActionHandler',
+    {
+      strGLItemId: strGLItemId,
+      strDescription: strDescription
+    },
+    {},
+    callback
+  );
 };
 
-OB.APRM.AddTransaction.trxDateOnChangeFunction = function (item, view, form, grid) {
+OB.APRM.AddTransaction.trxDateOnChangeFunction = function(
+  item,
+  view,
+  form,
+  grid
+) {
   form.getItem('dateacct').setDateParameterValue(new Date(item.getValue()));
 };
 
-OB.APRM.AddTransaction.organizationOnChangeFunction = function (item, view, form, grid) {
-  form.getItem('ad_org_id_process').setValue(form.getItem('ad_org_id').getValue());
+OB.APRM.AddTransaction.organizationOnChangeFunction = function(
+  item,
+  view,
+  form,
+  grid
+) {
+  form
+    .getItem('ad_org_id_process')
+    .setValue(form.getItem('ad_org_id').getValue());
 };
 
-OB.APRM.AddTransaction.amtOnChangeFunction = function (item, view, form, grid) {
+OB.APRM.AddTransaction.amtOnChangeFunction = function(item, view, form, grid) {
   var trxType = form.getItem('trxtype').getValue();
   if (trxType === 'BF') {
     if (item.name === 'depositamt') {
@@ -137,4 +213,4 @@
       form.getItem('depositamt').setValue(Number('0'));
     }
   }
-};
\ No newline at end of file
+};
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-findTransaction.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-findTransaction.js	Wed Jun 12 10:59:13 2019 +0200
@@ -19,10 +19,14 @@
 
 OB.APRM.FindTransactions = {};
 
-OB.APRM.FindTransactions.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
+OB.APRM.FindTransactions.onProcess = function(
+  view,
+  actionHandlerCall,
+  clientSideValidationFail
+) {
   var execute;
 
-  execute = function (ok) {
+  execute = function(ok) {
     if (ok) {
       actionHandlerCall();
     } else {
@@ -30,17 +34,29 @@
     }
   };
 
-  if (view && typeof view.getContextInfo === 'function' && view.callerField && view.callerField.view && typeof view.callerField.view.getContextInfo === 'function') {
-    var i, trxSelection = view.getContextInfo().findtransactiontomatch._selection;
+  if (
+    view &&
+    typeof view.getContextInfo === 'function' &&
+    view.callerField &&
+    view.callerField.view &&
+    typeof view.callerField.view.getContextInfo === 'function'
+  ) {
+    var i,
+      trxSelection = view.getContextInfo().findtransactiontomatch._selection;
 
     if (trxSelection && trxSelection[0]) {
       var totalTrxAmt = BigDecimal.prototype.ZERO,
-          blineAmt = new BigDecimal(String(view.callerField.record.amount)),
-          hideSplitConfirmation = OB.PropertyStore.get('APRM_MATCHSTATEMENT_HIDE_PARTIALMATCH_POPUP', view.windowId);
+        blineAmt = new BigDecimal(String(view.callerField.record.amount)),
+        hideSplitConfirmation = OB.PropertyStore.get(
+          'APRM_MATCHSTATEMENT_HIDE_PARTIALMATCH_POPUP',
+          view.windowId
+        );
       for (i = 0; i < trxSelection.length; i++) {
-        var trxDepositAmt = new BigDecimal(String(trxSelection[i].depositAmount)),
-            trxPaymentAmt = new BigDecimal(String(trxSelection[i].paymentAmount)),
-            trxAmt = trxDepositAmt.subtract(trxPaymentAmt);
+        var trxDepositAmt = new BigDecimal(
+            String(trxSelection[i].depositAmount)
+          ),
+          trxPaymentAmt = new BigDecimal(String(trxSelection[i].paymentAmount)),
+          trxAmt = trxDepositAmt.subtract(trxPaymentAmt);
         totalTrxAmt = totalTrxAmt.add(trxAmt);
       }
       if (totalTrxAmt.compareTo(blineAmt) !== 0) {
@@ -50,7 +66,25 @@
           actionHandlerCall();
         } else {
           if (isc.isA.emptyObject(OB.TestRegistry.registry)) {
-            isc.confirm(OB.I18N.getLabel('APRM_SplitBankStatementLineConfirm', [OB.Utilities.Number.JSToOBMasked(blineAmt, OB.Format.defaultNumericMask, OB.Format.defaultDecimalSymbol, OB.Format.defaultGroupingSymbol, OB.Format.defaultGroupingSize), OB.Utilities.Number.JSToOBMasked(totalTrxAmt, OB.Format.defaultNumericMask, OB.Format.defaultDecimalSymbol, OB.Format.defaultGroupingSymbol, OB.Format.defaultGroupingSize)]), execute);
+            isc.confirm(
+              OB.I18N.getLabel('APRM_SplitBankStatementLineConfirm', [
+                OB.Utilities.Number.JSToOBMasked(
+                  blineAmt,
+                  OB.Format.defaultNumericMask,
+                  OB.Format.defaultDecimalSymbol,
+                  OB.Format.defaultGroupingSymbol,
+                  OB.Format.defaultGroupingSize
+                ),
+                OB.Utilities.Number.JSToOBMasked(
+                  totalTrxAmt,
+                  OB.Format.defaultNumericMask,
+                  OB.Format.defaultDecimalSymbol,
+                  OB.Format.defaultGroupingSymbol,
+                  OB.Format.defaultGroupingSize
+                )
+              ]),
+              execute
+            );
           } else {
             execute(true);
           }
@@ -61,8 +95,12 @@
       }
     } else {
       // No Transaction selected
-      view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_SELECT_RECORD_ERROR'));
+      view.messageBar.setMessage(
+        isc.OBMessageBar.TYPE_ERROR,
+        null,
+        OB.I18N.getLabel('APRM_SELECT_RECORD_ERROR')
+      );
       clientSideValidationFail();
     }
   }
-};
\ No newline at end of file
+};
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-fundsTransfer.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-fundsTransfer.js	Wed Jun 12 10:59:13 2019 +0200
@@ -17,28 +17,33 @@
  ************************************************************************
  */
 OB.APRM.FundsTranfer = {
-  depositToOnChange: function (item, view, form, grid) {
+  depositToOnChange: function(item, view, form, grid) {
     // the callback called after the server side call returns
-    var callback = function (response, data, request) {
-        var currencyTo = form.getItem('c_currency_to_id');
-        if (!currencyTo.valueMap) {
-          currencyTo.valueMap = {};
-        }
-        currencyTo.valueMap[data.currencyID] = data.currencyISO;
-        currencyTo.setValue(data.currencyID);
+    var callback = function(response, data, request) {
+      var currencyTo = form.getItem('c_currency_to_id');
+      if (!currencyTo.valueMap) {
+        currencyTo.valueMap = {};
+      }
+      currencyTo.valueMap[data.currencyID] = data.currencyISO;
+      currencyTo.setValue(data.currencyID);
 
-        // redraw popup after field change to update display logic
-        form.redraw();
-        };
+      // redraw popup after field change to update display logic
+      form.redraw();
+    };
     // do a server side call and on return call the callback
-    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.FundsTransferOnChangeDepositToActionHandler', {
-      accountID: item.getValue()
-    }, {}, callback);
+    OB.RemoteCallManager.call(
+      'org.openbravo.advpaymentmngt.actionHandler.FundsTransferOnChangeDepositToActionHandler',
+      {
+        accountID: item.getValue()
+      },
+      {},
+      callback
+    );
   },
-  onLoad: function (view) {
+  onLoad: function(view) {
     var form = view.theForm,
-        description = form.getItem('description');
+      description = form.getItem('description');
 
     description.setValue(OB.I18N.getLabel('FundsTransfer'));
   }
-};
\ No newline at end of file
+};
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-matchStatement.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-matchStatement.js	Wed Jun 12 10:59:13 2019 +0200
@@ -19,16 +19,24 @@
 
 OB.APRM.MatchStatement = {};
 
-OB.APRM.MatchStatement.addPreference = function (view) {
+OB.APRM.MatchStatement.addPreference = function(view) {
   var onLoadCallback;
-  onLoadCallback = function (response, data, request) {};
-  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadPreferenceActionHandler', {}, {}, onLoadCallback);
+  onLoadCallback = function(response, data, request) {};
+  OB.RemoteCallManager.call(
+    'org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadPreferenceActionHandler',
+    {},
+    {},
+    onLoadCallback
+  );
 };
 
-OB.APRM.MatchStatement.onLoad = function (view) {
-  var execute, grid = view.theForm.getItem('match_statement').canvas.viewGrid,
-      buttons = view.popupButtons.members[0].members,
-      i, button, propertyButtonValue = '_buttonValue';
+OB.APRM.MatchStatement.onLoad = function(view) {
+  var execute,
+    grid = view.theForm.getItem('match_statement').canvas.viewGrid,
+    buttons = view.popupButtons.members[0].members,
+    i,
+    button,
+    propertyButtonValue = '_buttonValue';
   view.cancelButton.hide();
   view.parentElement.parentElement.closeButton.hide();
 
@@ -41,71 +49,126 @@
     }
   }
 
-  button.action = function () {
-    var callback = function (response, data, request) {
-        view.onRefreshFunction(view);
-        if (data && data.message && data.message.severity === 'error') {
-          view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, data.message.title, data.message.text);
-        } else if (data && data.message && data.message.severity === 'success') {
-          view.messageBar.setMessage(isc.OBMessageBar.TYPE_SUCCESS, data.message.title, data.message.text);
-        } else if (data && data.message && data.message.severity === 'warning') {
-          view.messageBar.setMessage(isc.OBMessageBar.TYPE_WARNING, data.message.title, data.message.text);
-        }
-        };
-    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.UnMatchSelectedTransactionsActionHandler', {
-      bankStatementLineIds: grid.getSelectedRecords()
-    }, {}, callback);
+  button.action = function() {
+    var callback = function(response, data, request) {
+      view.onRefreshFunction(view);
+      if (data && data.message && data.message.severity === 'error') {
+        view.messageBar.setMessage(
+          isc.OBMessageBar.TYPE_ERROR,
+          data.message.title,
+          data.message.text
+        );
+      } else if (data && data.message && data.message.severity === 'success') {
+        view.messageBar.setMessage(
+          isc.OBMessageBar.TYPE_SUCCESS,
+          data.message.title,
+          data.message.text
+        );
+      } else if (data && data.message && data.message.severity === 'warning') {
+        view.messageBar.setMessage(
+          isc.OBMessageBar.TYPE_WARNING,
+          data.message.title,
+          data.message.text
+        );
+      }
+    };
+    OB.RemoteCallManager.call(
+      'org.openbravo.advpaymentmngt.actionHandler.UnMatchSelectedTransactionsActionHandler',
+      {
+        bankStatementLineIds: grid.getSelectedRecords()
+      },
+      {},
+      callback
+    );
   };
 
   grid.dataSourceOrig = grid.dataSource;
   grid.dataSource = null;
-  execute = function (ok) {
-    var onLoadCallback, params = {};
+  execute = function(ok) {
+    var onLoadCallback,
+      params = {};
     if (grid.view.sourceView) {
       params.context = grid.view.sourceView.getContextInfo();
     }
     params.executeMatching = ok;
-    onLoadCallback = function (response, data, request) {
+    onLoadCallback = function(response, data, request) {
       if (data.responseActions) {
         OB.Utilities.Action.executeJSON(data.responseActions, null, null, view);
       }
       grid.dataSource = grid.dataSourceOrig;
       grid.filterByEditor();
     };
-    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadActionHandler', {}, params, onLoadCallback);
+    OB.RemoteCallManager.call(
+      'org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadActionHandler',
+      {},
+      params,
+      onLoadCallback
+    );
   };
   if (grid && grid.parentElement && grid.parentElement.messageBar) {
     var onLoadCallback;
-    onLoadCallback = function (response, data, request) {
+    onLoadCallback = function(response, data, request) {
       if (!data.preference) {
-        grid.parentElement.messageBar.setMessage(isc.OBMessageBar.TYPE_INFO, '<div><div class="' + OB.Styles.MessageBar.leftMsgContainerStyle + '">' + OB.I18N.getLabel('APRM_GRID_PERSIST_MESSAGE') + '</div><div class="' + OB.Styles.MessageBar.rightMsgContainerStyle + '"><a href="#" class="' + OB.Styles.MessageBar.rightMsgTextStyle + '" onclick="' + 'window[\'' + grid.parentElement.messageBar.ID + '\'].hide(); OB.APRM.MatchStatement.addPreference();">' + OB.I18N.getLabel('OBUIAPP_NeverShowMessageAgain') + '</a></div></div>', ' ');
+        grid.parentElement.messageBar.setMessage(
+          isc.OBMessageBar.TYPE_INFO,
+          '<div><div class="' +
+            OB.Styles.MessageBar.leftMsgContainerStyle +
+            '">' +
+            OB.I18N.getLabel('APRM_GRID_PERSIST_MESSAGE') +
+            '</div><div class="' +
+            OB.Styles.MessageBar.rightMsgContainerStyle +
+            '"><a href="#" class="' +
+            OB.Styles.MessageBar.rightMsgTextStyle +
+            '" onclick="' +
+            "window['" +
+            grid.parentElement.messageBar.ID +
+            '\'].hide(); OB.APRM.MatchStatement.addPreference();">' +
+            OB.I18N.getLabel('OBUIAPP_NeverShowMessageAgain') +
+            '</a></div></div>',
+          ' '
+        );
       }
     };
-    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadGetPreferenceActionHandler', {}, {}, onLoadCallback);
+    OB.RemoteCallManager.call(
+      'org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadGetPreferenceActionHandler',
+      {},
+      {},
+      onLoadCallback
+    );
   }
   isc.confirm(OB.I18N.getLabel('APRM_AlgorithmConfirm'), execute);
 };
 
-OB.APRM.MatchStatement.onRefresh = function (view) {
+OB.APRM.MatchStatement.onRefresh = function(view) {
   var grid = view.theForm.getItem('match_statement').canvas.viewGrid,
-      newCriteria = {};
+    newCriteria = {};
   newCriteria.criteria = [];
   newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
   grid.invalidateCache();
   view.theForm.redraw();
 };
 
-OB.APRM.MatchStatement.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
+OB.APRM.MatchStatement.onProcess = function(
+  view,
+  actionHandlerCall,
+  clientSideValidationFail
+) {
   actionHandlerCall();
 };
 
-OB.APRM.MatchStatement.selectionChanged = function (grid, changedRecord, recordList) {
+OB.APRM.MatchStatement.selectionChanged = function(
+  grid,
+  changedRecord,
+  recordList
+) {
   if (changedRecord.obSelected && changedRecord.cleared) {
     grid.view.unmatchButton.show();
     return;
   } else {
-    var i, record, selection = grid.getSelectedRecords() || [],
-        len = selection.length;
+    var i,
+      record,
+      selection = grid.getSelectedRecords() || [],
+      len = selection.length;
     for (i = 0; i < len; i++) {
       record = grid.getEditedRecord(grid.getRecordIndex(selection[i]));
       if (record && record.obSelected && record.cleared) {
@@ -123,34 +186,43 @@
 isc.APRMMatchStatGridButtonsComponent.addProperties({
   canExpandRecord: true,
 
-  click: function () {
+  click: function() {
     this.grid.selectSingleRecord(this.record);
     return this.Super('click', arguments);
   },
 
-  initWidget: function () {
+  initWidget: function() {
     this.view = this.grid.view;
     var me = this,
-        searchButton, addButton, clearButton, buttonSeparator1, buttonSeparator2;
+      searchButton,
+      addButton,
+      clearButton,
+      buttonSeparator1,
+      buttonSeparator2;
 
     searchButton = isc.OBGridToolStripIcon.create({
       buttonType: 'search',
       showDisabled: true,
       originalPrompt: OB.I18N.getLabel('APRM_MATCHTRANSACTION_SEARCH_BUTTON'),
       prompt: OB.I18N.getLabel('APRM_MATCHTRANSACTION_SEARCH_BUTTON'),
-      action: function () {
+      action: function() {
         var processId = '154CB4F9274A479CB38A285E16984539',
-            grid = me.grid,
-            record = me.record,
-            standardWindow = grid.view.parentWindow.view.standardWindow,
-            callback, bankStatementLineId = me.record.id,
-            updated = new Date(),
-            view = me.grid.view;
+          grid = me.grid,
+          record = me.record,
+          standardWindow = grid.view.parentWindow.view.standardWindow,
+          callback,
+          bankStatementLineId = me.record.id,
+          updated = new Date(),
+          view = me.grid.view;
         updated.setTime(me.record.bslUpdated.getTime());
-        callback = function (response, data, request) {
+        callback = function(response, data, request) {
           view.onRefreshFunction(view);
           if (data && data.message && data.message.severity === 'error') {
-            view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, data.message.title, data.message.text);
+            view.messageBar.setMessage(
+              isc.OBMessageBar.TYPE_ERROR,
+              data.message.title,
+              data.message.text
+            );
           } else {
             standardWindow.openProcess({
               callerField: me,
@@ -161,14 +233,22 @@
                 bankStatementLineId: record.id,
                 transactionDate: record.transactionDate
               },
-              windowTitle: OB.I18N.getLabel('APRM_MATCHTRANSACTION_SEARCH_BUTTON', [this.title])
+              windowTitle: OB.I18N.getLabel(
+                'APRM_MATCHTRANSACTION_SEARCH_BUTTON',
+                [this.title]
+              )
             });
           }
         };
-        OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.CheckRecordChangedActionHandler', {
-          bankStatementLineId: bankStatementLineId,
-          updated: updated
-        }, {}, callback);
+        OB.RemoteCallManager.call(
+          'org.openbravo.advpaymentmngt.actionHandler.CheckRecordChangedActionHandler',
+          {
+            bankStatementLineId: bankStatementLineId,
+            updated: updated
+          },
+          {},
+          callback
+        );
       }
     });
     // Disable searchButton button if record is linked to a transaction
@@ -181,18 +261,23 @@
       showDisabled: true,
       originalPrompt: OB.I18N.getLabel('APRM_MATCHTRANSACTION_ADD_BUTTON'),
       prompt: OB.I18N.getLabel('APRM_MATCHTRANSACTION_ADD_BUTTON'),
-      action: function () {
+      action: function() {
         var processId = 'E68790A7B65F4D45AB35E2BAE34C1F39',
-            grid = me.grid,
-            standardWindow = grid.view.parentWindow.view.standardWindow,
-            callback, bankStatementLineId = me.record.id,
-            updated = new Date(),
-            view = me.grid.view;
+          grid = me.grid,
+          standardWindow = grid.view.parentWindow.view.standardWindow,
+          callback,
+          bankStatementLineId = me.record.id,
+          updated = new Date(),
+          view = me.grid.view;
         updated.setTime(me.record.bslUpdated.getTime());
-        callback = function (response, data, request) {
+        callback = function(response, data, request) {
           view.onRefreshFunction(view);
           if (data && data.message && data.message.severity === 'error') {
-            view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, data.message.title, data.message.text);
+            view.messageBar.setMessage(
+              isc.OBMessageBar.TYPE_ERROR,
+              data.message.title,
+              data.message.text
+            );
           } else {
             standardWindow.openProcess({
               callerField: me,
@@ -202,14 +287,22 @@
               externalParams: {
                 bankStatementLineId: me.record.id
               },
-              windowTitle: OB.I18N.getLabel('APRM_MATCHTRANSACTION_ADD_BUTTON', [this.title])
+              windowTitle: OB.I18N.getLabel(
+                'APRM_MATCHTRANSACTION_ADD_BUTTON',
+                [this.title]
+              )
             });
           }
         };
-        OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.CheckRecordChangedActionHandler', {
-          bankStatementLineId: bankStatementLineId,
-          updated: updated
-        }, {}, callback);
+        OB.RemoteCallManager.call(
+          'org.openbravo.advpaymentmngt.actionHandler.CheckRecordChangedActionHandler',
+          {
+            bankStatementLineId: bankStatementLineId,
+            updated: updated
+          },
+          {},
+          callback
+        );
       }
     });
     // Disable addButton button if record is linked to a transaction
@@ -222,21 +315,31 @@
       showDisabled: true,
       originalPrompt: OB.I18N.getLabel('APRM_MATCHTRANSACTION_DELETE_BUTTON'),
       prompt: OB.I18N.getLabel('APRM_MATCHTRANSACTION_DELETE_BUTTON'),
-      action: function () {
-        var callback, bankStatementLineId = me.record.id,
-            updated = new Date(),
-            view = me.grid.view;
+      action: function() {
+        var callback,
+          bankStatementLineId = me.record.id,
+          updated = new Date(),
+          view = me.grid.view;
         updated.setTime(me.record.bslUpdated.getTime());
-        callback = function (response, data, request) {
+        callback = function(response, data, request) {
           view.onRefreshFunction(view);
           if (data && data.message && data.message.severity === 'error') {
-            view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, data.message.title, data.message.text);
+            view.messageBar.setMessage(
+              isc.OBMessageBar.TYPE_ERROR,
+              data.message.title,
+              data.message.text
+            );
           }
         };
-        OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.UnMatchTransactionActionHandler', {
-          bankStatementLineId: bankStatementLineId,
-          updated: updated
-        }, {}, callback);
+        OB.RemoteCallManager.call(
+          'org.openbravo.advpaymentmngt.actionHandler.UnMatchTransactionActionHandler',
+          {
+            bankStatementLineId: bankStatementLineId,
+            updated: updated
+          },
+          {},
+          callback
+        );
       }
     });
 
@@ -248,12 +351,17 @@
     clearButton.setDisabled(!me.record.cleared);
     OB.APRM.MatchStatement.selectionChanged(me.grid, me.record);
 
-    this.addMembers([searchButton, buttonSeparator1, addButton, buttonSeparator2, clearButton]);
+    this.addMembers([
+      searchButton,
+      buttonSeparator1,
+      addButton,
+      buttonSeparator2,
+      clearButton
+    ]);
     this.Super('initWidget', arguments);
   }
 });
 
-
 isc.APRMMatchStatGridButtonsComponent.addProperties({
   cellAlign: 'center',
 
@@ -266,4 +374,4 @@
   layoutLeftMargin: -2,
   layoutRightMargin: 0,
   membersMargin: 4
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js	Wed Jun 12 10:59:13 2019 +0200
@@ -19,25 +19,39 @@
 
 OB.APRM = {};
 
-OB.APRM.bankTransitoryAccountCalloutResponse = function (me, confirmMessage, financialAccountId) {
-  isc.confirm(confirmMessage, function (value) {
+OB.APRM.bankTransitoryAccountCalloutResponse = function(
+  me,
+  confirmMessage,
+  financialAccountId
+) {
+  isc.confirm(confirmMessage, function(value) {
     var post;
     if (value) {
       var bankTransitoryAccount = me.getField('fINTransitoryAcct')._value,
-          bankTransitoryAccountDesc = me.getField('fINTransitoryAcct').valueMap[bankTransitoryAccount];
+        bankTransitoryAccountDesc = me.getField('fINTransitoryAcct').valueMap[
+          bankTransitoryAccount
+        ];
 
-      me.getField('clearedPaymentAccount').valueMap[bankTransitoryAccount] = bankTransitoryAccountDesc;
+      me.getField('clearedPaymentAccount').valueMap[
+        bankTransitoryAccount
+      ] = bankTransitoryAccountDesc;
       me.getField('clearedPaymentAccount').setValue(bankTransitoryAccount);
-      me.getField('clearedPaymentAccountOUT').valueMap[bankTransitoryAccount] = bankTransitoryAccountDesc;
+      me.getField('clearedPaymentAccountOUT').valueMap[
+        bankTransitoryAccount
+      ] = bankTransitoryAccountDesc;
       me.getField('clearedPaymentAccountOUT').setValue(bankTransitoryAccount);
 
       post = {
-        'eventType': 'bankTransitoryCalloutResponse',
-        'financialAccountId': financialAccountId
+        eventType: 'bankTransitoryCalloutResponse',
+        financialAccountId: financialAccountId
       };
 
-      OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.APRMActionHandler', post, {}, {});
-
+      OB.RemoteCallManager.call(
+        'org.openbravo.advpaymentmngt.APRMActionHandler',
+        post,
+        {},
+        {}
+      );
     }
   });
 };
@@ -45,16 +59,36 @@
 OB.APRM.validateMPPUserWarnedAwaiting = false;
 OB.APRM.validateMPPUserWarnedSign = false;
 
-OB.APRM.validateModifyPaymentPlanAmounts = function (item, validator, value, record) {
-  var indRow, allRows = item.grid.data.allRows,
-      row, allGreen = true,
-      totalExpected = new BigDecimal("0"),
-      totalReceived = new BigDecimal("0"),
-      totalOutstanding = new BigDecimal("0"),
-      isNumber = isc.isA.Number,
-      invoiceOutstanding = new BigDecimal(String(item.grid.view.parentWindow.activeView.getContextInfo(false, true, true, false).inpoutstandingamt));
+OB.APRM.validateModifyPaymentPlanAmounts = function(
+  item,
+  validator,
+  value,
+  record
+) {
+  var indRow,
+    allRows = item.grid.data.allRows,
+    row,
+    allGreen = true,
+    totalExpected = new BigDecimal('0'),
+    totalReceived = new BigDecimal('0'),
+    totalOutstanding = new BigDecimal('0'),
+    isNumber = isc.isA.Number,
+    invoiceOutstanding = new BigDecimal(
+      String(
+        item.grid.view.parentWindow.activeView.getContextInfo(
+          false,
+          true,
+          true,
+          false
+        ).inpoutstandingamt
+      )
+    );
 
-  if (new BigDecimal(String(value)).compareTo(new BigDecimal("0")) !== 0 && (new BigDecimal(String(value)).compareTo(new BigDecimal("0")) !== invoiceOutstanding.compareTo(new BigDecimal("0")))) {
+  if (
+    new BigDecimal(String(value)).compareTo(new BigDecimal('0')) !== 0 &&
+    new BigDecimal(String(value)).compareTo(new BigDecimal('0')) !==
+      invoiceOutstanding.compareTo(new BigDecimal('0'))
+  ) {
     if (!OB.APRM.validateMPPUserWarnedSign) {
       OB.APRM.validateMPPUserWarnedSign = true;
       isc.warn(OB.I18N.getLabel('APRM_DifferentSignError'));
@@ -65,22 +99,40 @@
   for (indRow = 0; indRow < allRows.length; indRow++) {
     row = allRows[indRow];
 
-    if (!isNumber(row.expected) || !isNumber(row.outstanding) || !isNumber(row.received)) {
+    if (
+      !isNumber(row.expected) ||
+      !isNumber(row.outstanding) ||
+      !isNumber(row.received)
+    ) {
       return false;
     }
 
     totalExpected = totalExpected.add(new BigDecimal(String(row.expected)));
-    totalOutstanding = totalOutstanding.add(new BigDecimal(String(row.outstanding)));
+    totalOutstanding = totalOutstanding.add(
+      new BigDecimal(String(row.outstanding))
+    );
     totalReceived = totalReceived.add(new BigDecimal(String(row.received)));
   }
-  if (totalOutstanding.abs().compareTo(totalExpected.subtract(totalReceived).abs()) !== 0) {
+  if (
+    totalOutstanding
+      .abs()
+      .compareTo(totalExpected.subtract(totalReceived).abs()) !== 0
+  ) {
     return false;
   }
   for (indRow = 0; indRow < allRows.length; indRow++) {
     row = allRows[indRow];
-    row.expected = Number(new BigDecimal(String(row.outstanding)).add(new BigDecimal(String(row.received))));
+    row.expected = Number(
+      new BigDecimal(String(row.outstanding)).add(
+        new BigDecimal(String(row.received))
+      )
+    );
   }
-  if (new BigDecimal(String(record.awaitingExecutionAmount)).abs().compareTo(new BigDecimal(String(record.outstanding)).abs()) > 0) {
+  if (
+    new BigDecimal(String(record.awaitingExecutionAmount))
+      .abs()
+      .compareTo(new BigDecimal(String(record.outstanding)).abs()) > 0
+  ) {
     if (!OB.APRM.validateMPPUserWarnedAwaiting) {
       OB.APRM.validateMPPUserWarnedAwaiting = true;
       isc.warn(OB.I18N.getLabel('APRM_AwaitingExecutionAmountError'));
@@ -88,7 +140,11 @@
     return false;
   }
   for (indRow = 0; indRow < allRows.length; indRow++) {
-    if (typeof item.grid.rowHasErrors(allRows[indRow]) !== 'undefined' && item.grid.rowHasErrors(allRows[indRow]) && allRows[indRow] !== record) {
+    if (
+      typeof item.grid.rowHasErrors(allRows[indRow]) !== 'undefined' &&
+      item.grid.rowHasErrors(allRows[indRow]) &&
+      allRows[indRow] !== record
+    ) {
       allGreen = false;
     }
   }
@@ -99,7 +155,11 @@
   return true;
 };
 
-OB.APRM.selectionChangePaymentProposalPickAndEdit = function (grid, record, state) {
+OB.APRM.selectionChangePaymentProposalPickAndEdit = function(
+  grid,
+  record,
+  state
+) {
   if (state) {
     var paidamount = new BigDecimal(String(record.payment));
 
@@ -110,16 +170,22 @@
   }
 };
 
-OB.APRM.validatePaymentProposalPickAndEdit = function (item, validator, value, record) {
-
+OB.APRM.validatePaymentProposalPickAndEdit = function(
+  item,
+  validator,
+  value,
+  record
+) {
   if (!isc.isA.Number(record.payment)) {
     isc.warn(OB.I18N.getLabel('APRM_NotValidNumber'));
     return false;
   }
 
-  var i, row, allRows = item.grid.data.allRows || item.grid.data.localData,
-      outstanding = new BigDecimal(String(record.outstanding)),
-      paidamount = new BigDecimal(String(record.payment));
+  var i,
+    row,
+    allRows = item.grid.data.allRows || item.grid.data.localData,
+    outstanding = new BigDecimal(String(record.outstanding)),
+    paidamount = new BigDecimal(String(record.payment));
 
   if (outstanding.abs().compareTo(paidamount.abs()) < 0) {
     isc.warn(OB.I18N.getLabel('APRM_MoreAmountThanOutstanding'));
@@ -133,20 +199,33 @@
     }
   }
   var contextInfo = null;
-  contextInfo = item.grid.view.parentWindow.activeView.getContextInfo(false, true, true, true);
+  contextInfo = item.grid.view.parentWindow.activeView.getContextInfo(
+    false,
+    true,
+    true,
+    true
+  );
 
   // When possible to capture on change event, move this code to another method
   if (row) {
     row.difference = Number(outstanding.subtract(paidamount));
     row.payment = Number(record.payment);
-    if (contextInfo.inplimitwriteoff && contextInfo.inplimitwriteoff !== "") {
-      var differencewriteoff = OB.Utilities.Number.JSToOBMasked((row.difference * contextInfo.inpfinaccTxnConvertRate), OB.Format.defaultNumericMask, OB.Format.defaultDecimalSymbol, OB.Format.defaultGroupingSymbol, OB.Format.defaultGroupingSize);
-      if (differencewriteoff > contextInfo.inplimitwriteoff && record.writeoff === true) {
+    if (contextInfo.inplimitwriteoff && contextInfo.inplimitwriteoff !== '') {
+      var differencewriteoff = OB.Utilities.Number.JSToOBMasked(
+        row.difference * contextInfo.inpfinaccTxnConvertRate,
+        OB.Format.defaultNumericMask,
+        OB.Format.defaultDecimalSymbol,
+        OB.Format.defaultGroupingSymbol,
+        OB.Format.defaultGroupingSize
+      );
+      if (
+        differencewriteoff > contextInfo.inplimitwriteoff &&
+        record.writeoff === true
+      ) {
         isc.warn(OB.I18N.getLabel('APRM_NotAllowWriteOff'));
         return false;
       }
     }
-
   } else {
     return false;
   }
@@ -154,28 +233,44 @@
   return true;
 };
 
-OB.APRM.addNew = function (grid) {
+OB.APRM.addNew = function(grid) {
   var selectedRecord = grid.view.parentWindow.views[0].getParentRecord(),
-      allRows = grid.data.allRows || grid.data.localData,
-      totalExpected = new BigDecimal("0"),
-      totalReceived = new BigDecimal("0");
+    allRows = grid.data.allRows || grid.data.localData,
+    totalExpected = new BigDecimal('0'),
+    totalReceived = new BigDecimal('0');
   var returnObject = isc.addProperties({}, allRows[0]);
-  var indRow, row, totalOutstandingInOthers = new BigDecimal("0");
+  var indRow,
+    row,
+    totalOutstandingInOthers = new BigDecimal('0');
   for (indRow = 0; indRow < allRows.length; indRow++) {
     row = allRows[indRow];
-    totalOutstandingInOthers = totalOutstandingInOthers.add(new BigDecimal(String(row.outstanding)));
+    totalOutstandingInOthers = totalOutstandingInOthers.add(
+      new BigDecimal(String(row.outstanding))
+    );
     totalExpected = totalExpected.add(new BigDecimal(String(row.expected)));
     totalReceived = totalReceived.add(new BigDecimal(String(row.received)));
   }
-  returnObject.outstanding = Number(totalExpected.subtract(totalReceived).subtract(totalOutstandingInOthers));
+  returnObject.outstanding = Number(
+    totalExpected.subtract(totalReceived).subtract(totalOutstandingInOthers)
+  );
   returnObject.received = 0;
   returnObject.expected = 0;
   returnObject.awaitingExecutionAmount = 0;
   delete returnObject.id;
   returnObject.paymentMethod = selectedRecord.paymentMethod;
-  returnObject['paymentMethod' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER] = selectedRecord['paymentMethod' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER];
+  returnObject[
+    'paymentMethod' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER
+  ] =
+    selectedRecord[
+      'paymentMethod' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER
+    ];
   returnObject.currency = selectedRecord.currency;
-  returnObject['currency' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER] = selectedRecord['currency' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER];
+  returnObject[
+    'currency' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER
+  ] =
+    selectedRecord[
+      'currency' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER
+    ];
   returnObject.duedate = selectedRecord.invoiceDate;
   //General properties
   returnObject.organization = selectedRecord.organization;
@@ -184,26 +279,37 @@
   return returnObject;
 };
 
-OB.APRM.deleteRow = function (grid, rowNum, record) {
-  if (new BigDecimal(String(record.awaitingExecutionAmount)).compareTo(new BigDecimal('0')) !== 0) {
+OB.APRM.deleteRow = function(grid, rowNum, record) {
+  if (
+    new BigDecimal(String(record.awaitingExecutionAmount)).compareTo(
+      new BigDecimal('0')
+    ) !== 0
+  ) {
     isc.warn(OB.I18N.getLabel('APRM_AwaitingExecutionAmountNotDeleted'));
     return false;
   }
-  if (new BigDecimal(String(record.received)).compareTo(new BigDecimal('0')) !== 0) {
+  if (
+    new BigDecimal(String(record.received)).compareTo(new BigDecimal('0')) !== 0
+  ) {
     isc.warn(OB.I18N.getLabel('APRM_ReceivedAmountNotDeleted'));
     return false;
   }
   return true;
 };
 
-OB.APRM.validateDoubtfulDebtPickAndEdit = function (item, validator, value, record) {
+OB.APRM.validateDoubtfulDebtPickAndEdit = function(
+  item,
+  validator,
+  value,
+  record
+) {
   if (!isc.isA.Number(record.doubtfulDebtAmount)) {
     isc.warn(OB.I18N.getLabel('APRM_NotValidNumber'));
     return false;
   }
 
   var outstanding = new BigDecimal(String(record.outstandingamt)),
-      amount = new BigDecimal(String(record.doubtfulDebtAmount));
+    amount = new BigDecimal(String(record.doubtfulDebtAmount));
 
   if (outstanding.abs().compareTo(amount.abs()) < 0) {
     isc.warn(OB.I18N.getLabel('APRM_DoubtfulDebtMoreAmountThanOutstanding'));
@@ -213,12 +319,20 @@
   return true;
 };
 
-OB.APRM.selectDoubtfulDebtPickAndEdit = function (grid, record, state) {
+OB.APRM.selectDoubtfulDebtPickAndEdit = function(grid, record, state) {
   var percentage = grid.view.parentWindow.views[0].getParentRecord().percentage;
   if (state) {
-    record.doubtfulDebtAmount = Number(new BigDecimal(String(record.outstandingamt)).multiply(new BigDecimal(String(percentage))).divide(new BigDecimal('100'), record.currency$standardPrecision, BigDecimal.prototype.ROUND_HALF_UP));
+    record.doubtfulDebtAmount = Number(
+      new BigDecimal(String(record.outstandingamt))
+        .multiply(new BigDecimal(String(percentage)))
+        .divide(
+          new BigDecimal('100'),
+          record.currency$standardPrecision,
+          BigDecimal.prototype.ROUND_HALF_UP
+        )
+    );
   } else {
-    record.doubtfulDebtAmount = Number(new BigDecimal("0"));
+    record.doubtfulDebtAmount = Number(new BigDecimal('0'));
   }
   return true;
-};
\ No newline at end of file
+};
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/example/grid-example.js	Wed Jun 12 10:59:13 2019 +0200
@@ -16,7 +16,7 @@
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
-// it is often nicer to create a subclass than just changing 
+// it is often nicer to create a subclass than just changing
 // the properties of the ListGrid. A subclass can be re-used.
 // OBTestSelectionGrid: The first type is the listgrid shown in the top
 // OBTestSelectionLayout: is the layout showing the grid and the button below it
@@ -41,7 +41,7 @@
   autoFitFieldWidths: true,
   autoFitWidthApproach: 'title',
 
-  // as all the data is loaded on the client 
+  // as all the data is loaded on the client
   // let's do these things here
   dataProperties: {
     useClientFiltering: true,
@@ -53,12 +53,12 @@
   // and executing the action
   actionHandler: null,
 
-  initWidget: function () {
+  initWidget: function() {
     var me = this,
-        callBack;
+      callBack;
 
     // the data request calls this method, which sets the data in the grid
-    callBack = function (response, data, request) {
+    callBack = function(response, data, request) {
       me.dataSource = isc.DataSource.create({
         clientOnly: true,
         fields: me.fields,
@@ -68,15 +68,20 @@
     };
 
     // request the data, note the _command value
-    OB.RemoteCallManager.call(this.actionHandler, {}, {
-      '_command': 'data'
-    }, callBack);
+    OB.RemoteCallManager.call(
+      this.actionHandler,
+      {},
+      {
+        _command: 'data'
+      },
+      callBack
+    );
 
-    this.Super("initWidget", arguments);
+    this.Super('initWidget', arguments);
   },
 
   // enable/disable the button on selection
-  selectionChanged: function () {
+  selectionChanged: function() {
     this.selectionLayout.selectionUpdated(this.getSelection().getLength());
   }
 });
@@ -98,25 +103,29 @@
 
   selectionGrid: null,
   selectionButton: null,
-  initWidget: function () {
+  initWidget: function() {
     var buttonClickCallback;
 
     // note the actionHandler needs to be set in the grid when it gets created
-    // read the SC documentation on what isc.addProperties does    
-    this.selectionGrid = isc.OBTestSelectionGrid.create(isc.addProperties(this.gridProperties, {
-      actionHandler: this.actionHandler
-    }));
+    // read the SC documentation on what isc.addProperties does
+    this.selectionGrid = isc.OBTestSelectionGrid.create(
+      isc.addProperties(this.gridProperties, {
+        actionHandler: this.actionHandler
+      })
+    );
 
     // tell the selection grid who is its owner
     this.selectionGrid.selectionLayout = this;
     this.addMembers(this.selectionGrid);
 
     // make some vertical space
-    this.addMembers(isc.LayoutSpacer.create({
-      height: 10
-    }));
+    this.addMembers(
+      isc.LayoutSpacer.create({
+        height: 10
+      })
+    );
 
-    // create the action button    
+    // create the action button
     this.selectionButton = isc.Button.create(this.buttonProperties);
     this.selectionButton.selectionLayout = this;
     this.selectionButton.setDisabled(true);
@@ -124,20 +133,25 @@
 
     // this function is called after the data has been processed
     // the message is set on the server
-    buttonClickCallback = function (resp, data, req) {
+    buttonClickCallback = function(resp, data, req) {
       isc.say(data.message);
     };
 
     // note it can make sense to make a process button class
     // which gets the name of the action handler to call
-    this.selectionButton.click = function () {
-      OB.RemoteCallManager.call(this.actionHandler, {
-        selectedRecords: this.selectionLayout.selectionGrid.getSelection()
-      }, {
-        // the _command parameter determines on the server side what 
-        // happens
-        '_command': 'execute'
-      }, buttonClickCallback);
+    this.selectionButton.click = function() {
+      OB.RemoteCallManager.call(
+        this.actionHandler,
+        {
+          selectedRecords: this.selectionLayout.selectionGrid.getSelection()
+        },
+        {
+          // the _command parameter determines on the server side what
+          // happens
+          _command: 'execute'
+        },
+        buttonClickCallback
+      );
     };
     this.selectionButton.actionHandler = this.actionHandler;
     this.Super('initWidget', arguments);
@@ -146,7 +160,7 @@
   },
 
   // disable or enable the button
-  selectionUpdated: function (selectedCount) {
+  selectionUpdated: function(selectedCount) {
     this.selectionButton.setDisabled(selectedCount === 0);
   }
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js	Wed Jun 12 10:59:13 2019 +0200
@@ -50,77 +50,87 @@
     //useClientSorting: false
   },
 
-  gridFields: [{
-    name: 'alertRule',
-    title: OB.I18N.getLabel('OBUIAPP_AlertGrid_AlertRule'),
-    displayField: OB.Constants.IDENTIFIER,
-    canFilter: true,
-    canEdit: false,
-    escapeHTML: true,
-    filterOnKeypress: true,
-    filterEditorType: 'OBFKFilterTextItem',
-    type: '_id_19'
-  }, {
-    name: 'description',
-    title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Alert'),
-    canFilter: true,
-    canEdit: false,
-    escapeHTML: true,
-    filterOnKeypress: true,
-    filterEditorType: 'OBTextItem',
-    type: '_id_10'
-  }, {
-    name: 'creationDate',
-    title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Time'),
-    canFilter: true,
-    canEdit: false,
-    filterEditorType: 'OBMiniDateRangeItem',
-    type: '_id_16'
-  }, {
-    name: 'comments',
-    title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Note'),
-    canFilter: true,
-    canEdit: true,
-    escapeHTML: true,
-    filterOnKeypress: true,
-    filterEditorType: 'OBTextItem',
-    editorType: 'OBTextItem',
-    editorProperties: {
-      width: '90%',
-      columnName: 'comments',
-      disabled: false,
-      updatable: true
+  gridFields: [
+    {
+      name: 'alertRule',
+      title: OB.I18N.getLabel('OBUIAPP_AlertGrid_AlertRule'),
+      displayField: OB.Constants.IDENTIFIER,
+      canFilter: true,
+      canEdit: false,
+      escapeHTML: true,
+      filterOnKeypress: true,
+      filterEditorType: 'OBFKFilterTextItem',
+      type: '_id_19'
     },
-    type: '_id_10'
-  }, {
-    name: 'recordID',
-    title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Record'),
-    canFilter: true,
-    canEdit: false,
-    escapeHTML: true,
-    clientClass: 'OBAlertGridCanvasItem_Link',
-    filterOnKeypress: true,
-    filterEditorType: 'OBTextItem',
-    type: '_id_10',
-    formatCellValueFunctionReplaced: true,
-    formatCellValue: function (value, record, rowNum, colNum, grid) {
-      return '';
+    {
+      name: 'description',
+      title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Alert'),
+      canFilter: true,
+      canEdit: false,
+      escapeHTML: true,
+      filterOnKeypress: true,
+      filterEditorType: 'OBTextItem',
+      type: '_id_10'
+    },
+    {
+      name: 'creationDate',
+      title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Time'),
+      canFilter: true,
+      canEdit: false,
+      filterEditorType: 'OBMiniDateRangeItem',
+      type: '_id_16'
+    },
+    {
+      name: 'comments',
+      title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Note'),
+      canFilter: true,
+      canEdit: true,
+      escapeHTML: true,
+      filterOnKeypress: true,
+      filterEditorType: 'OBTextItem',
+      editorType: 'OBTextItem',
+      editorProperties: {
+        width: '90%',
+        columnName: 'comments',
+        disabled: false,
+        updatable: true
+      },
+      type: '_id_10'
+    },
+    {
+      name: 'recordID',
+      title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Record'),
+      canFilter: true,
+      canEdit: false,
+      escapeHTML: true,
+      clientClass: 'OBAlertGridCanvasItem_Link',
+      filterOnKeypress: true,
+      filterEditorType: 'OBTextItem',
+      type: '_id_10',
+      formatCellValueFunctionReplaced: true,
+      formatCellValue: function(value, record, rowNum, colNum, grid) {
+        return '';
+      }
     }
-  }],
+  ],
 
-  initWidget: function () {
+  initWidget: function() {
     // added for showing counts in the filtereditor row
-    this.checkboxFieldProperties = isc.addProperties({}, this.checkboxFieldProperties || {}, {
-      canFilter: true,
-      //frozen: true, /* Removed due to issue https://issues.openbravo.com/view.php?id=17611 */
-      canFreeze: true,
-      showHover: true,
-      prompt: OB.I18N.getLabel('OBUIAPP_GridSelectAllColumnPrompt'),
-      filterEditorProperties: {
-        textAlign: 'center'
-      },
-      filterEditorType: 'StaticTextItem'
-    });
+    this.checkboxFieldProperties = isc.addProperties(
+      {},
+      this.checkboxFieldProperties || {},
+      {
+        canFilter: true,
+        //frozen: true, /* Removed due to issue https://issues.openbravo.com/view.php?id=17611 */
+        canFreeze: true,
+        showHover: true,
+        prompt: OB.I18N.getLabel('OBUIAPP_GridSelectAllColumnPrompt'),
+        filterEditorProperties: {
+          textAlign: 'center'
+        },
+        filterEditorType: 'StaticTextItem'
+      }
+    );
 
     this.contextMenu = this.getMenuConstructor().create({
       items: []
@@ -129,7 +139,7 @@
     this.Super('initWidget', arguments);
   },
 
-  destroy: function () {
+  destroy: function() {
     if (this.contextMenu) {
       this.contextMenu.destroy();
       this.contextMenu = null;
@@ -141,16 +151,18 @@
     this.Super('destroy', arguments);
   },
 
-  isScreenReaderPreferenceEnabled: function () {
+  isScreenReaderPreferenceEnabled: function() {
     return OB.PropertyStore.get('EnableScreenReader') === 'Y';
   },
 
-  setDataSource: function (ds) {
+  setDataSource: function(ds) {
     var i;
     if (this.isScreenReaderPreferenceEnabled()) {
       for (i = 0; i < this.gridFields.length; i++) {
         this.gridFields[i].filterEditorProperties = {
-          title: OB.I18N.getLabel('OBUIAPP_Filter_By_Column', [this.gridFields[i].title])
+          title: OB.I18N.getLabel('OBUIAPP_Filter_By_Column', [
+            this.gridFields[i].title
+          ])
         };
       }
     }
@@ -168,7 +180,7 @@
     this.fetchData();
   },
 
-  dataArrived: function (startRow, endRow) {
+  dataArrived: function(startRow, endRow) {
     this.getGridTotalRows();
     // we notify the data arrival so the view can check if the refresh button can be enabled
     if (this.isRefreshing) {
@@ -178,13 +190,13 @@
     return this.Super('dataArrived', arguments);
   },
 
-  getGridTotalRows: function () {
+  getGridTotalRows: function() {
     OB.AlertManagement.setTotalRows(this.getTotalRows(), this.alertStatus);
   },
 
-  getTotalRowsForAlert: function () {
+  getTotalRowsForAlert: function() {
     var criteria = this.getCriteria() || {},
-        requestProperties = {};
+      requestProperties = {};
 
     // fetch to the datasource with an empty criteria to get all the rows
     requestProperties.params = requestProperties.params || {};
@@ -194,12 +206,19 @@
     requestProperties.clientContext = {
       alertStatus: this.alertStatus
     };
-    this.dataSource.fetchData(criteria, function (dsResponse, data, dsRequest) {
-      OB.AlertManagement.setTotalRows(dsResponse.totalRows, dsResponse.clientContext.alertStatus);
-    }, requestProperties);
+    this.dataSource.fetchData(
+      criteria,
+      function(dsResponse, data, dsRequest) {
+        OB.AlertManagement.setTotalRows(
+          dsResponse.totalRows,
+          dsResponse.clientContext.alertStatus
+        );
+      },
+      requestProperties
+    );
   },
 
-  getFetchRequestParams: function (params) {
+  getFetchRequestParams: function(params) {
     // include alertStatus in the request in order to identify the grid being filtered
     // this allows to display the correct values on the Alert Rule filter drop-down
     params = params || {};
@@ -207,14 +226,14 @@
     return params;
   },
 
-  onFetchData: function (criteria, requestProperties) {
+  onFetchData: function(criteria, requestProperties) {
     requestProperties = requestProperties || {};
     requestProperties.params = requestProperties.params || {};
 
     requestProperties.params._alertStatus = this.alertStatus;
   },
 
-  headerClick: function (fieldNum, header, autoSaveDone) {
+  headerClick: function(fieldNum, header, autoSaveDone) {
     var field = this.fields[fieldNum];
     if (this.isCheckboxField(field) && this.singleRecordSelection) {
       this.deselectAllRecords();
@@ -223,14 +242,31 @@
     return this.Super('headerClick', arguments);
   },
 
-  recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue) {
-    this.handleRecordSelection(viewer, record, recordNum, field, fieldNum, value, rawValue, false, true);
+  recordClick: function(
+    viewer,
+    record,
+    recordNum,
+    field,
+    fieldNum,
+    value,
+    rawValue
+  ) {
+    this.handleRecordSelection(
+      viewer,
+      record,
+      recordNum,
+      field,
+      fieldNum,
+      value,
+      rawValue,
+      false,
+      true
+    );
   },
 
-
   // +++++++++++++++++++++++++++++ Record Selection Handling +++++++++++++++++++++++
   // Functions based on the ob-view-grid.js Record Selection Handling.
-  deselectAllRecords: function (preventUpdateSelectInfo, autoSaveDone) {
+  deselectAllRecords: function(preventUpdateSelectInfo, autoSaveDone) {
     this.allSelected = false;
     var ret = this.Super('deselectAllRecords', arguments);
     this.lastSelectedRecord = null;
@@ -240,14 +276,14 @@
     return ret;
   },
 
-  selectAllRecords: function (autoSaveDone) {
+  selectAllRecords: function(autoSaveDone) {
     this.allSelected = true;
     var ret = this.Super('selectAllRecords', arguments);
     this.selectionUpdated();
     return ret;
   },
 
-  updateSelectedCountDisplay: function () {
+  updateSelectedCountDisplay: function() {
     var selection = this.getSelection();
     var selectionLength = selection.getLength();
     var newValue = '&nbsp;';
@@ -255,7 +291,9 @@
       newValue = String(selectionLength);
     }
     if (this.filterEditor) {
-      this.filterEditor.getEditForm().setValue(this.getCheckboxField().name, newValue);
+      this.filterEditor
+        .getEditForm()
+        .setValue(this.getCheckboxField().name, newValue);
     }
   },
 
@@ -263,8 +301,7 @@
   // consider using the selectionChanged method, but that
   // one has as disadvantage that it is called multiple times
   // for one select/deselect action
-  selectionUpdated: function (record, recordList) {
-
+  selectionUpdated: function(record, recordList) {
     this.stopHover();
     this.updateSelectedCountDisplay();
     if (this.getSelectedRecords() && this.getSelectedRecords().length !== 1) {
@@ -274,10 +311,10 @@
     }
   },
 
-  selectOnMouseDown: function (record, recordNum, fieldNum, autoSaveDone) {
+  selectOnMouseDown: function(record, recordNum, fieldNum, autoSaveDone) {
     // don't change selection on right mouse down
     var EH = isc.EventHandler,
-        eventType;
+      eventType;
 
     // don't do anything if right-clicking on a selected record
     if (EH.rightButtonDown() && this.isSelected(record)) {
@@ -285,7 +322,7 @@
     }
 
     var previousSingleRecordSelection = this.singleRecordSelection;
-    var currentSelectedRecordSelected = (this.getSelectedRecord() === record);
+    var currentSelectedRecordSelected = this.getSelectedRecord() === record;
     if (this.getCheckboxFieldPosition() === fieldNum) {
       if (this.singleRecordSelection) {
         this.deselectAllRecords(true);
@@ -313,30 +350,58 @@
       // event is not captured anymore
       eventType = EH.getEventType();
       if (!EH.isMouseEvent(eventType)) {
-        this.handleRecordSelection(null, record, recordNum, null, fieldNum, null, null, true);
+        this.handleRecordSelection(
+          null,
+          record,
+          recordNum,
+          null,
+          fieldNum,
+          null,
+          null,
+          true
+        );
       }
     }
   },
 
-  handleRecordSelection: function (viewer, record, recordNum, field, fieldNum, value, rawValue, fromSelectOnMouseDown) {
+  handleRecordSelection: function(
+    viewer,
+    record,
+    recordNum,
+    field,
+    fieldNum,
+    value,
+    rawValue,
+    fromSelectOnMouseDown
+  ) {
     var EH = isc.EventHandler;
     var keyName = EH.getKey();
 
     // do nothing, click in the editrow itself
-    if ((this.getEditRow() || this.getEditRow() === 0) && this.getEditRow() === recordNum) {
+    if (
+      (this.getEditRow() || this.getEditRow() === 0) &&
+      this.getEditRow() === recordNum
+    ) {
       return;
     }
 
     // if the arrow key was pressed and no ctrl/shift pressed then
     // go to single select mode
-    var arrowKeyPressed = keyName && (keyName === isc.OBViewGrid.ARROW_UP_KEY_NAME || keyName === isc.OBViewGrid.ARROW_DOWN_KEY_NAME);
+    var arrowKeyPressed =
+      keyName &&
+      (keyName === isc.OBViewGrid.ARROW_UP_KEY_NAME ||
+        keyName === isc.OBViewGrid.ARROW_DOWN_KEY_NAME);
 
     var previousSingleRecordSelection = this.singleRecordSelection;
     if (arrowKeyPressed) {
-      if ((EH.ctrlKeyDown() && !EH.altKeyDown() && !EH.shiftKeyDown()) || (!EH.ctrlKeyDown() && !EH.altKeyDown() && EH.shiftKeyDown())) {
+      if (
+        (EH.ctrlKeyDown() && !EH.altKeyDown() && !EH.shiftKeyDown()) ||
+        (!EH.ctrlKeyDown() && !EH.altKeyDown() && EH.shiftKeyDown())
+      ) {
         // move to multi-select mode, let the standard do it for us
         this.singleRecordSelection = false;
-      } else if (!(!EH.ctrlKeyDown() && EH.altKeyDown() && EH.shiftKeyDown())) { // 'if' statement to avoid do an action when the KS to move to a child tab is fired
+      } else if (!(!EH.ctrlKeyDown() && EH.altKeyDown() && EH.shiftKeyDown())) {
+        // 'if' statement to avoid do an action when the KS to move to a child tab is fired
         this.doSelectSingleRecord(record);
       }
     } else if (this.getCheckboxFieldPosition() === fieldNum) {
@@ -347,7 +412,11 @@
       // in the selectOnMouseDown
       this.singleRecordSelection = false;
       this.selectionUpdated();
-    } else if (isc.EventHandler.ctrlKeyDown() && !isc.EventHandler.altKeyDown() && !isc.EventHandler.shiftKeyDown()) {
+    } else if (
+      isc.EventHandler.ctrlKeyDown() &&
+      !isc.EventHandler.altKeyDown() &&
+      !isc.EventHandler.shiftKeyDown()
+    ) {
       // only do something if record clicked and not from selectOnMouseDown
       // this method got called twice from one clicK: through recordClick
       // and
@@ -361,7 +430,11 @@
           this.selectRecord(record);
         }
       }
-    } else if (!isc.EventHandler.ctrlKeyDown() && !isc.EventHandler.altKeyDown() && isc.EventHandler.shiftKeyDown()) {
+    } else if (
+      !isc.EventHandler.ctrlKeyDown() &&
+      !isc.EventHandler.altKeyDown() &&
+      isc.EventHandler.shiftKeyDown()
+    ) {
       this.singleRecordSelection = false;
       this.selection.selectOnMouseDown(this, recordNum, fieldNum);
     } else {
@@ -383,12 +456,16 @@
   //  this.Super('selectRecordForEdit', arguments);
   //  this.doSelectSingleRecord(record);
   //},
-  doSelectSingleRecord: function (record) {
+  doSelectSingleRecord: function(record) {
     // if this record is already selected and the only one then do nothing
     // note that when navigating with the arrow key that at a certain 2 are
     // selected
     // when going into this method therefore the extra check on length === 1
-    if (this.singleRecordSelection && this.getSelectedRecord() === record && this.getSelection().length === 1) {
+    if (
+      this.singleRecordSelection &&
+      this.getSelectedRecord() === record &&
+      this.getSelection().length === 1
+    ) {
       return;
     }
     this.singleRecordSelection = true;
@@ -396,7 +473,7 @@
 
     // deselect the checkbox in the top
     var fieldNum = this.getCheckboxFieldPosition(),
-        field = this.fields[fieldNum];
+      field = this.fields[fieldNum];
     var icon = this.checkboxFieldFalseImage || this.booleanFalseImage;
     var title = this.getValueIconHTML(icon, field);
 
@@ -404,7 +481,7 @@
   },
 
   // overridden to prevent the checkbox to be shown when only one record is selected.
-  getCellValue: function (record, recordNum, fieldNum, gridBody) {
+  getCellValue: function(record, recordNum, fieldNum, gridBody) {
     var field = this.fields[fieldNum];
     if (!field || this.allSelected) {
       return this.Super('getCellValue', arguments);
@@ -419,11 +496,13 @@
         icon = '[SKINIMG]/blank.gif';
       } else if (this.singleRecordSelection && !this.allSelected) {
         // always show the false image
-        icon = (this.checkboxFieldFalseImage || this.booleanFalseImage);
+        icon = this.checkboxFieldFalseImage || this.booleanFalseImage;
       } else {
         // checked if selected, otherwise unchecked
         var isSel = this.selection.isSelected(record) ? true : false;
-        icon = isSel ? (this.checkboxFieldTrueImage || this.booleanTrueImage) : (this.checkboxFieldFalseImage || this.booleanFalseImage);
+        icon = isSel
+          ? this.checkboxFieldTrueImage || this.booleanTrueImage
+          : this.checkboxFieldFalseImage || this.booleanFalseImage;
       }
       // if the record is disabled, make the checkbox image disabled as well
       // or if the record is new then also show disabled
@@ -439,12 +518,12 @@
     }
   },
 
-  getSelectedRecords: function () {
+  getSelectedRecords: function() {
     return this.getSelection();
   },
   // ++++++++++++++ end of Record Selection handling ++++++++++++++
   // overridden to support hover on the header for the checkbox field
-  setFieldProperties: function (field, properties) {
+  setFieldProperties: function(field, properties) {
     var localField = field;
     if (isc.isA.Number(localField)) {
       localField = this.fields[localField];
@@ -457,37 +536,54 @@
     return this.Super('setFieldProperties', arguments);
   },
 
-  cellHoverHTML: function (record, rowNum, colNum) {
+  cellHoverHTML: function(record, rowNum, colNum) {
     var field = this.getField(colNum);
     if (this.isCheckboxField(field)) {
       return OB.I18N.getLabel('OBUIAPP_GridSelectColumnPrompt');
     }
   },
 
-  makeCellContextItems: function (record, rowNum, colNum) {
+  makeCellContextItems: function(record, rowNum, colNum) {
     var menuItems = [];
     var grid = this;
-    if (grid.alertStatus === 'Acknowledged' || grid.alertStatus === 'Suppressed') {
+    if (
+      grid.alertStatus === 'Acknowledged' ||
+      grid.alertStatus === 'Suppressed'
+    ) {
       menuItems.add({
-        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', [OB.AlertManagement.translatedStatus.New]),
-        click: function () {
+        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', [
+          OB.AlertManagement.translatedStatus.New
+        ]),
+        click: function() {
           OB.AlertManagement.moveToStatus(record.id, grid.alertStatus, 'New');
         }
       });
     }
     if (grid.alertStatus === 'New' || grid.alertStatus === 'Suppressed') {
       menuItems.add({
-        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', [OB.AlertManagement.translatedStatus.Acknowledged]),
-        click: function () {
-          OB.AlertManagement.moveToStatus(record.id, grid.alertStatus, 'Acknowledged');
+        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', [
+          OB.AlertManagement.translatedStatus.Acknowledged
+        ]),
+        click: function() {
+          OB.AlertManagement.moveToStatus(
+            record.id,
+            grid.alertStatus,
+            'Acknowledged'
+          );
         }
       });
     }
     if (grid.alertStatus === 'New' || grid.alertStatus === 'Acknowledged') {
       menuItems.add({
-        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', [OB.AlertManagement.translatedStatus.Suppressed]),
-        click: function () {
-          OB.AlertManagement.moveToStatus(record.id, grid.alertStatus, 'Suppressed');
+        title: OB.I18N.getLabel('OBUIAPP_MoveToStatus', [
+          OB.AlertManagement.translatedStatus.Suppressed
+        ]),
+        click: function() {
+          OB.AlertManagement.moveToStatus(
+            record.id,
+            grid.alertStatus,
+            'Suppressed'
+          );
         }
       });
     }
@@ -502,7 +598,7 @@
   // https://issues.openbravo.com/view.php?id=17289
   // https://issues.openbravo.com/view.php?id=17784
   firstTimeRedrawCalled: true,
-  draw: function () {
+  draw: function() {
     if (this.firstTimeRedrawCalled && this.showRecordComponents) {
       this.showRecordComponents = false;
       this.Super('draw', arguments);
@@ -514,19 +610,32 @@
     delete this.firstTimeRedrawCalled;
     this.Super('draw', arguments);
   }
-
 });
 
 isc.defineClass('OBAlertGridCanvasItem_Link', isc.OBGridLinkItem);
 
 isc.OBAlertGridCanvasItem_Link.addProperties({
-  setRecord: function () {
-    this.setTitle(this.grid.formatLinkValue(this.record, this.field, this.colNum, this.rowNum, this.record[this.field.name]));
+  setRecord: function() {
+    this.setTitle(
+      this.grid.formatLinkValue(
+        this.record,
+        this.field,
+        this.colNum,
+        this.rowNum,
+        this.record[this.field.name]
+      )
+    );
   },
-  doAction: function () {
-    var tabId = this.record['alertRule' + OB.Constants.FIELDSEPARATOR + 'tab' + OB.Constants.FIELDSEPARATOR + OB.Constants.ID];
+  doAction: function() {
+    var tabId = this.record[
+      'alertRule' +
+        OB.Constants.FIELDSEPARATOR +
+        'tab' +
+        OB.Constants.FIELDSEPARATOR +
+        OB.Constants.ID
+    ];
     if (tabId && tabId !== '') {
       OB.Utilities.openDirectTab(tabId, this.record.referenceSearchKey);
     }
   }
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js	Wed Jun 12 10:59:13 2019 +0200
@@ -20,21 +20,23 @@
 isc.ClassFactory.defineClass('OBUIAPP_AlertManagement', isc.VLayout);
 isc.OBUIAPP_AlertManagement.addProperties({
   // Allow only one instance of the view.
-  isSameTab: function (viewId, params) {
+  isSameTab: function(viewId, params) {
     return viewId === 'OBUIAPP_AlertManagement';
   },
-  getBookMarkParams: function () {
+  getBookMarkParams: function() {
     var result = {};
     result.viewId = 'OBUIAPP_AlertManagement';
     return result;
   },
 
-  createAlertDataSource: function () {
+  createAlertDataSource: function() {
     return OB.Datasource.create({
       createClassName: '',
       ID: 'DB9F062472294F12A0291A7BD203F922' + '_' + new Date().getTime(),
       potentiallyShared: true,
-      dataURL: OB.Utilities.applicationUrl('org.openbravo.service.datasource/DB9F062472294F12A0291A7BD203F922'),
+      dataURL: OB.Utilities.applicationUrl(
+        'org.openbravo.service.datasource/DB9F062472294F12A0291A7BD203F922'
+      ),
       requestProperties: {
         params: {
           _contextUrl: OB.Utilities.getLocationUrlWithoutFragment(),
@@ -45,26 +47,33 @@
           _create: 'true'
         }
       },
-      fields: [{
-        name: 'id',
-        type: '_id_13',
-        primaryKey: true
-      }, {
-        name: 'creationDate',
-        type: '_id_16'
-      }, {
-        name: 'description',
-        type: '_id_14'
-      }, {
-        name: 'alertRule',
-        type: '_id_19'
-      }, {
-        name: 'comments',
-        type: '_id_14'
-      }, {
-        name: 'recordID',
-        type: '_id_10'
-      }]
+      fields: [
+        {
+          name: 'id',
+          type: '_id_13',
+          primaryKey: true
+        },
+        {
+          name: 'creationDate',
+          type: '_id_16'
+        },
+        {
+          name: 'description',
+          type: '_id_14'
+        },
+        {
+          name: 'alertRule',
+          type: '_id_19'
+        },
+        {
+          name: 'comments',
+          type: '_id_14'
+        },
+        {
+          name: 'recordID',
+          type: '_id_10'
+        }
+      ]
     });
   },
 
@@ -85,40 +94,64 @@
   SuppressedNew: null,
   SuppressedAcknowledged: null,
 
-  initWidget: function () {
+  initWidget: function() {
     OB.AlertManagement = this;
-    OB.I18N.getLabel('AlertStatus_New', null, {
-      setTranslatedStatus: function (label) {
-        OB.AlertManagement.translatedStatus.New = label;
-        OB.AlertManagement.checkInitializeStatus();
-      }
-    }, 'setTranslatedStatus');
-    OB.I18N.getLabel('AlertStatus_Acknowledged', null, {
-      setTranslatedStatus: function (label) {
-        OB.AlertManagement.translatedStatus.Acknowledged = label;
-        OB.AlertManagement.checkInitializeStatus();
-      }
-    }, 'setTranslatedStatus');
-    OB.I18N.getLabel('AlertStatus_Suppressed', null, {
-      setTranslatedStatus: function (label) {
-        OB.AlertManagement.translatedStatus.Suppressed = label;
-        OB.AlertManagement.checkInitializeStatus();
-      }
-    }, 'setTranslatedStatus');
-    OB.I18N.getLabel('AlertStatus_Solved', null, {
-      setTranslatedStatus: function (label) {
-        OB.AlertManagement.translatedStatus.Solved = label;
-        OB.AlertManagement.checkInitializeStatus();
-      }
-    }, 'setTranslatedStatus');
+    OB.I18N.getLabel(
+      'AlertStatus_New',
+      null,
+      {
+        setTranslatedStatus: function(label) {
+          OB.AlertManagement.translatedStatus.New = label;
+          OB.AlertManagement.checkInitializeStatus();
+        }
+      },
+      'setTranslatedStatus'
+    );
+    OB.I18N.getLabel(
+      'AlertStatus_Acknowledged',
+      null,
+      {
+        setTranslatedStatus: function(label) {
+          OB.AlertManagement.translatedStatus.Acknowledged = label;
+          OB.AlertManagement.checkInitializeStatus();
+        }
+      },
+      'setTranslatedStatus'
+    );
+    OB.I18N.getLabel(
+      'AlertStatus_Suppressed',
+      null,
+      {
+        setTranslatedStatus: function(label) {
+          OB.AlertManagement.translatedStatus.Suppressed = label;
+          OB.AlertManagement.checkInitializeStatus();
+        }
+      },
+      'setTranslatedStatus'
+    );
+    OB.I18N.getLabel(
+      'AlertStatus_Solved',
+      null,
+      {
+        setTranslatedStatus: function(label) {
+          OB.AlertManagement.translatedStatus.Solved = label;
+          OB.AlertManagement.checkInitializeStatus();
+        }
+      },
+      'setTranslatedStatus'
+    );
 
-    this.refreshButton = isc.OBToolbarIconButton.create(isc.OBToolbar.REFRESH_BUTTON_PROPERTIES);
+    this.refreshButton = isc.OBToolbarIconButton.create(
+      isc.OBToolbar.REFRESH_BUTTON_PROPERTIES
+    );
 
-    this.addMember(isc.OBToolbar.create({
-      view: this,
-      leftMembers: [this.refreshButton],
-      rightMembers: []
-    }));
+    this.addMember(
+      isc.OBToolbar.create({
+        view: this,
+        leftMembers: [this.refreshButton],
+        rightMembers: []
+      })
+    );
 
     this.sectionStack = isc.OBSectionStack.create();
     this.addMember(this.sectionStack);
@@ -127,25 +160,31 @@
     OB.AlertManagement.checkInitializeStatus();
   },
 
-  tabSelected: function (tabNum, tabPane, ID, tab) {
+  tabSelected: function(tabNum, tabPane, ID, tab) {
     if (OB.AlertManagement.grids.New) {
       // TODO: Add a more sophisticated focus logic to ensure each time the Alert Management is selected,
       // the previous focused item is selected instead of the first grid filter editor
-      setTimeout(function () {
+      setTimeout(function() {
         OB.AlertManagement.grids.New.focusInFirstFilterEditor();
       }, 10);
     }
   },
 
-  checkInitializeStatus: function () {
-    if (OB.AlertManagement.translatedStatus.New !== '' && OB.AlertManagement.translatedStatus.Acknowledged !== '' && OB.AlertManagement.translatedStatus.Suppressed !== '' && OB.AlertManagement.translatedStatus.Solved !== '' && OB.AlertManagement.sectionStack) {
+  checkInitializeStatus: function() {
+    if (
+      OB.AlertManagement.translatedStatus.New !== '' &&
+      OB.AlertManagement.translatedStatus.Acknowledged !== '' &&
+      OB.AlertManagement.translatedStatus.Suppressed !== '' &&
+      OB.AlertManagement.translatedStatus.Solved !== '' &&
+      OB.AlertManagement.sectionStack
+    ) {
       // Sections are created after status translations are set.
       // This is needed to be able to filter properly the grids of the sections.
       OB.AlertManagement.createSections();
     }
   },
 
-  createSections: function () {
+  createSections: function() {
     this.grids.New = isc.OBAlertGrid.create({
       alertStatus: 'New'
     });
@@ -230,7 +269,7 @@
     this.grids.Solved.setDataSource(this.createAlertDataSource());
   },
 
-  destroy: function () {
+  destroy: function() {
     if (this.grids) {
       if (this.grids.New) {
         this.grids.New.destroy();
@@ -276,40 +315,57 @@
     this.Super('destroy', arguments);
   },
 
-  moveToStatus: function (alertIDs, oldStatus, newStatus) {
+  moveToStatus: function(alertIDs, oldStatus, newStatus) {
     var post = {
-      'eventType': 'moveToStatus',
-      'oldStatus': oldStatus,
-      'newStatus': newStatus,
-      'alertIDs': alertIDs
+      eventType: 'moveToStatus',
+      oldStatus: oldStatus,
+      newStatus: newStatus,
+      alertIDs: alertIDs
     };
 
     // persist not saved editions before moving
     this.grids[oldStatus].saveAllEdits();
 
-    OB.RemoteCallManager.call('org.openbravo.client.application.AlertManagementActionHandler', post, {}, function (rpcResponse, data, rpcRequest) {
-      OB.AlertManagement.grids[data.newStatus].invalidateCache();
-      // If section has not been expanded the grid is not reloaded so the total rows is not updated.
-      if (!OB.AlertManagement.sections[data.newStatus].expanded) {
-        OB.AlertManagement.grids[data.newStatus].getGridTotalRows();
+    OB.RemoteCallManager.call(
+      'org.openbravo.client.application.AlertManagementActionHandler',
+      post,
+      {},
+      function(rpcResponse, data, rpcRequest) {
+        OB.AlertManagement.grids[data.newStatus].invalidateCache();
+        // If section has not been expanded the grid is not reloaded so the total rows is not updated.
+        if (!OB.AlertManagement.sections[data.newStatus].expanded) {
+          OB.AlertManagement.grids[data.newStatus].getGridTotalRows();
+        }
+        // Old status is always expanded to be able to select the rows
+        OB.AlertManagement.grids[data.oldStatus].invalidateCache();
+        OB.AlertManager.call();
       }
-      // Old status is always expanded to be able to select the rows
-      OB.AlertManagement.grids[data.oldStatus].invalidateCache();
-      OB.AlertManager.call();
-    });
+    );
   },
 
-  setTotalRows: function (totalRows, status) {
+  setTotalRows: function(totalRows, status) {
     if (OB.AlertManagement.sections[status]) {
-      if (OB.AlertManagement.grids[status] && OB.AlertManagement.grids[status].dataPageSize < totalRows) {
+      if (
+        OB.AlertManagement.grids[status] &&
+        OB.AlertManagement.grids[status].dataPageSize < totalRows
+      ) {
         totalRows = '>' + OB.AlertManagement.grids[status].dataPageSize;
       }
-      OB.AlertManagement.sections[status].getSectionHeader().setTitle(OB.I18N.getLabel('OBUIAPP_AlertSectionHeader', [OB.AlertManagement.translatedStatus[status], totalRows]));
+      OB.AlertManagement.sections[status]
+        .getSectionHeader()
+        .setTitle(
+          OB.I18N.getLabel('OBUIAPP_AlertSectionHeader', [
+            OB.AlertManagement.translatedStatus[status],
+            totalRows
+          ])
+        );
     }
   },
 
-  refresh: function () {
-    var i, section, alertStatus = ['New', 'Acknowledged', 'Suppressed', 'Solved'];
+  refresh: function() {
+    var i,
+      section,
+      alertStatus = ['New', 'Acknowledged', 'Suppressed', 'Solved'];
     for (i = 0; i < 4; i++) {
       OB.AlertManagement.grids[alertStatus[i]].invalidateCache();
       section = OB.AlertManagement.sections[alertStatus[i]];
@@ -323,8 +379,9 @@
     }
   },
 
-  notifyRefreshEnd: function () {
-    var i, alertStatus = ['New', 'Acknowledged', 'Suppressed', 'Solved'];
+  notifyRefreshEnd: function() {
+    var i,
+      alertStatus = ['New', 'Acknowledged', 'Suppressed', 'Solved'];
     for (i = 0; i < 4; i++) {
       if (OB.AlertManagement.grids[alertStatus[i]].isRefreshing) {
         return;
@@ -337,20 +394,32 @@
   }
 });
 
-isc.ClassFactory.defineClass('OBAlertSectionStackControl', isc.OBLinkButtonItem);
+isc.ClassFactory.defineClass(
+  'OBAlertSectionStackControl',
+  isc.OBLinkButtonItem
+);
 isc.OBAlertSectionStackControl.addProperties({
   newStatus: null,
   currentStatus: null,
 
-  initWidget: function () {
-    this.setTitle("[ " + OB.I18N.getLabel('OBUIAPP_MoveSelectedToStatus', [OB.AlertManagement.translatedStatus[this.newStatus]]) + " ]");
+  initWidget: function() {
+    this.setTitle(
+      '[ ' +
+        OB.I18N.getLabel('OBUIAPP_MoveSelectedToStatus', [
+          OB.AlertManagement.translatedStatus[this.newStatus]
+        ]) +
+        ' ]'
+    );
     this.Super('initWidget', arguments);
   },
 
-  action: function () {
-    var i, alerts = '',
-        selectedAlerts = OB.AlertManagement.grids[this.currentStatus].getSelection(),
-        selAlertsLength = selectedAlerts.length;
+  action: function() {
+    var i,
+      alerts = '',
+      selectedAlerts = OB.AlertManagement.grids[
+        this.currentStatus
+      ].getSelection(),
+      selAlertsLength = selectedAlerts.length;
     if (selAlertsLength === 0) {
       return;
     }
@@ -362,4 +431,4 @@
     }
     OB.AlertManagement.moveToStatus(alerts, this.currentStatus, this.newStatus);
   }
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-manager.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-manager.js	Wed Jun 12 10:59:13 2019 +0200
@@ -22,12 +22,11 @@
 // - OBAlertIcon: is the alert icon shown in the navigation bar
 // = Alert Manager =
 //
-// The Alert manager calls the server at preset intervals (50 secs) to obtain the current list 
+// The Alert manager calls the server at preset intervals (50 secs) to obtain the current list
 // of alerts and to update the server side session administration.
 // The Alert manager makes use of OB.RemoteCallManager to make these remote calls.
 //
-(function (OB, isc) {
-
+(function(OB, isc) {
   if (!OB || !isc) {
     throw {
       name: 'ReferenceError',
@@ -38,7 +37,6 @@
   function AlertManager() {}
 
   AlertManager.prototype = {
-
     // array of functions which are called when an alert is received
     // from the server.
     listeners: [],
@@ -59,7 +57,7 @@
     // Parameters:
     // * {{{listener}}}: a function which is called when a new alert result is
     // received.
-    addListener: function (listener) {
+    addListener: function(listener) {
       this.listeners[this.listeners.length] = listener;
       if (this.lastResponse) {
         // call the listener once with the last data
@@ -67,8 +65,9 @@
       }
     },
 
-    _notify: function (rpcResponse, data, rpcRequest) {
-      var i, length = OB.AlertManager.listeners.length;
+    _notify: function(rpcResponse, data, rpcRequest) {
+      var i,
+        length = OB.AlertManager.listeners.length;
       // store info for new listeners
       OB.AlertManager.lastResponse = rpcResponse;
       OB.AlertManager.lastData = data;
@@ -79,21 +78,26 @@
       OB.AlertManager.schedule();
     },
 
-    schedule: function () {
+    schedule: function() {
       isc.Timer.setTimeout(OB.AlertManager.call, OB.AlertManager.delay);
     },
 
-    call: function () {
+    call: function() {
       if (OB.User && OB.User.loggingIn) {
         // do not perform requests while logging in
         OB.AlertManager.schedule();
         return;
       }
 
-      OB.RemoteCallManager.call('org.openbravo.client.application.AlertActionHandler', {}, {
-        IsAjaxCall: '1',
-        ignoreForSessionTimeout: '1'
-      }, OB.AlertManager._notify);
+      OB.RemoteCallManager.call(
+        'org.openbravo.client.application.AlertActionHandler',
+        {},
+        {
+          IsAjaxCall: '1',
+          ignoreForSessionTimeout: '1'
+        },
+        OB.AlertManager._notify
+      );
     }
   };
 
@@ -103,7 +107,7 @@
 
   // call it ones to update the pings and start the timer
   OB.AlertManager.call();
-}(OB, isc));
+})(OB, isc);
 
 isc.ClassFactory.defineClass('OBAlertIcon', isc.ImgButton);
 
@@ -116,11 +120,11 @@
 isc.OBAlertIcon.addProperties({
   showInPortal: false,
 
-  initWidget: function () {
+  initWidget: function() {
     var instance = this,
-        listener;
+      listener;
 
-    listener = function (rpcResponse, data, rpcRequest) {
+    listener = function(rpcResponse, data, rpcRequest) {
       if (data.cnt > 0) {
         OB.I18N.getLabel(instance.alertLabel, [data.cnt], instance, 'setTitle');
         instance.setIcon(instance.alertIcon);
@@ -137,10 +141,13 @@
 
     // call it to update the number of alerts directly after login
     OB.AlertManager.addListener(listener);
-    OB.TestRegistry.register('org.openbravo.client.application.AlertButton', this);
+    OB.TestRegistry.register(
+      'org.openbravo.client.application.AlertButton',
+      this
+    );
   },
 
-  click: function () {
+  click: function() {
     var viewDefinition = {
       i18nTabTitle: 'UINAVBA_AlertManagement'
     };
@@ -149,17 +156,21 @@
 
   keyboardShortcutId: 'NavBar_OBAlertIcon',
 
-  draw: function () {
+  draw: function() {
     var me = this,
-        ksAction;
+      ksAction;
 
-    ksAction = function () {
+    ksAction = function() {
       me.click();
       return false; //To avoid keyboard shortcut propagation
     };
 
     if (this.keyboardShortcutId) {
-      OB.KeyboardManager.Shortcuts.set(this.keyboardShortcutId, 'Canvas', ksAction);
+      OB.KeyboardManager.Shortcuts.set(
+        this.keyboardShortcutId,
+        'Canvas',
+        ksAction
+      );
     }
     this.Super('draw', arguments);
   },
@@ -168,4 +179,4 @@
   showTitle: true,
   src: '',
   overflow: 'visible'
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-calendar.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-calendar.js	Wed Jun 12 10:59:13 2019 +0200
@@ -17,20 +17,19 @@
  ************************************************************************
  */
 
-
 // == OBCalendar_EventDialogBridge ==
 // Hack to allow the OBCalendar open its own full customizable EventDialog (OBEventEditor)
 isc.ClassFactory.defineClass('OBCalendar_EventDialogBridge', isc.Window);
 
 isc.OBCalendar_EventDialogBridge.addProperties({
-  show: function () {
+  show: function() {
     this.Super('show', arguments);
 
     var calendar = this.creator,
-        currentStart = this.currentStart,
-        currentEnd = this.currentEnd,
-        currentLane = this.currentLane,
-        event = this.event;
+      currentStart = this.currentStart,
+      currentEnd = this.currentEnd,
+      currentLane = this.currentLane,
+      event = this.event;
 
     if (calendar.OBEventEditor) {
       calendar.OBEventEditor.setProperties({
@@ -51,21 +50,19 @@
 // Hack to allow calendar TabSet style personalization
 isc.ClassFactory.defineClass('OBCalendarTabSet', isc.TabSet);
 
-
 // == OBClientClassCanvasItem ==
 // Extends Calendar, with some customizations (most of them styling related)
 isc.ClassFactory.defineClass('OBCalendar', isc.Calendar);
 
-
 isc.OBCalendar.addProperties({
   autoFetchData: true,
   mainViewConstructor: isc.OBCalendarTabSet,
   useEventCanvasRolloverControls: false,
   eventDialogConstructor: isc.OBCalendar_EventDialogBridge,
   eventsAdaptationRequired: true,
-  initWidget: function () {
+  initWidget: function() {
     var calendar = this,
-        multiCalendar = this.multiCalendar;
+      multiCalendar = this.multiCalendar;
 
     if (!this.eventIdField) {
       this.eventIdField = 'eventId';
@@ -80,14 +77,18 @@
       this.OBEventEditor = isc[this.OBEventEditorClass].create({});
     }
 
-    this.adaptEvents = function (events) {
+    this.adaptEvents = function(events) {
       var i, j;
       for (i = 0; i < events.getLength(); i++) {
         if (typeof events[i][calendar.startDateField] === 'string') {
-          events[i][calendar.startDateField] = new Date(events[i][calendar.startDateField]);
+          events[i][calendar.startDateField] = new Date(
+            events[i][calendar.startDateField]
+          );
         }
         if (typeof events[i][calendar.endDateField] === 'string') {
-          events[i][calendar.endDateField] = new Date(events[i][calendar.endDateField]);
+          events[i][calendar.endDateField] = new Date(
+            events[i][calendar.endDateField]
+          );
         }
         if (typeof events[i][calendar.nameField] === 'undefined') {
           //To avoid the event displays 'undefined' when no name has been set
@@ -97,15 +98,31 @@
           events[i][calendar.descriptionField] = '';
         }
         if (multiCalendar && multiCalendar.showCustomEventsBgColor) {
-          events[i].eventWindowStyle = multiCalendar.eventStyles[events[i][calendar.legendIdField]] + ' ' + calendar.eventWindowStyle;
+          events[i].eventWindowStyle =
+            multiCalendar.eventStyles[events[i][calendar.legendIdField]] +
+            ' ' +
+            calendar.eventWindowStyle;
         }
         if (typeof calendar.customTransformResponse === 'function') {
           events[i] = calendar.customTransformResponse(events[i], calendar);
         }
         if (multiCalendar && multiCalendar.calendarData.hasCustomFilters) {
-          for (j = 0; j < multiCalendar.calendarData.customFilters.length; j++) {
-            if (typeof multiCalendar.calendarData.customFilters[j].handler.transformResponse === 'function') {
-              events[i] = multiCalendar.calendarData.customFilters[j].handler.transformResponse(events[i], calendar, multiCalendar.calendarData.customFilters[j]);
+          for (
+            j = 0;
+            j < multiCalendar.calendarData.customFilters.length;
+            j++
+          ) {
+            if (
+              typeof multiCalendar.calendarData.customFilters[j].handler
+                .transformResponse === 'function'
+            ) {
+              events[i] = multiCalendar.calendarData.customFilters[
+                j
+              ].handler.transformResponse(
+                events[i],
+                calendar,
+                multiCalendar.calendarData.customFilters[j]
+              );
             }
           }
         }
@@ -121,48 +138,63 @@
     if (this.dataSourceProps) {
       this.dataSource = OB.Datasource.create({
         dataURL: this.dataSourceProps.dataURL,
-        fields: [{
-          name: this.eventIdField,
-          primaryKey: true
-        }, {
-          name: this.nameField
-        }, {
-          name: this.descriptionField
-        }, {
-          name: this.startDateField,
-          type: "datetime"
-        }, {
-          name: this.endDateField,
-          type: "datetime"
-        }],
+        fields: [
+          {
+            name: this.eventIdField,
+            primaryKey: true
+          },
+          {
+            name: this.nameField
+          },
+          {
+            name: this.descriptionField
+          },
+          {
+            name: this.startDateField,
+            type: 'datetime'
+          },
+          {
+            name: this.endDateField,
+            type: 'datetime'
+          }
+        ],
 
         // these are read extra from the server with the events
         additionalProperties: this.dataSourceProps.additionalProperties,
 
         dataSourceProps: this.dataSourceProps,
 
-        transformRequest: function (dsRequest) {
+        transformRequest: function(dsRequest) {
           dsRequest.params = dsRequest.params || {};
           dsRequest.params._extraProperties = this.additionalProperties;
           dsRequest.willHandleError = true;
 
           return this.Super('transformRequest', arguments);
         },
-        transformResponse: function (dsResponse, dsRequest, data) {
-          var showDSAlert, records = data && data.response && data.response.data;
+        transformResponse: function(dsResponse, dsRequest, data) {
+          var showDSAlert,
+            records = data && data.response && data.response.data;
 
-          showDSAlert = function (text) {
+          showDSAlert = function(text) {
             if (calendar.OBEventEditor && calendar.OBEventEditor.messageBar) {
               // Display message in event editor
-              calendar.OBEventEditor.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, OB.I18N.getLabel('OBUIAPP_Error'), text);
+              calendar.OBEventEditor.messageBar.setMessage(
+                isc.OBMessageBar.TYPE_ERROR,
+                OB.I18N.getLabel('OBUIAPP_Error'),
+                text
+              );
             } else {
               // there is no message bar in editor, showing a popup warn
-              isc.warn(text, function () {
-                return true;
-              }, {
-                icon: '[SKINIMG]Dialog/error.png',
-                title: OB.I18N.getLabel('OBUIAPP_Error')
-              });
+              isc.warn(
+                text,
+                function() {
+                  return true;
+                },
+                {
+                  icon: '[SKINIMG]Dialog/error.png',
+                  title: OB.I18N.getLabel('OBUIAPP_Error')
+                }
+              );
             }
             if (calendar.OBEventEditor) {
               // needs to keep the popup open once, because data is refreshed
@@ -192,9 +224,9 @@
         // override the addData, updateData and removeData to wrap
         // the calendar callback to prevent adding events in cased
         // of errors
-        addData: function (newRecord, callback, requestProperties) {
+        addData: function(newRecord, callback, requestProperties) {
           var dataSourceProps = this.dataSourceProps,
-              newCallBack = function (dsResponse, data, dsRequest) {
+            newCallBack = function(dsResponse, data, dsRequest) {
               // don't call if there is an error
               if (dsResponse.status < 0) {
                 return;
@@ -203,37 +235,54 @@
               if (dataSourceProps.addEventCallback) {
                 dataSourceProps.addEventCallback(newRecord, requestProperties);
               }
-              };
-          return this.Super('addData', [newRecord, newCallBack, requestProperties]);
+            };
+          return this.Super('addData', [
+            newRecord,
+            newCallBack,
+            requestProperties
+          ]);
         },
-        updateData: function (updatedRecord, callback, requestProperties) {
+        updateData: function(updatedRecord, callback, requestProperties) {
           var dataSourceProps = this.dataSourceProps,
-              newCallBack = function (dsResponse, data, dsRequest) {
+            newCallBack = function(dsResponse, data, dsRequest) {
               // don't call if there is an error
               if (dsResponse.status < 0) {
                 return;
               }
               callback(dsResponse, data, dsRequest);
               if (dataSourceProps.updateEventCallback) {
-                dataSourceProps.updateEventCallback(updatedRecord, requestProperties);
+                dataSourceProps.updateEventCallback(
+                  updatedRecord,
+                  requestProperties
+                );
               }
-              };
+            };
           return this.Super('updateData', [
-          updatedRecord, newCallBack, requestProperties]);
+            updatedRecord,
+            newCallBack,
+            requestProperties
+          ]);
         },
-        removeData: function (recordKeys, callback, requestProperties) {
+        removeData: function(recordKeys, callback, requestProperties) {
           var dataSourceProps = this.dataSourceProps,
-              newCallBack = function (dsResponse, data, dsRequest) {
+            newCallBack = function(dsResponse, data, dsRequest) {
               // don't call if there is an error
               if (dsResponse.status < 0) {
                 return;
               }
               callback(dsResponse, data, dsRequest);
               if (dataSourceProps.removeEventCallback) {
-                dataSourceProps.removeEventCallback(recordKeys, requestProperties);
+                dataSourceProps.removeEventCallback(
+                  recordKeys,
+                  requestProperties
+                );
               }
-              };
-          return this.Super('removeData', [recordKeys, newCallBack, requestProperties]);
+            };
+          return this.Super('removeData', [
+            recordKeys,
+            newCallBack,
+            requestProperties
+          ]);
         }
       });
     }
@@ -243,22 +292,32 @@
     this.controlsBar.reorderMember(2, 4); // Moves the 'displayed date' to last position
     if (this.showDayView !== false && this.showDayLanesToggleControl) {
       this.controlsBar.addMember(
-      isc.ImgButton.create({
-        prompt: OB.I18N.getLabel('OBUIAPP_CalendarShowHideLanes'),
-        showDown: false,
-        showRollOver: false,
-        action: function () {
-          var calendar = this.parentElement.creator;
-          if (calendar.showDayLanes) {
-            calendar.setShowDayLanes(false);
-          } else {
-            calendar.setShowDayLanes(true);
-          }
-        }
-      }, this.dayLanesToggleButtonDefaults), 2);
+        isc.ImgButton.create(
+          {
+            prompt: OB.I18N.getLabel('OBUIAPP_CalendarShowHideLanes'),
+            showDown: false,
+            showRollOver: false,
+            action: function() {
+              var calendar = this.parentElement.creator;
+              if (calendar.showDayLanes) {
+                calendar.setShowDayLanes(false);
+              } else {
+                calendar.setShowDayLanes(true);
+              }
+            }
+          },
+          this.dayLanesToggleButtonDefaults
+        ),
+        2
+      );
     }
 
-    if (this.defaultViewName && ((this.showDayView !== false && this.showWeekView !== false) || (this.showDayView !== false && this.showMonthView !== false) || (this.showWeekView !== false && this.showMonthView !== false))) {
+    if (
+      this.defaultViewName &&
+      ((this.showDayView !== false && this.showWeekView !== false) ||
+        (this.showDayView !== false && this.showMonthView !== false) ||
+        (this.showWeekView !== false && this.showMonthView !== false))
+    ) {
       this.setCurrentViewName(this.defaultViewName);
     }
     if (!this.showAddEventControl) {
@@ -269,14 +328,16 @@
     }
   },
 
-  directEventEdit: function (event, popupCallback) {
-    var callback, openEventDialog, calendar = this;
-    callback = function (dsResponse, data, dsRequest) {
+  directEventEdit: function(event, popupCallback) {
+    var callback,
+      openEventDialog,
+      calendar = this;
+    callback = function(dsResponse, data, dsRequest) {
       if (data && data[0]) {
         openEventDialog(data[0]);
       }
     };
-    openEventDialog = function (event) {
+    openEventDialog = function(event) {
       if (event) {
         if (calendar.OBEventEditor) {
           calendar.eventDialog.event = event;
@@ -286,13 +347,20 @@
           calendar.eventDialog.currentLane = event[calendar.laneNameField];
           calendar.eventDialog.calendar = calendar;
           try {
-            if (event[calendar.canEditField] === false && event[calendar.canRemoveField] === false) {
-              isc.warn(OB.I18N.getLabel('OBUIAPP_CalendarCanNotUpdateEvent'), function () {
-                return true;
-              }, {
-                icon: '[SKINIMG]Dialog/error.png',
-                title: OB.I18N.getLabel('OBUIAPP_Error')
-              });
+            if (
+              event[calendar.canEditField] === false &&
+              event[calendar.canRemoveField] === false
+            ) {
+              isc.warn(
+                OB.I18N.getLabel('OBUIAPP_CalendarCanNotUpdateEvent'),
+                function() {
+                  return true;
+                },
+                {
+                  icon: '[SKINIMG]Dialog/error.png',
+                  title: OB.I18N.getLabel('OBUIAPP_Error')
+                }
+              );
             } else {
               calendar.eventDialog.show();
             }
@@ -310,7 +378,7 @@
     }
   },
 
-  eventResized: function (newDate, event) {
+  eventResized: function(newDate, event) {
     newDate.setSeconds(0);
     if (this.showEventDialogOnEventResize) {
       this.eventDialog.event = event;
@@ -328,12 +396,12 @@
       return this.Super('eventResized', arguments);
     }
   },
-  eventMoved: function (newDate, event, newLane) {
+  eventMoved: function(newDate, event, newLane) {
     newDate.setSeconds(0);
     if (this.showEventDialogOnEventMove) {
       //Event duration
       var dateDiff = event[this.endDateField] - event[this.startDateField],
-          newEndDate = newDate.getTime() + dateDiff; //Add the event duration to the new startDate
+        newEndDate = newDate.getTime() + dateDiff; //Add the event duration to the new startDate
       newEndDate = new Date(newEndDate);
       this.eventDialog.event = event;
       this.eventDialog.currentStart = newDate;
@@ -350,7 +418,7 @@
       return this.Super('eventMoved', arguments);
     }
   },
-  eventRemoveClick: function (event) {
+  eventRemoveClick: function(event) {
     if (this.showEventDialogOnEventDelete) {
       this.eventDialog.event = event;
       this.eventDialog.currentStart = event[this.startDateField];
@@ -367,21 +435,29 @@
       return this.Super('eventRemoveClick', arguments);
     }
   },
-  showOBEventDialog: function () {
+  showOBEventDialog: function() {
     var dialog = isc.OBPopup.create({});
     dialog.show();
   },
 
-  getCriteria: function (criteria) {
-    var startTime, endTime, legend, i, startDateCriteria, middleDateCriteria, endDateCriteria, dateCriteriaOrPart, orPart = {
-      operator: 'or',
-      criteria: []
-    };
+  getCriteria: function(criteria) {
+    var startTime,
+      endTime,
+      legend,
+      i,
+      startDateCriteria,
+      middleDateCriteria,
+      endDateCriteria,
+      dateCriteriaOrPart,
+      orPart = {
+        operator: 'or',
+        criteria: []
+      };
 
     if (!criteria || !criteria.operator) {
       criteria = {
-        _constructor: "AdvancedCriteria",
-        operator: "and"
+        _constructor: 'AdvancedCriteria',
+        operator: 'and'
       };
     }
     criteria.criteria = criteria.criteria || [];
@@ -407,7 +483,7 @@
 
     // To show events that starts in the current month
     startDateCriteria = {
-      operator: "and",
+      operator: 'and',
       criteria: []
     };
     startDateCriteria.criteria.push({
@@ -424,7 +500,7 @@
 
     // To show events that starts before current month and ends after current month
     middleDateCriteria = {
-      operator: "and",
+      operator: 'and',
       criteria: []
     };
     middleDateCriteria.criteria.push({
@@ -441,7 +517,7 @@
 
     // To show events that ends in the current month
     endDateCriteria = {
-      operator: "and",
+      operator: 'and',
       criteria: []
     };
     endDateCriteria.criteria.push({
@@ -489,10 +565,27 @@
       criteria.criteria.push(orPart);
     }
 
-    if (this.multiCalendar && this.multiCalendar.calendarData.hasCustomFilters) {
-      for (i = 0; i < this.multiCalendar.calendarData.customFilters.length; i++) {
-        if (typeof this.multiCalendar.calendarData.customFilters[i].handler.filterCriteria === 'function') {
-          criteria.criteria.push(this.multiCalendar.calendarData.customFilters[i].handler.filterCriteria(this, this.multiCalendar.calendarData.customFilters[i]));
+    if (
+      this.multiCalendar &&
+      this.multiCalendar.calendarData.hasCustomFilters
+    ) {
+      for (
+        i = 0;
+        i < this.multiCalendar.calendarData.customFilters.length;
+        i++
+      ) {
+        if (
+          typeof this.multiCalendar.calendarData.customFilters[i].handler
+            .filterCriteria === 'function'
+        ) {
+          criteria.criteria.push(
+            this.multiCalendar.calendarData.customFilters[
+              i
+            ].handler.filterCriteria(
+              this,
+              this.multiCalendar.calendarData.customFilters[i]
+            )
+          );
         }
       }
     }
@@ -511,15 +604,20 @@
   // or the other way around, we need to set also the initialScroll to this other view.
   isInitialScrollAlreadyBeenSet: false,
 
-  draw: function () {
-    var ret, _originalTabSelected = this.mainView.tabSelected,
-        calendar = this;
+  draw: function() {
+    var ret,
+      _originalTabSelected = this.mainView.tabSelected,
+      calendar = this;
     ret = this.Super('draw', arguments);
 
     // If change filter/legend parameters in day/week view and you switch to the other one,
     // data needs to be refreshed in order to show changes
-    if (this.multiCalendar && this.mainView && typeof this.mainView.selectTab === 'function') {
-      this.mainView.tabSelected = function (tabNum) {
+    if (
+      this.multiCalendar &&
+      this.mainView &&
+      typeof this.mainView.selectTab === 'function'
+    ) {
+      this.mainView.tabSelected = function(tabNum) {
         var actionObject, mvret;
         actionObject = {
           target: this,
@@ -532,7 +630,7 @@
           calendar.isInitialScrollAlreadyBeenSet = true;
           // Timeout to allow new selected tab grid be fully loaded
           if (calendar.initialScrollTime) {
-            setTimeout(function () {
+            setTimeout(function() {
               try {
                 calendar.scrollToTime(calendar.initialScrollTime);
               } catch (e) {
@@ -546,7 +644,7 @@
     }
     // Timeout to allow the tab grid be fully loaded
     if (calendar.initialScrollTime) {
-      setTimeout(function () {
+      setTimeout(function() {
         try {
           calendar.scrollToTime(calendar.initialScrollTime);
         } catch (e) {
@@ -557,11 +655,15 @@
     return ret;
   },
 
-  fetchData: function (criteria, callback, request) {
-    return this.Super('fetchData', [this.getCriteria(criteria), callback, request]);
+  fetchData: function(criteria, callback, request) {
+    return this.Super('fetchData', [
+      this.getCriteria(criteria),
+      callback,
+      request
+    ]);
   },
 
-  filterData: function (criteria) {
+  filterData: function(criteria) {
     var newCriteria, ret;
     newCriteria = this.getCriteria(criteria);
     ret = this.Super('filterData', [newCriteria]);
@@ -572,7 +674,7 @@
   },
 
   // read the dates for the current month
-  dateChanged: function () {
+  dateChanged: function() {
     if (this.multiCalendar) {
       this.multiCalendar.leftControls.dateChooser.setData(this.chosenDate);
     }
@@ -586,8 +688,15 @@
     this.filterData();
   },
 
-  addEvent: function (startDate, endDate, name, description, otherFields, laneName, ignoreDataChanged) {
-
+  addEvent: function(
+    startDate,
+    endDate,
+    name,
+    description,
+    otherFields,
+    laneName,
+    ignoreDataChanged
+  ) {
     otherFields = otherFields || {};
 
     // solve bug that otherwise time fields are not passed in
@@ -597,7 +706,7 @@
     return this.Super('addEvent', arguments);
   },
 
-  addEventWithDialog: function (startDate, endDate) {
+  addEventWithDialog: function(startDate, endDate) {
     if (!startDate) {
       startDate = new Date();
     }
@@ -615,5 +724,4 @@
       //To avoid js error due to conflicts with Smartclient default EventDialog
     }
   }
-
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/calendar/ob-multicalendar.js	Wed Jun 12 10:59:13 2019 +0200
@@ -38,12 +38,12 @@
   checked: true,
   overflow: 'hidden',
   nodes: [],
-  show: function () {
+  show: function() {
     this.Super('show', arguments);
     this.updateCheckboxValue();
     this.updateChildsVisibility();
   },
-  updateChildsVisibility: function () {
+  updateChildsVisibility: function() {
     var i;
     for (i = 0; i < this.nodes.length; i++) {
       if (this.checked) {
@@ -54,9 +54,9 @@
     }
   },
   // Change action of tree button (opened/closed state)
-  changedTree: function (value) {
+  changedTree: function(value) {
     var calendarData = this.multiCalendar.calendarData,
-        i;
+      i;
     for (i = 0; i < calendarData.calendarGroups.length; i++) {
       if (calendarData.calendarGroups[i].id === this.id) {
         this.checked = value;
@@ -66,9 +66,9 @@
     this.updateChildsVisibility();
   },
   // Refresh the checkbox state based on nodes state
-  updateCheckboxValue: function () {
+  updateCheckboxValue: function() {
     var status = '',
-        i; // true, all nodes are true -- false, all nodes are false -- null, are mixed nodes states -- '' is the starting point
+      i; // true, all nodes are true -- false, all nodes are false -- null, are mixed nodes states -- '' is the starting point
     for (i = 0; i < this.nodes.length; i++) {
       if (this.nodes[i].checked) {
         if (status === '') {
@@ -89,13 +89,18 @@
     }
   },
   // Programatically set the checkbox value
-  setCheckboxValue: function (value, updateParent, refreshCalendar, updateNodes) {
+  setCheckboxValue: function(
+    value,
+    updateParent,
+    refreshCalendar,
+    updateNodes
+  ) {
     this.members[1].items[0].setValue(value);
     this.doAfterCheckboxChange(updateParent, refreshCalendar, updateNodes);
   },
-  doAfterCheckboxChange: function (updateParent, refreshCalendar, updateNodes) {
+  doAfterCheckboxChange: function(updateParent, refreshCalendar, updateNodes) {
     var value = this.members[1].items[0].getValue(),
-        i;
+      i;
     if (updateNodes) {
       for (i = 0; i < this.nodes.length; i++) {
         this.nodes[i].setCheckboxValue(value, false, false);
@@ -109,7 +114,7 @@
     }
   },
   // Checkbox for all/none nodes selected
-  changed: function (form, item, value) {
+  changed: function(form, item, value) {
     if (value === null) {
       // To avoid a "null" state if the user clicks in a "false" state checkbox. It jumps directly to the "true" state
       item.setValue(true);
@@ -119,8 +124,11 @@
     this.Super('changed', [form, item, value]);
     form.parentElement.doAfterCheckboxChange(true, true, true);
   },
-  initWidget: function () {
-    var buttonTree, checkboxGroup, name, me = this;
+  initWidget: function() {
+    var buttonTree,
+      checkboxGroup,
+      name,
+      me = this;
     this.Super('initWidget', arguments);
     if (this.checked === 'true') {
       this.checked = true;
@@ -129,26 +137,35 @@
       this.checked = false;
     }
     if (this.color) {
-      OB.Utilities.Style.addRule('.bgColor_' + this.color, 'background-color: ' + OB.Utilities.getRGBAStringFromOBColor(this.color) + ';' + 'color: ' + (OB.Utilities.getBrightFromOBColor(this.color) > 125 ? 'black' : 'white'));
+      OB.Utilities.Style.addRule(
+        '.bgColor_' + this.color,
+        'background-color: ' +
+          OB.Utilities.getRGBAStringFromOBColor(this.color) +
+          ';' +
+          'color: ' +
+          (OB.Utilities.getBrightFromOBColor(this.color) > 125
+            ? 'black'
+            : 'white')
+      );
     }
     buttonTree = isc.Layout.create({
       width: 15,
       height: 18,
       styleName: 'OBMultiCalendarLegendGroupElementTreeOpened',
       value: null,
-      initWidget: function () {
+      initWidget: function() {
         this.value = me.checked;
         this.updateIcon();
         this.Super('initWidget', arguments);
       },
-      updateIcon: function () {
+      updateIcon: function() {
         if (this.value) {
           this.setStyleName('OBMultiCalendarLegendGroupElementTreeOpened');
         } else {
           this.setStyleName('OBMultiCalendarLegendGroupElementTreeClosed');
         }
       },
-      click: function () {
+      click: function() {
         if (this.value) {
           this.value = false;
         } else {
@@ -161,19 +178,21 @@
     checkboxGroup = isc.DynamicForm.create({
       width: 20,
       checked: this.checked,
-      fields: [{
-        height: 16,
-        width: 20,
-        allowEmptyValue: true,
-        showUnsetImage: true,
-        showTitle: false,
-        value: this.checked,
-        init: function () {
-          this.unsetImage = this.partialSelectedImage;
-        },
-        changed: this.changed,
-        type: 'checkbox'
-      }]
+      fields: [
+        {
+          height: 16,
+          width: 20,
+          allowEmptyValue: true,
+          showUnsetImage: true,
+          showTitle: false,
+          value: this.checked,
+          init: function() {
+            this.unsetImage = this.partialSelectedImage;
+          },
+          changed: this.changed,
+          type: 'checkbox'
+        }
+      ]
     });
     name = isc.Label.create({
       height: 10,
@@ -196,15 +215,15 @@
   checked: true,
   overflow: 'hidden',
   // Programatically set the checkbox value
-  setCheckboxValue: function (value, updateParent, refreshCalendar) {
-    value = !! value;
+  setCheckboxValue: function(value, updateParent, refreshCalendar) {
+    value = !!value;
     this.members[2].items[0].setValue(value);
     this.doAfterCheckboxChange(updateParent, refreshCalendar);
   },
-  doAfterCheckboxChange: function (updateParent, refreshCalendar) {
+  doAfterCheckboxChange: function(updateParent, refreshCalendar) {
     var value = this.members[2].items[0].getValue(),
-        calendarData = this.multiCalendar.calendarData,
-        i;
+      calendarData = this.multiCalendar.calendarData,
+      i;
     for (i = 0; i < calendarData.calendars.length; i++) {
       if (calendarData.calendars[i].id === this.id) {
         this.checked = value;
@@ -218,12 +237,16 @@
       this.multiCalendar.refreshCalendar();
     }
   },
-  changed: function (form, item, value) {
+  changed: function(form, item, value) {
     this.Super('changed', arguments);
     form.parentElement.doAfterCheckboxChange(true, true);
   },
-  initWidget: function () {
-    var leftMargin, checkbox, color, name, me = this;
+  initWidget: function() {
+    var leftMargin,
+      checkbox,
+      color,
+      name,
+      me = this;
     this.Super('initWidget', arguments);
     if (this.checked === 'true') {
       this.checked = true;
@@ -232,23 +255,34 @@
       this.checked = false;
     }
     if (this.color) {
-      OB.Utilities.Style.addRule('.bgColor_' + this.color, 'background-color: ' + OB.Utilities.getRGBAStringFromOBColor(this.color) + ';' + 'color: ' + (OB.Utilities.getBrightFromOBColor(this.color) > 125 ? 'black' : 'white'));
+      OB.Utilities.Style.addRule(
+        '.bgColor_' + this.color,
+        'background-color: ' +
+          OB.Utilities.getRGBAStringFromOBColor(this.color) +
+          ';' +
+          'color: ' +
+          (OB.Utilities.getBrightFromOBColor(this.color) > 125
+            ? 'black'
+            : 'white')
+      );
     }
     leftMargin = isc.Layout.create({
-      width: (me.parentNode ? 20 : 0),
+      width: me.parentNode ? 20 : 0,
       height: 1
     });
     checkbox = isc.DynamicForm.create({
       width: 20,
       checked: this.checked,
-      fields: [{
-        height: 16,
-        width: 20,
-        showTitle: false,
-        value: this.checked,
-        changed: this.changed,
-        type: 'checkbox'
-      }]
+      fields: [
+        {
+          height: 16,
+          width: 20,
+          showTitle: false,
+          value: this.checked,
+          changed: this.changed,
+          type: 'checkbox'
+        }
+      ]
     });
     color = isc.Layout.create({
       width: 15,
@@ -276,14 +310,15 @@
   overflow: 'auto',
   membersMargin: 5,
 
-  initWidget: function () {
+  initWidget: function() {
     this.multiCalendar.OBMultiCalendarLegend = this;
     this.Super('initWidget', arguments);
   },
 
-  updateMembers: function (newMembers) {
+  updateMembers: function(newMembers) {
     var calendarGroups = [],
-        i, j;
+      i,
+      j;
     if (this.members) {
       for (i = this.members.length - 1; i > -1; i--) {
         this.members[i].destroy();
@@ -292,30 +327,45 @@
     this.multiCalendar.eventStyles = {};
 
     // Create calendar groups
-    for (i = 0; i < this.multiCalendar.calendarData.calendarGroups.length; i++) {
-      calendarGroups.push(isc.OBMultiCalendarLegendGroupElement.create({
-        multiCalendar: this.multiCalendar,
-        name: this.multiCalendar.calendarData.calendarGroups[i].name,
-        id: this.multiCalendar.calendarData.calendarGroups[i].id,
-        checked: this.multiCalendar.calendarData.calendarGroups[i].checked,
-        nodes: []
-      }));
+    for (
+      i = 0;
+      i < this.multiCalendar.calendarData.calendarGroups.length;
+      i++
+    ) {
+      calendarGroups.push(
+        isc.OBMultiCalendarLegendGroupElement.create({
+          multiCalendar: this.multiCalendar,
+          name: this.multiCalendar.calendarData.calendarGroups[i].name,
+          id: this.multiCalendar.calendarData.calendarGroups[i].id,
+          checked: this.multiCalendar.calendarData.calendarGroups[i].checked,
+          nodes: []
+        })
+      );
     }
 
     // Add nodes to groups
     for (i = 0; i < newMembers.length; i++) {
       if (newMembers[i].calendarGroupId) {
-        for (j = 0; j < this.multiCalendar.calendarData.calendarGroups.length; j++) {
-          if (newMembers[i].calendarGroupId === this.multiCalendar.calendarData.calendarGroups[j].id) {
-            calendarGroups[j].nodes.push(isc.OBMultiCalendarLegendElement.create({
-              multiCalendar: this.multiCalendar,
-              color: newMembers[i].color,
-              name: newMembers[i].name,
-              id: newMembers[i].id,
-              //calendarGroupId: newMembers[i].calendarGroupId,
-              parentNode: calendarGroups[j],
-              checked: newMembers[i].checked
-            }));
+        for (
+          j = 0;
+          j < this.multiCalendar.calendarData.calendarGroups.length;
+          j++
+        ) {
+          if (
+            newMembers[i].calendarGroupId ===
+            this.multiCalendar.calendarData.calendarGroups[j].id
+          ) {
+            calendarGroups[j].nodes.push(
+              isc.OBMultiCalendarLegendElement.create({
+                multiCalendar: this.multiCalendar,
+                color: newMembers[i].color,
+                name: newMembers[i].name,
+                id: newMembers[i].id,
+                //calendarGroupId: newMembers[i].calendarGroupId,
+                parentNode: calendarGroups[j],
+                checked: newMembers[i].checked
+              })
+            );
           }
         }
       }
@@ -324,14 +374,16 @@
     // Add orphan members
     for (i = 0; i < newMembers.length; i++) {
       if (!newMembers[i].calendarGroupId) {
-        this.addMember(isc.OBMultiCalendarLegendElement.create({
-          multiCalendar: this.multiCalendar,
-          color: newMembers[i].color,
-          name: newMembers[i].name,
-          id: newMembers[i].id,
-          calendarGroupId: newMembers[i].calendarGroupId,
-          checked: newMembers[i].checked
-        }));
+        this.addMember(
+          isc.OBMultiCalendarLegendElement.create({
+            multiCalendar: this.multiCalendar,
+            color: newMembers[i].color,
+            name: newMembers[i].name,
+            id: newMembers[i].id,
+            calendarGroupId: newMembers[i].calendarGroupId,
+            checked: newMembers[i].checked
+          })
+        );
       }
     }
 
@@ -347,7 +399,8 @@
 
     // Save the colors
     for (i = 0; i < newMembers.length; i++) {
-      this.multiCalendar.eventStyles[newMembers[i].id] = 'bgColor_' + newMembers[i].color;
+      this.multiCalendar.eventStyles[newMembers[i].id] =
+        'bgColor_' + newMembers[i].color;
     }
 
     if (this.multiCalendar.leftControls) {
@@ -368,81 +421,114 @@
   filter: null,
   dateChooser: null,
   legend: null,
-  getFilterValueMap: function () {
+  getFilterValueMap: function() {
     var filterObj = {},
-        calendarData = this.multiCalendar.calendarData,
-        i;
+      calendarData = this.multiCalendar.calendarData,
+      i;
     for (i = 0; i < calendarData.filters.length; i++) {
       filterObj[calendarData.filters[i].id] = calendarData.filters[i].name;
     }
     return filterObj;
   },
-  getLegendValueMap: function () {
+  getLegendValueMap: function() {
     var calendarData = this.multiCalendar.calendarData,
-        legendArray = [],
-        i;
+      legendArray = [],
+      i;
     for (i = 0; i < calendarData.calendars.length; i++) {
-      if (calendarData.hasFilter === false || calendarData.calendars[i].filterId === this.filter.getValue('filter')) {
+      if (
+        calendarData.hasFilter === false ||
+        calendarData.calendars[i].filterId === this.filter.getValue('filter')
+      ) {
         legendArray.push(calendarData.calendars[i]);
       }
     }
     return legendArray;
   },
-  initWidget: function () {
-    var button, label, customFilterObj, leftControls = this,
-        currentFilter = null,
-        i;
+  initWidget: function() {
+    var button,
+      label,
+      customFilterObj,
+      leftControls = this,
+      currentFilter = null,
+      i;
     this.Super('initWidget', arguments);
     if (this.multiCalendar.calendarData.hasFilter) {
-      for (i = 0; i < leftControls.multiCalendar.calendarData.filters.length; i++) {
+      for (
+        i = 0;
+        i < leftControls.multiCalendar.calendarData.filters.length;
+        i++
+      ) {
         if (leftControls.multiCalendar.calendarData.filters[i].checked) {
           currentFilter = leftControls.multiCalendar.calendarData.filters[i].id;
           break;
         }
       }
       this.filter = isc.DynamicForm.create({
-        fields: [{
-          name: 'filter',
-          title: leftControls.multiCalendar.filterName,
-          type: 'comboBox',
-          valueMap: leftControls.getFilterValueMap(),
-          value: currentFilter,
-          width: 180,
-          titleOrientation: 'top',
-          required: true,
-          changed: function (form, item, value) {
-            this.Super('changed', arguments);
-            for (i = 0; i < leftControls.multiCalendar.calendarData.filters.length; i++) {
-              if (leftControls.multiCalendar.calendarData.filters[i].id === value) {
-                leftControls.multiCalendar.calendarData.filters[i].checked = true;
-              } else {
-                leftControls.multiCalendar.calendarData.filters[i].checked = false;
+        fields: [
+          {
+            name: 'filter',
+            title: leftControls.multiCalendar.filterName,
+            type: 'comboBox',
+            valueMap: leftControls.getFilterValueMap(),
+            value: currentFilter,
+            width: 180,
+            titleOrientation: 'top',
+            required: true,
+            changed: function(form, item, value) {
+              this.Super('changed', arguments);
+              for (
+                i = 0;
+                i < leftControls.multiCalendar.calendarData.filters.length;
+                i++
+              ) {
+                if (
+                  leftControls.multiCalendar.calendarData.filters[i].id ===
+                  value
+                ) {
+                  leftControls.multiCalendar.calendarData.filters[
+                    i
+                  ].checked = true;
+                } else {
+                  leftControls.multiCalendar.calendarData.filters[
+                    i
+                  ].checked = false;
+                }
               }
-            }
-            leftControls.legend.updateMembers(leftControls.getLegendValueMap());
-          },
+              leftControls.legend.updateMembers(
+                leftControls.getLegendValueMap()
+              );
+            },
 
-          cellStyle: OB.Styles.OBFormField.DefaultComboBox.cellStyle,
-          titleStyle: OB.Styles.OBFormField.DefaultComboBox.titleStyle,
-          textBoxStyle: OB.Styles.OBFormField.DefaultComboBox.textBoxStyle,
-          pendingTextBoxStyle: OB.Styles.OBFormField.DefaultComboBox.pendingTextBoxStyle,
-          controlStyle: OB.Styles.OBFormField.DefaultComboBox.controlStyle,
-          pickListBaseStyle: OB.Styles.OBFormField.DefaultComboBox.pickListBaseStyle,
-          pickListTallBaseStyle: OB.Styles.OBFormField.DefaultComboBox.pickListTallBaseStyle,
-          pickerIconStyle: OB.Styles.OBFormField.DefaultComboBox.pickerIconStyle,
-          pickerIconSrc: OB.Styles.OBFormField.DefaultComboBox.pickerIconSrc,
-          height: OB.Styles.OBFormField.DefaultComboBox.height,
-          pickerIconWidth: OB.Styles.OBFormField.DefaultComboBox.pickerIconWidth,
-          // fixes issue https://issues.openbravo.com/view.php?id=15105
-          pickListCellHeight: OB.Styles.OBFormField.DefaultComboBox.quickRunPickListCellHeight,
-          recentPropertyName: this.recentPropertyName,
-          pickListProperties: {
-            textMatchStyle: 'substring',
-            selectionType: 'single',
-            bodyStyleName: OB.Styles.OBFormField.DefaultComboBox.pickListProperties.bodyStyleName
-          },
-          pickListHeaderHeight: 0
-        }]
+            cellStyle: OB.Styles.OBFormField.DefaultComboBox.cellStyle,
+            titleStyle: OB.Styles.OBFormField.DefaultComboBox.titleStyle,
+            textBoxStyle: OB.Styles.OBFormField.DefaultComboBox.textBoxStyle,
+            pendingTextBoxStyle:
+              OB.Styles.OBFormField.DefaultComboBox.pendingTextBoxStyle,
+            controlStyle: OB.Styles.OBFormField.DefaultComboBox.controlStyle,
+            pickListBaseStyle:
+              OB.Styles.OBFormField.DefaultComboBox.pickListBaseStyle,
+            pickListTallBaseStyle:
+              OB.Styles.OBFormField.DefaultComboBox.pickListTallBaseStyle,
+            pickerIconStyle:
+              OB.Styles.OBFormField.DefaultComboBox.pickerIconStyle,
+            pickerIconSrc: OB.Styles.OBFormField.DefaultComboBox.pickerIconSrc,
+            height: OB.Styles.OBFormField.DefaultComboBox.height,
+            pickerIconWidth:
+              OB.Styles.OBFormField.DefaultComboBox.pickerIconWidth,
+            // fixes issue https://issues.openbravo.com/view.php?id=15105
+            pickListCellHeight:
+              OB.Styles.OBFormField.DefaultComboBox.quickRunPickListCellHeight,
+            recentPropertyName: this.recentPropertyName,
+            pickListProperties: {
+              textMatchStyle: 'substring',
+              selectionType: 'single',
+              bodyStyleName:
+                OB.Styles.OBFormField.DefaultComboBox.pickListProperties
+                  .bodyStyleName
+            },
+            pickListHeaderHeight: 0
+          }
+        ]
       });
     } else {
       this.filter = isc.VLayout.create({
@@ -452,18 +538,21 @@
     button = isc.OBFormButton.create({
       width: 180,
       title: this.multiCalendar.addEventButtonName,
-      click: function () {
+      click: function() {
         var startDate = OB.Utilities.Date.roundToNextHalfHour(new Date()),
-            endDate = new Date(startDate);
+          endDate = new Date(startDate);
         endDate.setHours(endDate.getHours() + 1);
-        leftControls.multiCalendar.calendar.addEventWithDialog(startDate, endDate);
+        leftControls.multiCalendar.calendar.addEventWithDialog(
+          startDate,
+          endDate
+        );
       }
     });
     this.dateChooser = isc.OBDateChooser.create({
       autoHide: false,
       showCancelButton: false,
       firstDayOfWeek: this.multiCalendar.firstDayOfWeek,
-      dataChanged: function (param) {
+      dataChanged: function(param) {
         this.parentElement.multiCalendar.calendar.setChosenDate(this.getData());
         this.parentElement.multiCalendar.calendar.setCurrentViewName('day');
       }
@@ -475,16 +564,32 @@
     this.customFiltersContainer = isc.VLayout.create({
       width: 1,
       height: 1,
-      initWidget: function () {
+      initWidget: function() {
         var i;
         if (leftControls.multiCalendar.calendarData.hasCustomFilters) {
-          for (i = 0; i < leftControls.multiCalendar.calendarData.customFilters.length; i++) {
-            if (leftControls.multiCalendar.calendarData.customFilters[i].handler.constructor) {
-              customFilterObj = leftControls.multiCalendar.calendarData.customFilters[i].handler.constructor.create({
-                multiCalendar: leftControls.multiCalendar,
-                checked: leftControls.multiCalendar.calendarData.customFilters[i].checked,
-                customFilter: leftControls.multiCalendar.calendarData.customFilters[i]
-              }, leftControls.multiCalendar.calendarData.customFilters[i].handler.constructorProps);
+          for (
+            i = 0;
+            i < leftControls.multiCalendar.calendarData.customFilters.length;
+            i++
+          ) {
+            if (
+              leftControls.multiCalendar.calendarData.customFilters[i].handler
+                .constructor
+            ) {
+              customFilterObj = leftControls.multiCalendar.calendarData.customFilters[
+                i
+              ].handler.constructor.create(
+                {
+                  multiCalendar: leftControls.multiCalendar,
+                  checked:
+                    leftControls.multiCalendar.calendarData.customFilters[i]
+                      .checked,
+                  customFilter:
+                    leftControls.multiCalendar.calendarData.customFilters[i]
+                },
+                leftControls.multiCalendar.calendarData.customFilters[i].handler
+                  .constructorProps
+              );
               this.addMembers([customFilterObj]);
             }
           }
@@ -500,7 +605,12 @@
     if (this.multiCalendar.canCreateEvents) {
       this.addMembers([button]);
     }
-    this.addMembers([this.dateChooser, this.customFiltersContainer, label, this.legend]);
+    this.addMembers([
+      this.dateChooser,
+      this.customFiltersContainer,
+      label,
+      this.legend
+    ]);
   }
 });
 
@@ -515,7 +625,7 @@
   showLeftControls: true,
   showCustomEventsBgColor: true,
 
-  parseCalendarData: function (calendarData) {
+  parseCalendarData: function(calendarData) {
     var canCreateEvents, cPropAttr, i;
     if (calendarData.filters) {
       calendarData.hasFilter = true;
@@ -539,15 +649,30 @@
       }
       if (typeof calendarData.calendars[i].color === 'undefined') {
         calendarData.calendars[i].color = OB.Utilities.generateOBColor(
-        null, null, null, 100, calendarData.calendars[i].id);
+          null,
+          null,
+          null,
+          100,
+          calendarData.calendars[i].id
+        );
       }
-      if (i === 0 && typeof calendarData.calendars[i].canCreateEvents !== 'undefined') {
+      if (
+        i === 0 &&
+        typeof calendarData.calendars[i].canCreateEvents !== 'undefined'
+      ) {
         canCreateEvents = false;
       }
-      if (typeof calendarData.calendars[i].canCreateEvents !== 'undefined' && canCreateEvents === false && calendarData.calendars[i].canCreateEvents === true) {
+      if (
+        typeof calendarData.calendars[i].canCreateEvents !== 'undefined' &&
+        canCreateEvents === false &&
+        calendarData.calendars[i].canCreateEvents === true
+      ) {
         canCreateEvents = true;
       }
-      if (canCreateEvents === false && i === calendarData.calendars.length - 1) {
+      if (
+        canCreateEvents === false &&
+        i === calendarData.calendars.length - 1
+      ) {
         this.canCreateEvents = false;
         this.calendarProps.canCreateEvents = false;
       }
@@ -564,11 +689,20 @@
         if (typeof calendarData.customFilters[i].checked === 'undefined') {
           calendarData.customFilters[i].checked = false;
         }
-        if (typeof calendarData.customFilters[i].handler === 'string' && this.calendarProps[calendarData.customFilters[i].handler]) {
-          calendarData.customFilters[i].handler = this.calendarProps[calendarData.customFilters[i].handler];
+        if (
+          typeof calendarData.customFilters[i].handler === 'string' &&
+          this.calendarProps[calendarData.customFilters[i].handler]
+        ) {
+          calendarData.customFilters[i].handler = this.calendarProps[
+            calendarData.customFilters[i].handler
+          ];
         }
-        if (typeof calendarData.customFilters[i].handler.constructor === 'string') {
-          calendarData.customFilters[i].handler.constructor = new Function('return ' + calendarData.customFilters[i].handler.constructor)();
+        if (
+          typeof calendarData.customFilters[i].handler.constructor === 'string'
+        ) {
+          calendarData.customFilters[i].handler.constructor = new Function(
+            'return ' + calendarData.customFilters[i].handler.constructor
+          )();
         }
       }
     }
@@ -585,7 +719,7 @@
 
     return calendarData;
   },
-  setLoading: function (value) {
+  setLoading: function(value) {
     if (value !== false) {
       if (this.members[1]) {
         this.members[1].hide();
@@ -608,8 +742,10 @@
       }
     }
   },
-  initComponents: function () {
-    var callback, i, me = this;
+  initComponents: function() {
+    var callback,
+      i,
+      me = this;
     for (i = this.members.length - 1; i > -1; i--) {
       this.members[i].destroy();
     }
@@ -640,30 +776,42 @@
       this.calendarProps.showDayLanesToggleControl = false;
     }
     this.addMembers([OB.Utilities.createLoadingLayout()]);
-    callback = function (rpcResponse, data, rpcRequest) {
+    callback = function(rpcResponse, data, rpcRequest) {
       if (data.message) {
-        isc.warn(data.message.text, function () {
-          return true;
-        }, {
-          icon: '[SKINIMG]Dialog/error.png',
-          title: OB.I18N.getLabel('OBUIAPP_Error')
-        });
+        isc.warn(
+          data.message.text,
+          function() {
+            return true;
+          },
+          {
+            icon: '[SKINIMG]Dialog/error.png',
+            title: OB.I18N.getLabel('OBUIAPP_Error')
+          }
+        );
       }
       me.calendarData = me.parseCalendarData(data);
       me.drawComponents();
     };
-    OB.RemoteCallManager.call(this.calendarProps.calendarDataActionHandler, {
-      action: this.calendarProps.calendarDataActionHandler_Action
-    }, {}, callback);
+    OB.RemoteCallManager.call(
+      this.calendarProps.calendarDataActionHandler,
+      {
+        action: this.calendarProps.calendarDataActionHandler_Action
+      },
+      {},
+      callback
+    );
   },
 
-  initWidget: function () {
+  initWidget: function() {
     this.initComponents();
     this.Super('initWidget', arguments);
   },
-  drawComponents: function () {
+  drawComponents: function() {
     var initialLanes;
-    if (this.calendarProps.showDayLanes || this.calendarProps.showDayLanesToggleControl !== false) {
+    if (
+      this.calendarProps.showDayLanes ||
+      this.calendarProps.showDayLanesToggleControl !== false
+    ) {
       //Inside this 'if' statement to avoid extra computational tasks if lanes are not going to be shown
       initialLanes = this.calculateLanes();
     }
@@ -674,26 +822,32 @@
     this.leftControls = isc.OBMultiCalendarLeftControls.create({
       multiCalendar: this
     });
-    this.calendar = isc.OBMultiCalendarCalendar.create(isc.addProperties(this.calendarProps, {
-      multiCalendar: this,
-      lanes: initialLanes,
-      autoFetchData: false
-    }));
+    this.calendar = isc.OBMultiCalendarCalendar.create(
+      isc.addProperties(this.calendarProps, {
+        multiCalendar: this,
+        lanes: initialLanes,
+        autoFetchData: false
+      })
+    );
 
     this.setLoading(false);
     if (this.showLeftControls) {
       this.addMembers([this.leftControls]);
     }
-    this.addMembers([isc.VLayout.create({
-      members: [this.calendar]
-    })]);
+    this.addMembers([
+      isc.VLayout.create({
+        members: [this.calendar]
+      })
+    ]);
     this.refreshCalendar();
   },
 
-  calculateLanes: function () {
+  calculateLanes: function() {
     var showedLanes = [],
-        laneDefObj = {},
-        selectedOrg, i, calendarData = this.calendarData;
+      laneDefObj = {},
+      selectedOrg,
+      i,
+      calendarData = this.calendarData;
     for (i = 0; i < calendarData.filters.length; i++) {
       if (calendarData.filters[i].checked) {
         selectedOrg = calendarData.filters[i].id;
@@ -701,7 +855,10 @@
       }
     }
     for (i = 0; i < calendarData.calendars.length; i++) {
-      if (calendarData.calendars[i].filterId === selectedOrg && calendarData.calendars[i].checked) {
+      if (
+        calendarData.calendars[i].filterId === selectedOrg &&
+        calendarData.calendars[i].checked
+      ) {
         laneDefObj = {};
         laneDefObj.name = calendarData.calendars[i].id;
         laneDefObj.title = calendarData.calendars[i].name;
@@ -711,13 +868,16 @@
     return showedLanes;
   },
 
-  refreshCalendar: function () {
+  refreshCalendar: function() {
     if (this.calendar) {
-      if (this.calendar.showDayLanes || this.calendar.showDayLanesToggleControl !== false) {
+      if (
+        this.calendar.showDayLanes ||
+        this.calendar.showDayLanesToggleControl !== false
+      ) {
         //Inside this 'if' statement to avoid extra computational tasks if lanes are not going to be shown
         this.calendar.setLanes(this.calculateLanes());
       }
       this.calendar.filterData();
     }
   }
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/callback/ob-extra-window-settings-actions.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/callback/ob-extra-window-settings-actions.js	Wed Jun 12 10:59:13 2019 +0200
@@ -19,15 +19,30 @@
 OB.Utilities = OB.Utilities || {};
 
 OB.Utilities.ExtraWindowSettingsActions = {
-  showInfoMessage: function (data) {
+  showInfoMessage: function(data) {
     var tab;
-    if (!data || !data.extraSettings || !data.extraSettings.messageKey || !data.extraSettings.tabId) {
+    if (
+      !data ||
+      !data.extraSettings ||
+      !data.extraSettings.messageKey ||
+      !data.extraSettings.tabId
+    ) {
       return;
     }
 
     tab = OB.MainView.TabSet.tabs.find('tabId', data.extraSettings.tabId);
-    if (tab && tab.pane && tab.pane.view && tab.pane.view.messageBar && tab.pane.view.messageBar.setMessage) {
-      tab.pane.view.messageBar.setMessage(isc.OBMessageBar.TYPE_INFO, null, OB.I18N.getLabel(data.extraSettings.messageKey));
+    if (
+      tab &&
+      tab.pane &&
+      tab.pane.view &&
+      tab.pane.view.messageBar &&
+      tab.pane.view.messageBar.setMessage
+    ) {
+      tab.pane.view.messageBar.setMessage(
+        isc.OBMessageBar.TYPE_INFO,
+        null,
+        OB.I18N.getLabel(data.extraSettings.messageKey)
+      );
     }
   }
-};
\ No newline at end of file
+};
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js	Wed Jun 12 10:59:13 2019 +0200
@@ -23,8 +23,7 @@
 // and the {{{Main View}}}. This includes opening views from the linked items display,
 // from direct links in other tabs.
 //
-(function (OB, isc) {
-
+(function(OB, isc) {
   if (!OB || !isc) {
     throw {
       name: 'ReferenceError',
@@ -34,15 +33,14 @@
 
   // cache object references locally
   var O = OB,
-      L = OB.Layout,
-      M = OB.MainView,
-      ISC = isc,
-      cobcomp;
+    L = OB.Layout,
+    M = OB.MainView,
+    ISC = isc,
+    cobcomp;
 
   function ClassicOBCompatibility() {}
 
   ClassicOBCompatibility.prototype = {
-
     // ** {{{ openLinkedItem(tabId, recordId) }}} **
     //
     // Opens a window from the linked item view.
@@ -51,10 +49,9 @@
     // * {{{tabId}}} id of the tab to open
     // * {{{recordId}}} the record to show
     //
-    openLinkedItem: function (tabId, recordId) {
+    openLinkedItem: function(tabId, recordId) {
       var doOpenClassicWindow;
-      doOpenClassicWindow = function (response, data, request) {
-
+      doOpenClassicWindow = function(response, data, request) {
         if (!data.recordId || data.recordId.length === 0) {
           L.ViewManager.openView('OBClassicWindow', {
             tabTitle: data.tabTitle,
@@ -76,10 +73,15 @@
         }
       };
 
-      OB.RemoteCallManager.call('org.openbravo.client.application.ComputeWindowActionHandler', {}, {
-        'tabId': tabId,
-        'recordId': recordId
-      }, doOpenClassicWindow);
+      OB.RemoteCallManager.call(
+        'org.openbravo.client.application.ComputeWindowActionHandler',
+        {},
+        {
+          tabId: tabId,
+          recordId: recordId
+        },
+        doOpenClassicWindow
+      );
     },
 
     // ** {{{ sendDirectLink(action, form) }}} **
@@ -91,15 +93,20 @@
     // e.g. {{{ JSON }}}
     // * {{{form}}} is an Object of the form from where it has been submitted
     //
-    sendDirectLink: function (action, form) {
-
+    sendDirectLink: function(action, form) {
       //
       // Returns a form field and value as a javascript object composed by name and value fields
       //
 
       function inputValueForms(name, field) {
         var result = {};
-        if (!field || name.toString().replace(/^\s*/, '').replace(/\s*$/, '') === '') {
+        if (
+          !field ||
+          name
+            .toString()
+            .replace(/^\s*/, '')
+            .replace(/\s*$/, '') === ''
+        ) {
           return result;
         }
         if (!field.type && field.length > 1) {
@@ -111,7 +118,7 @@
               return result;
             } else {
               var length = field.options.length,
-                  fieldsCount;
+                fieldsCount;
               for (fieldsCount = 0; fieldsCount < length; fieldsCount++) {
                 if (field.options[fieldsCount].selected) {
                   result.name = name;
@@ -120,7 +127,10 @@
               }
               return result;
             }
-          } else if (field.type.toUpperCase().indexOf('RADIO') !== -1 || field.type.toUpperCase().indexOf('CHECK') !== -1) {
+          } else if (
+            field.type.toUpperCase().indexOf('RADIO') !== -1 ||
+            field.type.toUpperCase().indexOf('CHECK') !== -1
+          ) {
             if (!field.length) {
               if (field.checked) {
                 result.name = name;
@@ -131,7 +141,7 @@
               }
             } else {
               var total = field.length,
-                  i;
+                i;
               for (i = 0; i < total; i++) {
                 if (field[i].checked) {
                   result.name = name;
@@ -157,14 +167,18 @@
 
       function getXHRParamsObj(action, formObject) {
         var paramsObj = {},
-            i, length = formObject.elements.length;
+          i,
+          length = formObject.elements.length;
 
         paramsObj.Command = action;
         paramsObj.IsAjaxCall = '1';
 
         for (i = 0; i < length; i++) {
           if (formObject.elements[i].type) {
-            var param = inputValueForms(formObject.elements[i].name, formObject.elements[i]);
+            var param = inputValueForms(
+              formObject.elements[i].name,
+              formObject.elements[i]
+            );
 
             if (param && param.name !== 'Command') {
               paramsObj[param.name] = param.value;
@@ -180,7 +194,12 @@
       //
 
       function fetchSendDirectLinkCallback(response, data) {
-        OB.Utilities.openView(data.windowId, data.tabId, data.tabTitle, data.recordId);
+        OB.Utilities.openView(
+          data.windowId,
+          data.tabId,
+          data.tabTitle,
+          data.recordId
+        );
       }
 
       //
@@ -194,7 +213,8 @@
         // formObject.action.toString();
         // hardcode to prevent this issue with chrome:
         // https://issues.openbravo.com/view.php?id=13837
-        var actionURL = OB.Application.contextUrl + 'utility/ReferencedLink.html';
+        var actionURL =
+          OB.Application.contextUrl + 'utility/ReferencedLink.html';
 
         var rpcMgr = ISC.RPCManager;
         var reqObj = {
@@ -210,16 +230,33 @@
       fetchSendDirectLink(action, form);
     },
 
-    setTabInformation: function (windowId, tabId, recordId, mode, obManualURL, title) {
+    setTabInformation: function(
+      windowId,
+      tabId,
+      recordId,
+      mode,
+      obManualURL,
+      title
+    ) {
       var tabNumber = null,
-          tabSet, tabPane;
+        tabSet,
+        tabPane;
       tabSet = M.TabSet;
       if (windowId) {
-        tabNumber = L.ViewManager.views.getTabNumberFromViewParam('windowId', windowId);
+        tabNumber = L.ViewManager.views.getTabNumberFromViewParam(
+          'windowId',
+          windowId
+        );
       } else if (obManualURL) {
-        tabNumber = L.ViewManager.views.getTabNumberFromViewParam('obManualURL', obManualURL);
+        tabNumber = L.ViewManager.views.getTabNumberFromViewParam(
+          'obManualURL',
+          obManualURL
+        );
       } else if (tabId) {
-        tabNumber = L.ViewManager.views.getTabNumberFromViewParam('tabId', tabId);
+        tabNumber = L.ViewManager.views.getTabNumberFromViewParam(
+          'tabId',
+          tabId
+        );
       }
 
       if (!tabNumber) {
@@ -233,14 +270,29 @@
       tabPane = tabSet.getTabPane(tabNumber);
 
       tabSet.setTabTitle(tabNumber, title);
-      tabPane.updateTabInformation(windowId, tabId, recordId, mode, obManualURL, title);
+      tabPane.updateTabInformation(
+        windowId,
+        tabId,
+        recordId,
+        mode,
+        obManualURL,
+        title
+      );
     },
 
     Keyboard: {
-      getMDIKS: function () {
-        var key, auxKey, action, funcParam, keyMap, ClassicKeyJSON = [],
-            LKS = O.KeyboardManager.Shortcuts,
-            i, j, isCanvasShortcut, length = LKS.list.length;
+      getMDIKS: function() {
+        var key,
+          auxKey,
+          action,
+          funcParam,
+          keyMap,
+          ClassicKeyJSON = [],
+          LKS = O.KeyboardManager.Shortcuts,
+          i,
+          j,
+          isCanvasShortcut,
+          length = LKS.list.length;
 
         for (i = 0; i < length; i++) {
           auxKey = '';
@@ -284,44 +336,44 @@
             // Special keys nomenclature adaptation from Smartclient way to
             // classic utils.js way
             keyMap = {
-              'Backspace': 'BACKSPACE',
-              'Tab': 'TAB',
-              'Enter': 'ENTER',
-              'Space': 'SPACE',
-              'Insert': 'INSERT',
-              'End': 'END',
-              'Home': 'HOME',
-              'Page_Up': 'REPAGE',
-              'Page_Down': 'AVPAGE',
-              'Arrow_Left': 'LEFTARROW',
-              'Arrow_Right': 'RIGHTARROW',
-              'Arrow_Up': 'UPARROW',
-              'Arrow_Down': 'DOWNARROW',
+              Backspace: 'BACKSPACE',
+              Tab: 'TAB',
+              Enter: 'ENTER',
+              Space: 'SPACE',
+              Insert: 'INSERT',
+              End: 'END',
+              Home: 'HOME',
+              Page_Up: 'REPAGE',
+              Page_Down: 'AVPAGE',
+              Arrow_Left: 'LEFTARROW',
+              Arrow_Right: 'RIGHTARROW',
+              Arrow_Up: 'UPARROW',
+              Arrow_Down: 'DOWNARROW',
               '+': 'NUMBERPOSITIVE',
               '-': 'NUMBERNEGATIVE',
               '.': 'NUMBERDECIMAL',
-              'Escape': 'ESCAPE',
-              'f1': 'F1',
-              'f2': 'F2',
-              'f3': 'F3',
-              'f4': 'F4',
-              'f5': 'F5',
-              'f6': 'F6',
-              'f7': 'F7',
-              'f8': 'F8',
-              'f9': 'F9',
-              'f10': 'F10',
-              'f11': 'F11',
-              'f12': 'F12'
+              Escape: 'ESCAPE',
+              f1: 'F1',
+              f2: 'F2',
+              f3: 'F3',
+              f4: 'F4',
+              f5: 'F5',
+              f6: 'F6',
+              f7: 'F7',
+              f8: 'F8',
+              f9: 'F9',
+              f10: 'F10',
+              f11: 'F11',
+              f12: 'F12'
             };
 
             key = keyMap[key] || key;
 
             ClassicKeyJSON.push({
-              'key': key,
-              'auxKey': auxKey,
-              'action': action,
-              'funcParam': funcParam
+              key: key,
+              auxKey: auxKey,
+              action: action,
+              funcParam: funcParam
             });
           }
         }
@@ -329,7 +381,7 @@
         return ClassicKeyJSON;
       },
 
-      executeKSFunction: function (func, funcParam) {
+      executeKSFunction: function(func, funcParam) {
         func(funcParam);
       }
     },
@@ -357,10 +409,23 @@
       // * {{{postParams}}} type: Object - parameters to be sent to the url using POST instead of GET
       // * {{{isModal}}} type: Boolean - to specify if the popup should be modal or not. The default value is 'true' if it is not specified
       // * {{{show}}} type: Boolean - to specify if the popup should be shown or not. The default value is 'true' if it is not specified
-      // 
+      //
       // returns the created OBClassicPopupWindow
-      open: function (name, width, height, url, title, theOpener, showMinimizeControl, showMaximizeControl, showCloseControl, postParams, isModal, show) {
-        var urlCharacter = (url && url.indexOf('?') !== -1) ? '&' : '?';
+      open: function(
+        name,
+        width,
+        height,
+        url,
+        title,
+        theOpener,
+        showMinimizeControl,
+        showMaximizeControl,
+        showCloseControl,
+        postParams,
+        isModal,
+        show
+      ) {
+        var urlCharacter = url && url.indexOf('?') !== -1 ? '&' : '?';
 
         if (showMinimizeControl !== false) {
           showMinimizeControl = true;
@@ -377,11 +442,26 @@
         if (show !== false) {
           show = true;
         }
-        var _htmlCode, _navUserAgent = navigator.userAgent.toUpperCase();
-        if (OB.Utilities.isIE9Strict || _navUserAgent.indexOf('MSIE') === -1) { // IE >= 9 (Strict) or any other browser
-          _htmlCode = '<html><head></head><body style="margin: 0; padding: 0; border: none;">' + '<iframe id="MDIPopupContainer" name="MDIPopupContainer" style="margin: 0; padding: 0; border: none; width: 100%; height: 100%;"></iframe>' + '<iframe name="frameMenu" scrolling="no" src="' + OB.Application.contextUrl + 'utility/VerticalMenu.html?Command=HIDE" id="paramFrameMenuLoading" style="margin: 0px; padding: 0px; border: 0px; height: 0px; width: 0px;"></iframe>' + '</body></html>';
-        } else { // IE <= 8
-          _htmlCode = '<html><head></head><frameset cols="*, 0%" rows="*" frameborder="no" border="0" framespacing="0">' + '<frame id="MDIPopupContainer" name="MDIPopupContainer"></frame>' + '<frame name="frameMenu" scrolling="no" src="' + OB.Application.contextUrl + 'utility/VerticalMenu.html?Command=HIDE" id="paramFrameMenuLoading"></frame>' + '</frameset><body></body></html>';
+        var _htmlCode,
+          _navUserAgent = navigator.userAgent.toUpperCase();
+        if (OB.Utilities.isIE9Strict || _navUserAgent.indexOf('MSIE') === -1) {
+          // IE >= 9 (Strict) or any other browser
+          _htmlCode =
+            '<html><head></head><body style="margin: 0; padding: 0; border: none;">' +
+            '<iframe id="MDIPopupContainer" name="MDIPopupContainer" style="margin: 0; padding: 0; border: none; width: 100%; height: 100%;"></iframe>' +
+            '<iframe name="frameMenu" scrolling="no" src="' +
+            OB.Application.contextUrl +
+            'utility/VerticalMenu.html?Command=HIDE" id="paramFrameMenuLoading" style="margin: 0px; padding: 0px; border: 0px; height: 0px; width: 0px;"></iframe>' +
+            '</body></html>';
+        } else {
+          // IE <= 8
+          _htmlCode =
+            '<html><head></head><frameset cols="*, 0%" rows="*" frameborder="no" border="0" framespacing="0">' +
+            '<frame id="MDIPopupContainer" name="MDIPopupContainer"></frame>' +
+            '<frame name="frameMenu" scrolling="no" src="' +
+            OB.Application.contextUrl +
+            'utility/VerticalMenu.html?Command=HIDE" id="paramFrameMenuLoading"></frame>' +
+            '</frameset><body></body></html>';
         }
         var cPopup = isc.OBClassicPopup.create({
           ID: name + '_' + cobcomp.Popup.secString,
@@ -418,24 +498,33 @@
       // Parameters:
       // * {{{cPopup}}} type: Canvas - the drawn popup
       // * {{{postParams}}} type: Object - parameters to be sent to the url using POST instead of GET
-      postOpen: function (cPopup, postParams) {
+      postOpen: function(cPopup, postParams) {
         if (!cPopup.isFramesetDraw) {
-          cPopup.getIframeHtmlObj().contentWindow.document.write(cPopup.htmlCode);
+          cPopup
+            .getIframeHtmlObj()
+            .contentWindow.document.write(cPopup.htmlCode);
           cPopup.getIframeHtmlObj().contentWindow.document.close();
           cPopup.isFramesetDraw = true;
         }
         if (!cPopup.getIframeHtmlObj().contentWindow.frames[0].document.body) {
-          setTimeout(function () {
+          setTimeout(function() {
             cobcomp.Popup.postOpen(cPopup, postParams);
           }, 50);
           return true;
         }
         if (navigator.userAgent.toUpperCase().indexOf('MSIE') !== -1) {
           //  In IE (non-Strict) if window.open is executed against a frame, the target frame doesn't know which is its opener
-          if (typeof cPopup.getIframeHtmlObj().contentWindow.frames[0].opener === 'undefined') {
-            cPopup.getIframeHtmlObj().contentWindow.frames[0].opener = cPopup.theOpener;
-            if (typeof cPopup.getIframeHtmlObj().contentWindow.frames[0].opener === 'undefined') {
-              setTimeout(function () {
+          if (
+            typeof cPopup.getIframeHtmlObj().contentWindow.frames[0].opener ===
+            'undefined'
+          ) {
+            cPopup.getIframeHtmlObj().contentWindow.frames[0].opener =
+              cPopup.theOpener;
+            if (
+              typeof cPopup.getIframeHtmlObj().contentWindow.frames[0]
+                .opener === 'undefined'
+            ) {
+              setTimeout(function() {
                 cobcomp.Popup.postOpen(cPopup, postParams);
               }, 50);
               return true;
@@ -443,35 +532,54 @@
           }
         }
         var wName = cPopup.ID;
-        wName = wName.substring(0, wName.lastIndexOf(cobcomp.Popup.secString) - 1);
+        wName = wName.substring(
+          0,
+          wName.lastIndexOf(cobcomp.Popup.secString) - 1
+        );
         if (!cPopup.areParamsSet) {
           if (!postParams) {
-            cPopup.getIframeHtmlObj().contentWindow.frames[0].location.href = cPopup.popupURL;
+            cPopup.getIframeHtmlObj().contentWindow.frames[0].location.href =
+              cPopup.popupURL;
             if (OB.Utilities.isIE9Strict || OB.Utilities.isEdge) {
               // In IE9 Strict and Edge, when the location.href or .src is defined, the previous defined opener is lost, and it should be defined again
-              cPopup.getIframeHtmlObj().contentWindow.frames[0].opener = cPopup.theOpener;
+              cPopup.getIframeHtmlObj().contentWindow.frames[0].opener =
+                cPopup.theOpener;
               var setOpenerInterval;
-              setOpenerInterval = setInterval(
-
-              function () {
+              setOpenerInterval = setInterval(function() {
                 if (!cPopup.getIframeHtmlObj()) {
                   clearInterval(setOpenerInterval);
-                } else if (cPopup.getIframeHtmlObj().contentWindow.frames[0].document.readyState === 'complete') {
-                  if (!cPopup.getIframeHtmlObj().contentWindow.frames[0].opener) {
-                    cPopup.getIframeHtmlObj().contentWindow.frames[0].opener = cPopup.theOpener;
+                } else if (
+                  cPopup.getIframeHtmlObj().contentWindow.frames[0].document
+                    .readyState === 'complete'
+                ) {
+                  if (
+                    !cPopup.getIframeHtmlObj().contentWindow.frames[0].opener
+                  ) {
+                    cPopup.getIframeHtmlObj().contentWindow.frames[0].opener =
+                      cPopup.theOpener;
                   }
-                  if (cPopup.getIframeHtmlObj().contentWindow.frames[0].window.MDIPopupId !== wName) {
-                    cPopup.getIframeHtmlObj().contentWindow.document.getElementById('MDIPopupContainer').name = wName;
-                    cPopup.getIframeHtmlObj().contentWindow.frames[0].window.checkWindowInMDIPopup();
+                  if (
+                    cPopup.getIframeHtmlObj().contentWindow.frames[0].window
+                      .MDIPopupId !== wName
+                  ) {
+                    cPopup
+                      .getIframeHtmlObj()
+                      .contentWindow.document.getElementById(
+                        'MDIPopupContainer'
+                      ).name = wName;
+                    cPopup
+                      .getIframeHtmlObj()
+                      .contentWindow.frames[0].window.checkWindowInMDIPopup();
                   }
                 }
               }, 100);
             }
           } else {
             // Create a form and POST parameters as input hidden values
-            var doc = cPopup.getIframeHtmlObj().contentWindow.frames[0].document,
-                frm = doc.createElement('form'),
-                i;
+            var doc = cPopup.getIframeHtmlObj().contentWindow.frames[0]
+                .document,
+              frm = doc.createElement('form'),
+              i;
             frm.setAttribute('method', 'post');
             frm.setAttribute('action', cPopup.popupURL);
             for (i in postParams) {
@@ -487,11 +595,18 @@
             frm.submit();
           }
           cPopup.getIframeHtmlObj().contentWindow.frames[0].name = wName;
-          cPopup.getIframeHtmlObj().contentWindow.document.getElementById('MDIPopupContainer').name = wName;
+          cPopup
+            .getIframeHtmlObj()
+            .contentWindow.document.getElementById(
+              'MDIPopupContainer'
+            ).name = wName;
           cPopup.areParamsSet = true;
         }
-        if (cPopup.areParamsSet && cPopup.getIframeHtmlObj().contentWindow.frames[0].name !== wName) {
-          setTimeout(function () {
+        if (
+          cPopup.areParamsSet &&
+          cPopup.getIframeHtmlObj().contentWindow.frames[0].name !== wName
+        ) {
+          setTimeout(function() {
             cobcomp.Popup.postOpen(cPopup, postParams);
           }, 50);
         }
@@ -504,7 +619,7 @@
       //
       // Parameters:
       // * {{{name}}} type: String - the name of the window
-      close: function (name, cancelEvent) {
+      close: function(name, cancelEvent) {
         var activateView;
 
         name = name + '_' + cobcomp.Popup.secString;
@@ -522,7 +637,7 @@
       //
       // Parameters:
       // * {{{name}}} type: String - the name of the window
-      getPopup: function (name) {
+      getPopup: function(name) {
         return window[name + '_' + cobcomp.Popup.secString];
       },
 
@@ -534,7 +649,7 @@
       // * {{{name}}} type: String - the name of the window
       // * {{{width}}} type: Number - width to resize to
       // * {{{height}}} type: Number - height to resize to
-      resize: function (name, width, height) {
+      resize: function(name, width, height) {
         name = name + '_' + cobcomp.Popup.secString;
         window[name].resizeTo(width, height);
       },
@@ -546,7 +661,7 @@
       // Parameters:
       // * {{{name}}} type: String - the name of the window
       // * {{{title}}} type: String - the title of the window
-      setTitle: function (name, title) {
+      setTitle: function(name, title) {
         name = name + '_' + cobcomp.Popup.secString;
         window[name].setTitle(title);
       },
@@ -557,7 +672,7 @@
       //
       // Parameters:
       // * {{{name}}} type: String - the name of the window
-      isLoaded: function (name) {
+      isLoaded: function(name) {
         name = name + '_' + cobcomp.Popup.secString;
         if (window[name].isLoaded) {
           return true;
@@ -566,14 +681,13 @@
         }
       },
 
-
       /** Upgrading process pop ups **/
-      standardUpgrading: function () {
+      standardUpgrading: function() {
         var actionButton = isc.addProperties({}, isc.Dialog.OK, {
-          getTitle: function () {
+          getTitle: function() {
             return '<b>' + OB.I18N.getLabel('OBUIAPP_LogOut') + '</b>';
           },
-          click: function () {
+          click: function() {
             this.topElement.cancelClick();
             OB.Utilities.logout(true);
           }
@@ -587,19 +701,23 @@
         });
       },
 
-      openAPRMPopup: function () {
+      openAPRMPopup: function() {
         var actionButton = isc.addProperties({}, isc.Dialog.OK, {
-          getTitle: function () {
-            return '<b>' + OB.I18N.getLabel('OBUIAPP_UpgradeRunAPRMBtn') + '</b>';
+          getTitle: function() {
+            return (
+              '<b>' + OB.I18N.getLabel('OBUIAPP_UpgradeRunAPRMBtn') + '</b>'
+            );
           },
-          click: function () {
+          click: function() {
             this.topElement.cancelClick();
             OB.Layout.ViewManager.openView('OBClassicWindow', {
               command: 'DEFAULT',
               formId: 'E4F4AAC7DD6D4FBDA3AF973B7767F374',
               icon: 'Form',
-              id: '/org.openbravo.erputil.aprmigrationtool.ad_forms/MigrationTool.html',
-              obManualURL: '/org.openbravo.erputil.aprmigrationtool.ad_forms/MigrationTool.html',
+              id:
+                '/org.openbravo.erputil.aprmigrationtool.ad_forms/MigrationTool.html',
+              obManualURL:
+                '/org.openbravo.erputil.aprmigrationtool.ad_forms/MigrationTool.html',
               tabTitle: OB.I18N.getLabel('APRMT_MigrationToolTitle'),
               viewId: 'OBClassicWindow'
             });
@@ -614,9 +732,9 @@
         });
       },
 
-      openConfigScriptPopup: function (scripts) {
+      openConfigScriptPopup: function(scripts) {
         var actionButton = isc.addProperties({}, isc.Dialog.OK, {
-          click: function () {
+          click: function() {
             this.topElement.cancelClick();
           }
         });
@@ -629,9 +747,9 @@
         });
       },
 
-      openSuccessUpgradePopup: function () {
+      openSuccessUpgradePopup: function() {
         var actionButton = isc.addProperties({}, isc.Dialog.OK, {
-          click: function () {
+          click: function() {
             this.topElement.cancelClick();
             OB.PropertyStore.set('isUpgrading', 'N', null, false, true);
           }
@@ -649,19 +767,39 @@
       // ** {{{ Popup.openInstancePurpose() }}} **
       //
       // Opens directly the "Instance Purpose" window inside a popup
-      openInstancePurpose: function () {
-        cobcomp.Popup.open('InstancePurpose', 600, 500, OB.Application.contextUrl + 'ad_forms/InstancePurpose.html', '', window, false, false, true);
+      openInstancePurpose: function() {
+        cobcomp.Popup.open(
+          'InstancePurpose',
+          600,
+          500,
+          OB.Application.contextUrl + 'ad_forms/InstancePurpose.html',
+          '',
+          window,
+          false,
+          false,
+          true
+        );
       },
 
       // ** {{{ Popup.openHeartbeat() }}} **
       //
       // Opens directly the "Heartbeat" window inside a popup
-      openHeartbeat: function () {
-        cobcomp.Popup.open('Heartbeat', 600, 500, OB.Application.contextUrl + 'ad_forms/Heartbeat.html', '', window, false, false, true);
+      openHeartbeat: function() {
+        cobcomp.Popup.open(
+          'Heartbeat',
+          600,
+          500,
+          OB.Application.contextUrl + 'ad_forms/Heartbeat.html',
+          '',
+          window,
+          false,
+          false,
+          true
+        );
       }
     }
   };
 
   // Initialize ClassicOBCompatibility object
   cobcomp = L.ClassicOBCompatibility = new ClassicOBCompatibility();
-}(OB, isc));
\ No newline at end of file
+})(OB, isc);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-help.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-help.js	Wed Jun 12 10:59:13 2019 +0200
@@ -44,8 +44,9 @@
 OB.I18N.getLabel('OBUIAPP_Loading', null, isc.ClassicOBHelp, 'loadingMessage');
 
 isc.ClassicOBHelp.addMethods({
-  initWidget: function (args) {
-    this.contentsURL = this.appURL + '?url=/ad_help/DisplayHelp.html&hideMenu=true&noprefs=true';
+  initWidget: function(args) {
+    this.contentsURL =
+      this.appURL + '?url=/ad_help/DisplayHelp.html&hideMenu=true&noprefs=true';
     if (this.windowId) {
       this.contentsURL = this.contentsURL + '&inpwindowId=' + this.windowId;
     }
@@ -58,9 +59,9 @@
     this.Super('initWidget', args);
   },
 
-  // The following methods are involved in making sure that a help tab for a 
+  // The following methods are involved in making sure that a help tab for a
   // certain window is only opened once.
-  getBookMarkParams: function () {
+  getBookMarkParams: function() {
     var result = {};
     if (this.windowId) {
       result.windowId = this.windowId;
@@ -75,26 +76,35 @@
     return result;
   },
 
-  isEqualParams: function (params) {
+  isEqualParams: function(params) {
     if (!params || params.viewId !== 'ClassicOBHelp') {
       return false;
     }
-    if ((this.windowId || params.windowId) && params.windowId !== this.windowId) {
+    if (
+      (this.windowId || params.windowId) &&
+      params.windowId !== this.windowId
+    ) {
       return false;
     }
 
-    if ((this.windowType || params.windowType) && params.windowType !== this.windowType) {
+    if (
+      (this.windowType || params.windowType) &&
+      params.windowType !== this.windowType
+    ) {
       return false;
     }
 
-    if ((this.windowName || params.windowName) && params.windowName !== this.windowName) {
+    if (
+      (this.windowName || params.windowName) &&
+      params.windowName !== this.windowName
+    ) {
       return false;
     }
 
     return true;
   },
 
-  isSameTab: function (viewId, params) {
+  isSameTab: function(viewId, params) {
     if (viewId !== 'ClassicOBHelp') {
       return false;
     }
@@ -104,4 +114,4 @@
     }
     return false;
   }
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-popup.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-popup.js	Wed Jun 12 10:59:13 2019 +0200
@@ -35,19 +35,35 @@
 });
 
 isc.OBPopupClassicWindow.addMethods({
-  show: function () {
+  show: function() {
     var urlCharacter = '?',
-        contentsURL;
+      contentsURL;
     if (this.appURL.indexOf('?') !== -1) {
       urlCharacter = '&';
     }
     if (this.obManualURL !== '') {
-      contentsURL = OB.Utilities.applicationUrl(this.obManualURL) + '?Command=' + this.command;
+      contentsURL =
+        OB.Utilities.applicationUrl(this.obManualURL) +
+        '?Command=' +
+        this.command;
     } else {
-      contentsURL = this.appURL + urlCharacter + 'Command=' + this.command + '&noprefs=true&tabId=' + this.tabId + '&hideMenu=true';
+      contentsURL =
+        this.appURL +
+        urlCharacter +
+        'Command=' +
+        this.command +
+        '&noprefs=true&tabId=' +
+        this.tabId +
+        '&hideMenu=true';
     }
 
-    OB.Utilities.openProcessPopup(contentsURL, false, this.postParams, this.height, this.width);
+    OB.Utilities.openProcessPopup(
+      contentsURL,
+      false,
+      this.postParams,
+      this.height,
+      this.width
+    );
   }
 });
 
@@ -57,10 +73,21 @@
 //
 isc.defineClass('OBClassicPopupModal', isc.Class).addProperties({
   showsItself: true,
-  show: function () {
-    OB.Layout.ClassicOBCompatibility.Popup.open(this.id, 625, 450, OB.Utilities.applicationUrl(this.obManualURL) + '?Command=' + this.command, '', null, false, false, true);
+  show: function() {
+    OB.Layout.ClassicOBCompatibility.Popup.open(
+      this.id,
+      625,
+      450,
+      OB.Utilities.applicationUrl(this.obManualURL) +
+        '?Command=' +
+        this.command,
+      '',
+      null,
+      false,
+      false,
+      true
+    );
   }
-
 });
 
 isc.ClassFactory.defineClass('OBClassicPopup', isc.OBPopup);
@@ -71,8 +98,7 @@
 // the OBPopup type (declared in the ob-popup.js file).
 //
 isc.OBClassicPopup.addProperties({
-
-  init: function () {
+  init: function() {
     if (typeof this.width === 'string' && this.width.indexOf('%') !== -1) {
       this.percentualWidth = true;
     }
@@ -82,11 +108,12 @@
     this.Super('init', arguments);
   },
 
-  initWidget: function () {
+  initWidget: function() {
     this.items = [
-    isc.OBPopupHTMLFlow.create({
-      contentsURL: ''
-    })];
+      isc.OBPopupHTMLFlow.create({
+        contentsURL: ''
+      })
+    ];
     this.Super('initWidget', arguments);
     var frameWidth, frameHeight;
     if (!this.percentualWidth) {
@@ -123,7 +150,7 @@
   percentualWidth: false,
   percentualHeight: false,
 
-  getIframeHtmlObj: function () {
+  getIframeHtmlObj: function() {
     var container, iframes;
     container = this.getHandle();
     if (container && container.getElementsByTagName) {
@@ -134,4 +161,4 @@
     }
     return null;
   }
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-window.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-window.js	Wed Jun 12 10:59:13 2019 +0200
@@ -19,8 +19,8 @@
 
 // = OB Classic Window =
 //
-// Implements the view which shows a classic OB window in a Smartclient HTMLFlow component. The 
-// classic OB window is shown in a tab in the multi-tab interface. 
+// Implements the view which shows a classic OB window in a Smartclient HTMLFlow component. The
+// classic OB window is shown in a tab in the multi-tab interface.
 //
 isc.defineClass('OBClassicWindow', isc.HTMLPane).addProperties({
   showsItself: false,
@@ -53,11 +53,17 @@
 });
 
 isc.OBClassicWindow.addMethods({
-
   // ** {{{ updateTabInformation }}} **
   //
   // Is called to update the tab information of an opened classic window.
-  updateTabInformation: function (windowId, tabId, recordId, command, obManualURL, title) {
+  updateTabInformation: function(
+    windowId,
+    tabId,
+    recordId,
+    command,
+    obManualURL,
+    title
+  ) {
     // ignore the first time
     if (this.ignoreTabInfoUpdate) {
       this.ignoreTabInfoUpdate = false;
@@ -83,40 +89,65 @@
   //
   // Is used to handle the refresh keyboard shortcut, clicks the refresh button
   // of a classic window.
-  refreshTab: function () {
+  refreshTab: function() {
     if (this.getAppFrameWindow()) {
-      this.getAppFrameWindow().document.getElementById('buttonRefresh').onclick();
+      this.getAppFrameWindow()
+        .document.getElementById('buttonRefresh')
+        .onclick();
     }
   },
 
   // ** {{{ tabSelected }}} **
   //
   // Is used to place the focus in a tab after one of the flyouts is closed.
-  tabSelected: function () {
+  tabSelected: function() {
     var appFrameWindow = this.getAppFrameWindow();
-    if (appFrameWindow && appFrameWindow.putFocusOnWindow && !appFrameWindow.OB_NoRefocusAfterTabSelection) {
+    if (
+      appFrameWindow &&
+      appFrameWindow.putFocusOnWindow &&
+      !appFrameWindow.OB_NoRefocusAfterTabSelection
+    ) {
       appFrameWindow.putFocusOnWindow();
     }
   },
 
-  initWidget: function (args) {
+  initWidget: function(args) {
     var urlCharacter = '?';
     if (this.appURL.indexOf('?') !== -1) {
       urlCharacter = '&';
     }
     if (this.keyParameter) {
-      this.contentsURL = this.appURL + urlCharacter + 'url=' + this.mappingName + '&' + this.keyParameter + '=' + this.recordId + '&noprefs=true&Command=DIRECT&hideMenu=true';
+      this.contentsURL =
+        this.appURL +
+        urlCharacter +
+        'url=' +
+        this.mappingName +
+        '&' +
+        this.keyParameter +
+        '=' +
+        this.recordId +
+        '&noprefs=true&Command=DIRECT&hideMenu=true';
     } else if (this.obManualURL && this.obManualURL !== '') {
       this.obManualURL = this.obManualURL.replace('?', '&');
 
-      this.contentsURL = this.appURL + urlCharacter + 'url=' + this.obManualURL + '&noprefs=true&hideMenu=true';
+      this.contentsURL =
+        this.appURL +
+        urlCharacter +
+        'url=' +
+        this.obManualURL +
+        '&noprefs=true&hideMenu=true';
 
       if (this.obManualURL.indexOf('Command=') === -1) {
         // Add command in case it is not already set in the obManualURL
         this.contentsURL = this.contentsURL + '&Command=' + this.command;
       }
     } else {
-      this.contentsURL = this.appURL + urlCharacter + 'Command=' + this.command + '&noprefs=true';
+      this.contentsURL =
+        this.appURL +
+        urlCharacter +
+        'Command=' +
+        this.command +
+        '&noprefs=true';
       if (this.recordId !== '') {
         this.contentsURL = this.contentsURL + '&windowId=' + this.windowId;
       }
@@ -136,7 +167,7 @@
   //
   // Returns the contentWindow object of the iframe implementing the classic
   // window.
-  getIframeWindow: function () {
+  getIframeWindow: function() {
     var container, iframes;
 
     container = this.getHandle();
@@ -144,7 +175,7 @@
     if (container && container.getElementsByTagName) {
       iframes = container.getElementsByTagName('iframe');
       if (iframes.length > 0) {
-        return (iframes[0].contentWindow ? iframes[0].contentWindow : null);
+        return iframes[0].contentWindow ? iframes[0].contentWindow : null;
       }
     }
     return null;
@@ -154,14 +185,14 @@
   //
   // Returns the appFrame object of the contentWindow of the iframe implementing
   // the classic window.
-  getAppFrameWindow: function () {
+  getAppFrameWindow: function() {
     var iframe;
     if (this.appFrameWindow !== null) {
       return this.appFrameWindow;
     }
     iframe = this.getIframeWindow();
     try {
-      this.appFrameWindow = (iframe && iframe.appFrame ? iframe.appFrame : null); // caching reference
+      this.appFrameWindow = iframe && iframe.appFrame ? iframe.appFrame : null; // caching reference
     } catch (e) {
       //To avoid cross-domain JS error (in case it exists)
       this.appFrameWindow = null;
@@ -171,7 +202,7 @@
 
   // The following methods are related to history management, i.e. that a
   // specific window is only opened once.
-  getBookMarkParams: function () {
+  getBookMarkParams: function() {
     var result = {};
     if (this.recordId) {
       result.recordId = this.recordId;
@@ -203,12 +234,20 @@
     return result;
   },
 
-  isEqualParams: function (params) {
-    if (params && (this.recordId || params.recordId) && params.recordId !== this.recordId) {
+  isEqualParams: function(params) {
+    if (
+      params &&
+      (this.recordId || params.recordId) &&
+      params.recordId !== this.recordId
+    ) {
       return false;
     }
 
-    if (params && (this.command || params.command) && params.command !== this.command) {
+    if (
+      params &&
+      (this.command || params.command) &&
+      params.command !== this.command
+    ) {
       return false;
     }
 
@@ -216,38 +255,66 @@
       return false;
     }
 
-    if (params && (this.formId || params.formId) && params.formId !== this.formId) {
+    if (
+      params &&
+      (this.formId || params.formId) &&
+      params.formId !== this.formId
+    ) {
       return false;
     }
 
-    if (params && (this.windowId || params.windowId) && params.windowId !== this.windowId) {
+    if (
+      params &&
+      (this.windowId || params.windowId) &&
+      params.windowId !== this.windowId
+    ) {
       return false;
     }
 
-    if (params && (this.processId || params.processId) && params.processId !== this.processId) {
+    if (
+      params &&
+      (this.processId || params.processId) &&
+      params.processId !== this.processId
+    ) {
       return false;
     }
 
     return true;
   },
 
-  isSameTab: function (viewName, params) {
+  isSameTab: function(viewName, params) {
     if (viewName !== 'OBClassicWindow') {
       return false;
     }
-    if (params && (params.obManualURL || this.obManualURL) && params.obManualURL === this.obManualURL) {
+    if (
+      params &&
+      (params.obManualURL || this.obManualURL) &&
+      params.obManualURL === this.obManualURL
+    ) {
       return true;
     }
 
-    if (params && (this.windowId || params.windowId) && params.windowId === this.windowId) {
+    if (
+      params &&
+      (this.windowId || params.windowId) &&
+      params.windowId === this.windowId
+    ) {
       return true;
     }
 
-    if (params && (this.processId || params.processId) && params.processId === this.processId) {
+    if (
+      params &&
+      (this.processId || params.processId) &&
+      params.processId === this.processId
+    ) {
       return true;
     }
 
-    if (params && (this.formId || params.formId) && params.formId === this.formId) {
+    if (
+      params &&
+      (this.formId || params.formId) &&
+      params.formId === this.formId
+    ) {
       return true;
     }
 
@@ -261,7 +328,7 @@
   // ** {{{ getHelpView }}} **
   //
   // Returns the view definition of the help window for this classic window.
-  getHelpView: function () {
+  getHelpView: function() {
     if (this.windowId) {
       // tabTitle is set in the viewManager
       return {
@@ -298,10 +365,13 @@
   // Is used for supporting autosave, saves the specific tab of the window.
   // Calls the server to do the actual save, the response calls the callback
   // method.
-  saveRecord: function ( /* String */ tabID, /* Function */ callback) {
-    var postData, reqObj, appFrame = this.appFrameWindow || this.getAppFrameWindow(),
-        saveCallback = callback || this.ID + '.saveCallback(rpcResponse, data, rpcRequest)',
-        tabid = tabID || '';
+  saveRecord: function(/* String */ tabID, /* Function */ callback) {
+    var postData,
+      reqObj,
+      appFrame = this.appFrameWindow || this.getAppFrameWindow(),
+      saveCallback =
+        callback || this.ID + '.saveCallback(rpcResponse, data, rpcRequest)',
+      tabid = tabID || '';
 
     postData = {};
     OB.Utilities.addFormInputsToCriteria(postData, appFrame);
@@ -323,9 +393,9 @@
   // ** {{{ saveCallback }}} **
   //
   // If the save is successfull closes the tab.
-  saveCallback: function (rpcResponse, data, rpcRequest) {
+  saveCallback: function(rpcResponse, data, rpcRequest) {
     var result = eval('(' + data + ')'),
-        appFrame = this.appFrameWindow || this.getAppFrameWindow();
+      appFrame = this.appFrameWindow || this.getAppFrameWindow();
     if (result && result.oberror) {
       if (result.oberror.type === 'Success') {
         appFrame.isUserChanges = false;
@@ -338,9 +408,10 @@
 
   // Waits until the iFrame has been loaded, and sets it as activeFrame
   // See issue https://issues.openbravo.com/view.php?id=25558
-  setAsActiveIFrame: function (nCalls) {
-    var iFrame, me = this,
-        parentFrame;
+  setAsActiveIFrame: function(nCalls) {
+    var iFrame,
+      me = this,
+      parentFrame;
     if (!nCalls) {
       nCalls = 0;
     } else if (nCalls > 20) {
@@ -349,7 +420,7 @@
     }
     iFrame = this.getAppFrameWindow();
     if (!iFrame) {
-      setTimeout(function () {
+      setTimeout(function() {
         me.setAsActiveIFrame(nCalls++);
       }, 500);
     } else {
@@ -367,4 +438,4 @@
 // Maintained to support recent items which use the old name
 // NOTE: can be removed when the user interface is released in production in Q1 2011
 // at that time the recent items should have been cleaned up
-isc.defineClass('ClassicOBWindow', isc.OBClassicWindow);
\ No newline at end of file
+isc.defineClass('ClassicOBWindow', isc.OBClassicWindow);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/costing/ob-lc-matchfrominvoice.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/costing/ob-lc-matchfrominvoice.js	Wed Jun 12 10:59:13 2019 +0200
@@ -19,36 +19,64 @@
 
 OB.Costing = OB.Costing || {};
 
-OB.Costing.MatchFromInvoiceAmtValidation = function (item, validator, value, record) {
+OB.Costing.MatchFromInvoiceAmtValidation = function(
+  item,
+  validator,
+  value,
+  record
+) {
   var selectedRecords = item.grid.getSelectedRecords(),
-      selectedRecordsLength = selectedRecords.length,
-      context = item.grid.view.parentWindow.activeView.getContextInfo(false, false, false, true),
-      matchedamt = BigDecimal.prototype.ZERO,
-      editedRecord, i, invoiceamt;
+    selectedRecordsLength = selectedRecords.length,
+    context = item.grid.view.parentWindow.activeView.getContextInfo(
+      false,
+      false,
+      false,
+      true
+    ),
+    matchedamt = BigDecimal.prototype.ZERO,
+    editedRecord,
+    i,
+    invoiceamt;
 
   invoiceamt = new BigDecimal(String(context['@InvoiceLine.lineNetAmount@']));
   if (!isc.isA.Number(value)) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_NotValidNumber'));
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('APRM_NotValidNumber')
+    );
     return false;
   }
   // Check that matched amount is not higher than invoice line net amount
   for (i = 0; i < selectedRecordsLength; i++) {
-    editedRecord = isc.addProperties({}, selectedRecords[i], item.grid.getEditedRecord(selectedRecords[i]));
+    editedRecord = isc.addProperties(
+      {},
+      selectedRecords[i],
+      item.grid.getEditedRecord(selectedRecords[i])
+    );
     if (editedRecord.matchedAmt) {
-      matchedamt = matchedamt.add(new BigDecimal(String(editedRecord.matchedAmt)));
+      matchedamt = matchedamt.add(
+        new BigDecimal(String(editedRecord.matchedAmt))
+      );
     }
   }
   if (matchedamt.compareTo(invoiceamt) > 0) {
-    item.grid.view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('OBUIAPP_Costing_MachedMoreThanInvoice', [invoiceamt.toString()]));
+    item.grid.view.messageBar.setMessage(
+      isc.OBMessageBar.TYPE_ERROR,
+      null,
+      OB.I18N.getLabel('OBUIAPP_Costing_MachedMoreThanInvoice', [
+        invoiceamt.toString()
+      ])
+    );
     return false;
   }
 
   return true;
 };
 
-OB.Costing.MatchFromInvoiceAmtSelectionChange = function (grid, record, state) {
+OB.Costing.MatchFromInvoiceAmtSelectionChange = function(grid, record, state) {
   if (!state && record.matched) {
-    // do not allow to deselect matched records. 
+    // do not allow to deselect matched records.
     grid.selectRecord(record);
   }
-};
\ No newline at end of file
+};
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-canvas.js	Wed Jun 12 10:59:13 2019 +0200
@@ -29,28 +29,32 @@
   shouldSaveValue: true,
   // if the canvas is used somewhere else (in the statusbar) then
   // don't do placeCanvas.
-  placeCanvas: function () {
+  placeCanvas: function() {
     if (this.canvas && !this.canvas.inStatusBar) {
       this.Super('placeCanvas', arguments);
     }
   },
 
-  showValue: function (displayValue, dataValue, form, item) {
+  showValue: function(displayValue, dataValue, form, item) {
     if (this.canvas && this.canvas.showValue) {
       this.canvas.showValue(displayValue, dataValue, form, item);
     }
   },
 
-  createCanvas: function () {
+  createCanvas: function() {
     var canvas, clientClassArray, clientClass, clientClassProps;
 
     clientClassArray = OB.Utilities.clientClassSplitProps(this.clientClass);
     clientClass = clientClassArray[0];
     clientClassProps = clientClassArray[1];
 
-    canvas = isc.ClassFactory.newInstance(clientClass, {
-      canvasItem: this
-    }, clientClassProps);
+    canvas = isc.ClassFactory.newInstance(
+      clientClass,
+      {
+        canvasItem: this
+      },
+      clientClassProps
+    );
 
     if (!canvas) {
       return isc.Label.create({
@@ -67,20 +71,24 @@
     }
 
     if (this.form.itemChanged && canvas.onItemChanged) {
-      canvas.observe(this.form, 'itemChanged', 'observer.onItemChanged(observed)');
+      canvas.observe(
+        this.form,
+        'itemChanged',
+        'observer.onItemChanged(observed)'
+      );
     }
 
     return canvas;
   },
 
-  destroy: function () {
+  destroy: function() {
     if (this.canvas && this.form) {
       this.canvas.ignore(this.form, 'itemChanged');
     }
     return this.Super('destroy', arguments);
   },
 
-  redrawing: function () {
+  redrawing: function() {
     if (this.canvas.redrawingItem) {
       this.canvas.redrawingItem();
     }
@@ -99,16 +107,23 @@
   width: 1,
   overflow: 'visible',
 
-  setRecord: function (record) {
+  setRecord: function(record) {
     var val = record[this.field.name];
-    if (this.field && this.field.type && isc.SimpleType.getType(this.field.type).normalDisplayFormatter) {
-      this.showValue(isc.SimpleType.getType(this.field.type).normalDisplayFormatter(val), val);
+    if (
+      this.field &&
+      this.field.type &&
+      isc.SimpleType.getType(this.field.type).normalDisplayFormatter
+    ) {
+      this.showValue(
+        isc.SimpleType.getType(this.field.type).normalDisplayFormatter(val),
+        val
+      );
     } else {
       this.showValue(String(record[this.field.name]));
     }
   },
 
-  showValue: function (displayValue, dataValue, form, item) {
+  showValue: function(displayValue, dataValue, form, item) {
     if (!dataValue || displayValue === '0') {
       this.setContents(displayValue);
     } else if (!displayValue) {
@@ -128,16 +143,23 @@
   width: 1,
   overflow: 'visible',
 
-  setRecord: function (record) {
+  setRecord: function(record) {
     var val = record[this.field.name];
-    if (this.field && this.field.type && isc.SimpleType.getType(this.field.type).normalDisplayFormatter) {
-      this.showValue(isc.SimpleType.getType(this.field.type).normalDisplayFormatter(val), val);
+    if (
+      this.field &&
+      this.field.type &&
+      isc.SimpleType.getType(this.field.type).normalDisplayFormatter
+    ) {
+      this.showValue(
+        isc.SimpleType.getType(this.field.type).normalDisplayFormatter(val),
+        val
+      );
     } else {
       this.showValue(String(record[this.field.name]));
     }
   },
 
-  showValue: function (displayValue, dataValue, form, item) {
+  showValue: function(displayValue, dataValue, form, item) {
     if (!displayValue) {
       this.setContents('0 %');
     } else {
@@ -162,19 +184,19 @@
   width: 1,
   height: 1,
 
-  setState: function () {
+  setState: function() {
     //To avoid add "_Disabled" to the src image if the grid row is disabled
     return '';
   },
 
-  click: function () {
+  click: function() {
     if (this.grid) {
       this.grid.selectSingleRecord(this.record);
     }
     return this.Super('click', arguments);
   },
 
-  setValue: function (value) {
+  setValue: function(value) {
     var i;
     if (!value) {
       if (this.value) {
@@ -188,11 +210,22 @@
         value = i;
       }
     }
-    if (typeof value === 'number' && value >= 0 && value < this.valuesList.length) {
+    if (
+      typeof value === 'number' &&
+      value >= 0 &&
+      value < this.valuesList.length
+    ) {
       this.value = value;
       this.setWidth(41);
       this.setHeight(20);
-      this.setSrc(OB.Styles.skinsPath + 'Default/org.openbravo.client.application/images/form/levelImg_' + value.toString() + '_' + (this.valuesList.length - 1).toString() + '.png');
+      this.setSrc(
+        OB.Styles.skinsPath +
+          'Default/org.openbravo.client.application/images/form/levelImg_' +
+          value.toString() +
+          '_' +
+          (this.valuesList.length - 1).toString() +
+          '.png'
+      );
     } else {
       this.value = null;
       this.setWidth(1);
@@ -201,13 +234,13 @@
     }
   },
 
-  showValue: function (displayValue, dataValue, form, item) {
+  showValue: function(displayValue, dataValue, form, item) {
     this.setValue(dataValue);
   },
 
-  setRecord: function (record) {
+  setRecord: function(record) {
     if (this.field && this.field.name && record[this.field.name]) {
       this.setValue(record[this.field.name]);
     }
   }
-});
\ No newline at end of file
+});
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-characteristics.js	Wed Jun 12 10:25:32 2019 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-characteristics.js	Wed Jun 12 10:59:13 2019 +0200
@@ -22,10 +22,8 @@
 isc.OBCharacteristicsItem.addProperties({
   completeValue: null,
   showTitle: false,
-  init: function () {
-    this.canvas = isc.OBCharacteristicsLayout.create({
-
-    });
+  init: function() {
+    this.canvas = isc.OBCharacteristicsLayout.create({});
 
     this.colSpan = 4;
     this.disabled = false;
@@ -33,9 +31,10 @@
     this.Super('init', arguments);
   },
 
-  setValue: function (value) {
-    var field, formFields = [],
-        itemIds = [];
+  setValue: function(value) {
+    var field,
+      formFields = [],
+      itemIds = [];
 
     this.completeValue = value;
     if (!value || !value.characteristics) {
@@ -77,14 +76,13 @@
       itemIds: itemIds
     });
 
-
     this.canvas.setFields(formFields);
 
     // actual value is the one in DB
     this.setValue(value.dbValue);
   },
 
-  destroy: function () {
+  destroy: function() {
     if (this.canvas && typeof this.canvas.destroy === 'function') {
       this.canvas.destroy();
       this.canvas = null;
@@ -140,7 +138,7 @@
     width: 80,
     canFocus: true,
     autoParent: 'buttonLayout',
-    click: function () {
+    click: function() {
       this.creator.accept();
     }
   },
@@ -151,7 +149,7 @@
     width: 80,
     canFocus: true,
     autoParent: 'buttonLayout',
-    click: function () {
+    click: function() {
       this.creator.clearValues();
     }
   },
@@ -162,7 +160,7 @@
     width: 80,
     canFocus: true,
     autoParent: 'buttonLayout',
-    click: function () {
+    click: function() {
       this.creator.cancel();
     }
   },
@@ -174,11 +172,15 @@
    *   -Filtering: includes all selected leaf nodes
    *   -Visualization: includes the top in branch fully selected nodes
    */
-  getValue: function () {
+  getValue: function() {
     var selection = this.tree.getSelection(),
-        result = {},
-        i, c, completeParentNodes = [],
-        node, currentChar, grandParent;
+      result = {},
+      i,
+      c,
+      completeParentNodes = [],
+      node,
+      currentChar,
+      grandParent;
 
     for (i = 0; i < selection.length; i++) {
       node = selection[i];
@@ -230,24 +232,26 @@
     return result;
   },
 
-  accept: function () {
+  accept: function() {
     if (this.callback) {
       this.fireCallback(this.callback, 'value', [this.getValue()]);
     }
     this.hide();
   },
 
-  clearValues: function () {
+  clearValues: function() {
     this.tree.deselectAllRecords();
   },
 
-  cancel: function () {
+  cancel: function() {
     this.hide();
   },
 
-  initWidget: function () {
+  initWidget: function() {
     var me = this,
-        dataArrived, checkInitialNodes, getNodeByID;
+      dataArrived,
+      checkInitialNodes,
+      getNodeByID;
 
     this.Super('initWidget', arguments);
 
@@ -258,15 +262,17 @@
     });
     this.mainLayout.addMember(this.selectionVisualization);
 
-
-
     /**
      * Overrides dataArrived to initialize the tree initial selection
      * based on the filter initial criteria
      */
-    dataArrived = function () {
+    dataArrived = function() {
       this.Super('dataArrived', arguments);
-      if (this.topElement && this.topElement.creator && this.topElement.creator.internalValue) {
+      if (
+        this.topElement &&
+        this.topElement.creator &&
+        this.topElement.creator.internalValue
+      ) {
         this.checkInitialNodes(this.topElement.creator.internalValue);
       }
     };
@@ -275,7 +281,7 @@
      * Marks the checkboxes of the nodes that
      * are present in the initial criteria
      */
-    checkInitialNodes = function (internalValue) {
+    checkInitialNodes = function(internalValue) {
       var c, v, value, node, characteristic;
       for (c in internalValue) {
         if (internalValue.hasOwnProperty(c)) {
@@ -296,8 +302,10 @@
     /**
      * Returns a tree node given its id
      */
-    getNodeByID = function (nodeId) {
-      var i, node, nodeList = this.data.getNodeList();
+    getNodeByID = function(nodeId) {
+      var i,
+        node,
+        nodeList = this.data.getNodeList();
       for (i = 0; i < nodeList.length; i++) {
         node = nodeList[i];
         if (node.id === nodeId) {
@@ -326,20 +334,36 @@
       showSelectedStyle: false,
       showPartialSelection: true,
       cascadeSelection: true,
-      selectionChanged: function () {
-        me.fireOnPause('updateCharacteristicsText', function () {
-          //fire on pause because selecting a node raises several time selectionChanged to select its parants
-          me.selectionVisualization.setContents(isc.OBCharacteristicsFilterItem.getDisplayValue(me.getValue()).asHTML());
-        }, 100);
+      selectionChanged: function() {
+        me.fireOnPause(
+          'updateCharacteristicsText',
+          function() {
+            //fire on pause because selecting a node raises several time selectionChanged to select its parants
+            me.selectionVisualization.setContents(
+              isc.OBCharacteristicsFilterItem.getDisplayValue(
+                me.getValue()
+              ).asHTML()
+            );
+          },
+          100
+        );
       },
 
-      setDataSource: function (ds, fields) {
-
-        ds.transformRequest = function (dsRequest) {
-          var filterDialog = me;
+      setDataSource: function(ds, fields) {
+        ds.transformRequest = function(dsRequest) {
           dsRequest.params = dsRequest.params || {};
-          if (me.creator && me.creator.parentGrid && me.creator.parentGrid.view && me.creator.parentGrid.view.buttonOwnerView) {
-            dsRequest.params._buttonOwnerContextInfo = me.creator.parentGrid.view.buttonOwnerView.getContextInfo(false, true, true, false);
+          if (
+            me.creator &&
+            me.creator.parentGrid &&
+            me.creator.parentGrid.view &&
+            me.creator.parentGrid.view.buttonOwnerView
+          ) {
+            dsRequest.params._buttonOwnerContextInfo = me.creator.parentGrid.view.buttonOwnerView.getContextInfo(
+              false,
+              true,
+              true,
+              false
+            );
           }
           return this.Super('transformRequest', arguments);
         };
@@ -363,7 +387,12 @@
       }
     });
 
-    OB.Datasource.get('BE2735798ECC4EF88D131F16F1C4EC72', this.tree, null, true);
+    OB.Datasource.get(
+      'BE2735798ECC4EF88D131F16F1C4EC72',
+      this.tree,
+      null,
+      true
+    );
 
     this.mainLayout.addMember(this.tree);
     this.addAutoChild('buttonLayout');
@@ -383,13 +412,16 @@
   }
 });
 
-
 isc.ClassFactory.defineClass('OBCharacteristicsFilterItem', isc.OBTextItem);
 
 isc.OBCharacteristicsFilterItem.addClassProperties({
-  getDisplayValue: function (displayValue) {
-    var c, characteristic, v, value, hasAny = false,
-        result = '';
+  getDisplayValue: function(displayValue) {
+    var c,
+      characteristic,
+      v,
+      value,
+      hasAny = false,
+      result = '';
 
     for (c in displayValue) {
       if (displayValue.hasOwnProperty(c)) {
@@ -420,28 +452,30 @@
   allowExpressions: true,
   canEdit: false,
   disableIconsOnReadOnly: false,
-  hqlExists: 'exists (from ProductCharacteristicValue v where {productInEntity} = v.product and v.characteristicValue.id in ($value))',
+  hqlExists:
+    'exists (from ProductCharacteristicValue v where {productInEntity} = v.product and v.characteristicValue.id in ($value))',
   showPickerIcon: false,
   filterDialogConstructor: isc.OBCharacteristicsFilterDialog,
   propertyName: null,
   pickerIconDefaults: {
     name: 'showDateRange',
-    src: OB.Styles.skinsPath + 'Default/org.openbravo.client.application/images/form/productCharacteristicsFilter_ico.png',
+    src:
+      OB.Styles.skinsPath +
+      'Default/org.openbravo.client.application/images/form/productCharacteristicsFilter_ico.png',
     width: 21,
     height: 21,
     showOver: false,
     showFocused: false,
     showFocusedWithItem: false,
     hspace: 0,
-    click: f