Skip to content

Commit 68b6b9f

Browse files
fix: Set correct operator comparison. (PanJiaChen#2625)
* fix: Set correct operator comparison. * fix notification without report associated.
1 parent 07426f5 commit 68b6b9f

File tree

8 files changed

+42
-25
lines changed

8 files changed

+42
-25
lines changed

src/components/ADempiere/FieldDefinition/FieldOptions/ComparisonOperator.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export default defineComponent({
8585
const currentOperatorValue = computed(() => {
8686
return props.metadataField.operator
8787
})
88+
8889
const operatorList = computed(() => {
8990
const isComparisonField = !['FieldBinary', 'FieldButton', 'FieldImage'].includes(props.metadataField.componentPath)
9091
if (isComparisonField) {

src/components/ADempiere/FieldDefinition/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ import store from '@/store'
9494

9595
// Components and Mixins
9696
import FieldOptions from '@/components/ADempiere/FieldDefinition/FieldOptions/index.vue'
97-
import ComparisonOperator from '@/components/ADempiere/FieldDefinition/FieldOptions/ComparisonOperator'
97+
import ComparisonOperator from '@/components/ADempiere/FieldDefinition/FieldOptions/ComparisonOperator.vue'
9898

9999
// Constants
100100
import { UUID } from '@/utils/ADempiere/constants/systemColumns'

src/components/ADempiere/FormDefinition/VFileImport/saveProcess.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
>
9090
<el-dropdown-item
9191
:key="index"
92-
:command="process.id + '|' + process.values.UUID"
92+
:command="process.internal_id + '|' + process.values.UUID"
9393
>
9494
{{ process.values.DisplayColumn }}
9595
</el-dropdown-item>

src/components/ADempiere/TabManager/convenienceButtons/PrintProcess.vue

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@
6262

6363
<script>
6464
import { defineComponent, computed } from '@vue/composition-api'
65+
6566
import language from '@/lang'
6667
import store from '@/store'
67-
// Utils
68+
69+
// Utils and Helper Methods
6870
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
6971
import { showNotification } from '@/utils/ADempiere/notification.js'
7072

@@ -106,29 +108,37 @@ export default defineComponent({
106108
})
107109

108110
const getReportDefinition = computed(() => {
109-
if (
110-
isEmptyValue(process) ||
111-
isEmptyValue(process.uuid)
112-
) return []
111+
if (isEmptyValue(process) || isEmptyValue(process.uuid)) {
112+
return []
113+
}
113114
return store.getters.getStoredReport(process.uuid)
114115
})
115116

116117
const printFormats = computed(() => {
117-
if (
118-
isEmptyValue(process)
119-
) return []
120-
return store.getters.getPrintFormatsList(process.id)
118+
if (isEmptyValue(process)) {
119+
return []
120+
}
121+
return store.getters.getPrintFormatsList(process.internal_id)
121122
})
122123

123124
/**
124125
* Methods
125126
*/
126127
function printProcess() {
127-
if (isEmptyValue(process)) return
128+
if (isEmptyValue(process)) {
129+
showNotification({
130+
title: language.t('notifications.whithoutAssociatedReport'),
131+
message: process.name,
132+
summary: process.description,
133+
type: 'info'
134+
})
135+
return
136+
}
137+
128138
store.dispatch('runReport', {
129139
containerUuid: process.uuid,
130140
recordId: recordId.value,
131-
reportId: process.id,
141+
reportId: process.internal_id,
132142
tableName: table_name
133143
})
134144
}
@@ -143,17 +153,21 @@ export default defineComponent({
143153
store.dispatch('generateReportViwer', {
144154
containerUuid: process.uuid,
145155
reportUuid: process.uuid,
156+
reportId: process.internal_id,
146157
printFormatId: command.id,
147-
reportId: process.id,
148158
tableName: command.table_name,
149159
filters: `[{\"name\":\"${command.table_name}_ID\",\"operator\":\"equal\",\"values\":${recordId.value}}]`,
150160
isView: false
151161
})
152162
}
153163

154164
function loadProcessData() {
155-
if (isEmptyValue(process) || isEmptyValue(is_document)) return
156-
if (!isEmptyValue(getReportDefinition.value)) return
165+
if (isEmptyValue(process) || isEmptyValue(is_document)) {
166+
return
167+
}
168+
if (!isEmptyValue(getReportDefinition.value)) {
169+
return
170+
}
157171
const { id } = process
158172
store.dispatch('getReportDefinitionFromServer', {
159173
id,

src/lang/ADempiere/en/process.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
const process = {
2020
clearParameters: {
2121
title: 'Clear Parameters',
22-
description: 'Clears the values by setting the default values'
22+
description: 'Clears the values by setting the default values',
23+
whithoutAssociatedReport: 'Without Associated Report'
2324
}
2425
}
2526

src/lang/ADempiere/es/process.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
const report = {
2020
clearParameters: {
2121
title: 'Limpiar Parámetros',
22-
description: 'Limpia los valores estableciendo los valores por defecto'
22+
description: 'Limpia los valores estableciendo los valores por defecto',
23+
whithoutAssociatedReport: 'Sin Reporte Asociado'
2324
}
2425
}
2526

src/utils/ADempiere/dictionary/menu.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,24 @@ export function getReferenceByMenu(menu) {
9191

9292
switch (menu.action) {
9393
case 'F':
94-
reference_id = menu.workflow.id
94+
reference_id = menu.workflow.internal_id
9595
reference_uuid = menu.workflow.uuid
9696
break
9797
case 'P':
9898
case 'R':
99-
reference_id = menu.process.id
99+
reference_id = menu.process.internal_id
100100
reference_uuid = menu.process.uuid
101101
break
102102
case 'S':
103-
reference_id = menu.browser.id
103+
reference_id = menu.browser.internal_id
104104
reference_uuid = menu.browser.uuid
105105
break
106106
case 'W':
107-
reference_id = menu.window.id
107+
reference_id = menu.window.internal_id
108108
reference_uuid = menu.window.uuid
109109
break
110110
case 'X':
111-
reference_id = menu.form.id
111+
reference_id = menu.form.internal_id
112112
reference_uuid = menu.form.uuid
113113
break
114114
}

src/utils/ADempiere/dictionaryUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ export function generateField({
126126
let parsedDefaultValue = fieldToGenerate.default_value
127127
let parsedDefaultValueTo = fieldToGenerate.default_value_to
128128
let operator
129-
let isNumericField = componentReference.componentPath === 'FieldNumber'
129+
const isNumericField = componentReference.componentPath === 'FieldNumber'
130130
let isTranslatedField = fieldToGenerate.is_translated
131131
let isComparisonField = false // to list operators comparison
132132
let operatorsList = []
133133
if (moreAttributes.isAdvancedQuery) {
134-
isNumericField = false
134+
// isNumericField = false // disable calculator popover
135135
isTranslatedField = false
136136
parsedDefaultValue = undefined
137137
parsedDefaultValueTo = undefined

0 commit comments

Comments
 (0)