Skip to content

Commit

Permalink
fix: Context value with evaluator.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Jun 14, 2024
1 parent 702a5d6 commit 1010be6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/utils/ADempiere/contextUtils/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ export class evaluator {
// Handling of ID compare (null => 0)
if (
!isEmptyValue(firstEval) &&
typeof firstEval === 'string' &&
(firstEval.endsWith('_ID') || firstEval.endsWith('_ID_To') ||
firstEval === 'AD_Key' || firstEval === 'AD_Display' ||
firstEval.endsWith('atedBy') || firstEval.endsWith('_Acct'))
(first.endsWith('_ID') || first.endsWith('_ID_To') ||
first === 'AD_Key' || first === 'AD_Display' ||
first.endsWith('atedBy') || first.endsWith('_Acct'))
) {
// TODO: Evaluate with -1
firstEval = '0'
Expand Down
7 changes: 4 additions & 3 deletions src/utils/ADempiere/valueUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,13 @@ export function parsedValueComponent({
if (!isEmptyValue(value)) {
// Table (18) or Table Direct (19)
if (
TABLE_DIRECT.id === displayType || IMAGE.id || ACCOUNT_ELEMENT.id ||
LOCATOR_WAREHOUSE.id || PRODUCT_ATTRIBUTE.id || RESOURCE_ASSIGNMENT.id
[TABLE_DIRECT.id, IMAGE.id, ACCOUNT_ELEMENT.id,
LOCATOR_WAREHOUSE.id, PRODUCT_ATTRIBUTE.id, RESOURCE_ASSIGNMENT.id
].includes(displayType)
) {
value = Number(value)
} else if (
(TABLE.id === displayType || SEARCH.id) &&
([TABLE.id, SEARCH.id].includes(displayType)) &&
(columnName.endsWith('_ID') || columnName.endsWith('_ID_To') ||
columnName === 'AD_Key' || columnName === 'AD_Display' ||
columnName.endsWith('atedBy') || columnName.endsWith('_Acct'))
Expand Down

0 comments on commit 1010be6

Please sign in to comment.