From 2d0498dfcd731ecd08828d25dd819e9e811ed6d7 Mon Sep 17 00:00:00 2001 From: Ricardo Fenomeno <78000356+Ricargame@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:01:05 -0400 Subject: [PATCH] Fix: Instance In Report Filter (#2892) --- src/api/ADempiere/reportManagement/index.ts | 4 +--- src/store/modules/ADempiere/reportManager.js | 9 +++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api/ADempiere/reportManagement/index.ts b/src/api/ADempiere/reportManagement/index.ts index 1777aa86f2..f133068bb4 100644 --- a/src/api/ADempiere/reportManagement/index.ts +++ b/src/api/ADempiere/reportManagement/index.ts @@ -125,7 +125,6 @@ export function getView({ printFormatId, reportViewId, isSummary, - instanceId, // window tableName, recordId @@ -143,8 +142,7 @@ export function getView({ report_view_id: reportViewId, is_summary: isSummary, table_name: tableName, - record_id: recordId, - AD_PInstance_ID: instanceId + record_id: recordId } }) } diff --git a/src/store/modules/ADempiere/reportManager.js b/src/store/modules/ADempiere/reportManager.js index da8b8aac3c..03a4f6c4a0 100644 --- a/src/store/modules/ADempiere/reportManager.js +++ b/src/store/modules/ADempiere/reportManager.js @@ -701,12 +701,17 @@ const reportManager = { type: 'info' }) return new Promise((resolve, reject) => { - const filters = getOperatorAndValue({ + let filters = getOperatorAndValue({ format: 'array', containerUuid, fieldsList }) - + if (!isEmptyValue(instanceId)) { + const filtersArray = JSON.parse(filters) + const newFilter = { 'name': 'AD_PInstance_ID', 'operator': 'equal', 'values': instanceId } + filtersArray.push(newFilter) + filters = JSON.stringify(filtersArray) + } getView({ printFormatId, reportViewId,