From e060114381083425cbad481bc072264a12feca2f Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Tue, 21 Jan 2014 11:45:50 +0800 Subject: [PATCH] IDEMPIERE-1702 Incorrect report result when there are more than 2 print formats with different report view where clause --- org.adempiere.base/src/org/compiere/print/DataEngine.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/DataEngine.java b/org.adempiere.base/src/org/compiere/print/DataEngine.java index 9a09e332b9..7741fe0e1e 100644 --- a/org.adempiere.base/src/org/compiere/print/DataEngine.java +++ b/org.adempiere.base/src/org/compiere/print/DataEngine.java @@ -138,6 +138,7 @@ public class DataEngine */ public PrintData getPrintData (Properties ctx, MPrintFormat format, MQuery query, boolean summary) { + MQuery queryCopy = query.deepCopy(); /** Report Summary FR [ 2011569 ]**/ m_summary = summary; @@ -167,7 +168,7 @@ public class DataEngine // Add WhereClause restriction from AD_ReportView - teo_sarca BF [ 1761891 ] String whereClause = rs.getString(4); if (!Util.isEmpty(whereClause)) - query.addRestriction(whereClause); + queryCopy.addRestriction(whereClause); } } catch (SQLException e) @@ -196,11 +197,11 @@ public class DataEngine if (hasVT) { tableName += "t"; - format.setTranslationViewQuery (query); + format.setTranslationViewQuery (queryCopy); } } // - PrintData pd = getPrintDataInfo (ctx, format, query, reportName, tableName); + PrintData pd = getPrintDataInfo (ctx, format, queryCopy, reportName, tableName); if (pd == null) return null; loadPrintData(pd, format);