diff --git a/src/components/ADempiere/Field/index.vue b/src/components/ADempiere/Field/index.vue index 743104b8..8ba4ab2f 100644 --- a/src/components/ADempiere/Field/index.vue +++ b/src/components/ADempiere/Field/index.vue @@ -48,7 +48,7 @@ diff --git a/src/components/ADempiere/Field/popover/calculator/index.vue b/src/components/ADempiere/Field/popover/calculator/index.vue index 686e5b97..f03a52aa 100644 --- a/src/components/ADempiere/Field/popover/calculator/index.vue +++ b/src/components/ADempiere/Field/popover/calculator/index.vue @@ -156,33 +156,33 @@ export default { } }, changeValue() { - // const newValue = Number(this.valueToDisplay) - // let isSendCallout = true - // const isSendToServer = true - // const isChangedOldValue = false - // if (this.fieldAttributes.isAdvancedQuery) { - // isSendCallout = false - // } - // - // const sendParameters = { - // parentUuid: this.fieldAttributes.parentUuid, - // containerUuid: this.fieldAttributes.containerUuid, - // field: this.fieldAttributes, - // panelType: this.fieldAttributes.panelType, - // columnName: this.fieldAttributes.columnName, - // newValue, - // isAdvancedQuery: this.fieldAttributes.isAdvancedQuery, - // isSendToServer, - // isSendCallout, - // isChangedOldValue - // } - // this.$store.dispatch('notifyFieldChange', { - // ...sendParameters - // }) - // .finally(() => { - // this.clearVariables() - // this.$children[0].visible = false - // }) + const newValue = Number(this.valueToDisplay) + let isSendCallout = true + const isSendToServer = true + const isChangedOldValue = false + if (this.fieldAttributes.isAdvancedQuery) { + isSendCallout = false + } + + const sendParameters = { + parentUuid: this.fieldAttributes.parentUuid, + containerUuid: this.fieldAttributes.containerUuid, + field: this.fieldAttributes, + panelType: this.fieldAttributes.panelType, + columnName: this.fieldAttributes.columnName, + newValue, + isAdvancedQuery: this.fieldAttributes.isAdvancedQuery, + isSendToServer, + isSendCallout, + isChangedOldValue + } + this.$store.dispatch('notifyFieldChange', { + ...sendParameters + }) + .finally(() => { + this.clearVariables() + this.$children[0].visible = false + }) }, spanMethod({ row, column }) { const button = row[column.property] diff --git a/src/store/modules/ADempiere/panel/actions.js b/src/store/modules/ADempiere/panel/actions.js index 30ed0fb5..f6a79853 100644 --- a/src/store/modules/ADempiere/panel/actions.js +++ b/src/store/modules/ADempiere/panel/actions.js @@ -532,7 +532,8 @@ const actions = { notifyFieldChange({ dispatch, getters }, { containerUuid, columnName, - field + field, + newValue }) { return new Promise(resolve => { // get field @@ -541,12 +542,16 @@ const actions = { fieldsList = getters.getFieldsListFromPanel(containerUuid) field = fieldsList.find(fieldItem => fieldItem.columnName === columnName) } - - const value = getters.getValueOfField({ - parentUuid: field.parentUuid, - containerUuid: field.containerUuid, - columnName: field.columnName - }) + let value + if (isEmptyValue(newValue)) { + value = getters.getValueOfField({ + parentUuid: field.parentUuid, + containerUuid: field.containerUuid, + columnName: field.columnName + }) + } else { + value = newValue + } // if (!(panelType === 'table' || isAdvancedQuery)) { // if (!['IN', 'NOT_IN'].includes(field.operator)) { // value = parsedValueComponent({