diff --git a/src/lang/ADempiere/en/field/index.js b/src/lang/ADempiere/en/field/index.js index db9acab8f13..fb2f61a097c 100644 --- a/src/lang/ADempiere/en/field/index.js +++ b/src/lang/ADempiere/en/field/index.js @@ -46,5 +46,6 @@ export default { locationsAddress, invoice, payment, - order + order, + to: 'To' } diff --git a/src/lang/ADempiere/es/field/index.js b/src/lang/ADempiere/es/field/index.js index 2503c115d65..98de6017758 100644 --- a/src/lang/ADempiere/es/field/index.js +++ b/src/lang/ADempiere/es/field/index.js @@ -46,5 +46,6 @@ export default { locationsAddress, invoice, payment, - order + order, + to: 'Hasta' } diff --git a/src/store/modules/ADempiere/calloutManager.js b/src/store/modules/ADempiere/calloutManager.js index 658a30520ee..85d25be4d9b 100644 --- a/src/store/modules/ADempiere/calloutManager.js +++ b/src/store/modules/ADempiere/calloutManager.js @@ -140,24 +140,24 @@ const calloutManager = { const recordUuid = rootGetters.getUuidOfContainer(containerUuid) attributesList.forEach(attribute => { - const { value, columnName } = attribute + const { value: attributeValue, columnName: attributeColumnName } = attribute - const oldValue = rootGetters.getValueOfFieldOnContainer({ + const attributeOldValue = rootGetters.getValueOfFieldOnContainer({ parentUuid, containerUuid, - columnName + columnName: attributeColumnName }) // add changes to send - if (!isSameValues(value, oldValue)) { - const field = fieldsList.find(fieldItem => fieldItem.columnName === columnName) + if (!isSameValues(attributeValue, attributeOldValue)) { + const field = fieldsList.find(fieldItem => fieldItem.column_name === attributeColumnName) if (!isEmptyValue(field)) { commit('addChangeToPersistenceQueue', { containerUuid, recordUuid, - columnName, - oldValue, - value + columnName: attributeColumnName, + oldValue: attributeOldValue, + value: attributeValue }) } } diff --git a/src/store/modules/ADempiere/dictionary/browser/getters.js b/src/store/modules/ADempiere/dictionary/browser/getters.js index 5313cd64fd7..bf83c737bd2 100644 --- a/src/store/modules/ADempiere/dictionary/browser/getters.js +++ b/src/store/modules/ADempiere/dictionary/browser/getters.js @@ -145,7 +145,9 @@ export default { fieldsList.forEach(fieldItem => { // default operator - const { is_info_only, column_name, columnNameTo, operator, display_type } = fieldItem + const { + is_info_only, column_name, columnNameTo, operator, display_type + } = fieldItem if (is_info_only) { return false } diff --git a/src/store/modules/ADempiere/dictionary/process/getters.js b/src/store/modules/ADempiere/dictionary/process/getters.js index 3fa7019dc65..6ef9ceef371 100644 --- a/src/store/modules/ADempiere/dictionary/process/getters.js +++ b/src/store/modules/ADempiere/dictionary/process/getters.js @@ -22,7 +22,6 @@ import { FIELDS_DATE, FIELDS_DECIMALS } from '@/utils/ADempiere/references.js' // Utils and Helper Methods import { isEmptyValue } from '@/utils/ADempiere/valueUtils' import { isDisplayedField, isMandatoryField } from '@/utils/ADempiere/dictionary/process.js' -import { isNumberField } from '@/utils/ADempiere/references' /** * Dictionary Process Getters @@ -106,10 +105,12 @@ export default { const processParameters = {} fieldsList.forEach(fieldItem => { - if (fieldItem.is_info_only) { + const { + is_info_only, columnName, display_type, is_range, columnNameTo, isGeneratedRange + } = fieldItem + if (is_info_only) { return false } - const { columnName, display_type } = fieldItem const isMandatory = isMandatoryField(fieldItem) if (!isMandatory) { // evaluate displayed fields @@ -126,24 +127,20 @@ export default { const isDateField = FIELDS_DATE.includes(display_type) const isDecimalField = FIELDS_DECIMALS.includes(display_type) - if (fieldItem.is_range && !isNumberField(fieldItem.display_type)) { + if (is_range && isGeneratedRange) { const valueTo = rootGetters.getValueOfField({ containerUuid, - columnName: fieldItem.columnNameTo + columnName: columnNameTo }) if (!isEmptyValue(valueTo)) { - // processParameters.push({ - // columnName: fieldItem.columnNameTo, - // value: valueTo - // }) - processParameters[fieldItem.columnNameTo] = valueTo + processParameters[columnNameTo] = valueTo if (isDateField) { - processParameters[columnName] = { + processParameters[columnNameTo] = { type: 'date', value: valueTo } } else if (isDecimalField) { - processParameters[columnName] = { + processParameters[columnNameTo] = { type: 'decimal', value: valueTo } diff --git a/src/store/modules/ADempiere/dictionary/report/getters.js b/src/store/modules/ADempiere/dictionary/report/getters.js index e2e5339a499..1813e8d93f7 100644 --- a/src/store/modules/ADempiere/dictionary/report/getters.js +++ b/src/store/modules/ADempiere/dictionary/report/getters.js @@ -22,7 +22,6 @@ import { FIELDS_DATE, FIELDS_DECIMALS } from '@/utils/ADempiere/references.js' // Utils and Helper Methods import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js' import { isDisplayedField, isMandatoryField } from '@/utils/ADempiere/dictionary/process.js' -import { isNumberField } from '@/utils/ADempiere/references.js' /** * Dictionary Report Getters @@ -117,10 +116,12 @@ export default { const reportParameters = {} fieldsList.forEach(fieldItem => { - if (fieldItem.is_info_only) { + const { + is_info_only, columnName, display_type, is_range, columnNameTo, isGeneratedRange + } = fieldItem + if (is_info_only) { return false } - const { columnName, display_type } = fieldItem const isMandatory = isMandatoryField(fieldItem) if (!isMandatory) { // evaluate displayed fields @@ -137,24 +138,20 @@ export default { const isDateField = FIELDS_DATE.includes(display_type) const isDecimalField = FIELDS_DECIMALS.includes(display_type) - if (fieldItem.is_range && !isNumberField(display_type)) { + if (is_range && !isGeneratedRange) { const valueTo = rootGetters.getValueOfField({ containerUuid: uuid, - columnName: fieldItem.columnNameTo + columnName: columnNameTo }) if (!isEmptyValue(valueTo)) { - // reportParameters.push({ - // columnName: fieldItem.columnNameTo, - // value: valueTo - // }) - reportParameters[fieldItem.columnNameTo] = valueTo + reportParameters[columnNameTo] = valueTo if (isDateField) { - reportParameters[columnName] = { + reportParameters[columnNameTo] = { type: 'date', value: valueTo } } else if (isDecimalField) { - reportParameters[columnName] = { + reportParameters[columnNameTo] = { type: 'decimal', value: valueTo } diff --git a/src/utils/ADempiere/dictionaryUtils.js b/src/utils/ADempiere/dictionaryUtils.js index dd70f67db4d..2678b203195 100644 --- a/src/utils/ADempiere/dictionaryUtils.js +++ b/src/utils/ADempiere/dictionaryUtils.js @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +import lang from '@/lang' + // Constants import REFERENCES, { YES_NO, DEFAULT_SIZE } from '@/utils/ADempiere/references' import { @@ -297,7 +299,7 @@ export function generateField({ field.column_name = field.columnNameTo field.elementName = field.elementNameTo field.element_name = field.elementNameTo - field.name = `${field.name} To` + field.name = `${field.name} ${lang.t('field.to')}` field.value = parsedDefaultValueTo field.default_value = field.default_value_to field.parsedDefaultValue = field.parsedDefaultValueTo diff --git a/src/utils/ADempiere/references.js b/src/utils/ADempiere/references.js index da2169e1690..78964dde1fa 100644 --- a/src/utils/ADempiere/references.js +++ b/src/utils/ADempiere/references.js @@ -496,15 +496,15 @@ export function isRangeField(displayType) { /** * Is manage range to in other field * @param {boolean} is_range - * @param {number} displayType + * @param {number} display_type * @returns {boolean} */ -export function isAddRangeField({ is_range, displayType }) { +export function isAddRangeField({ is_range, display_type }) { if (!is_range) { return false } - return isNumberField(displayType) + return isNumberField(display_type) } /**