IDEMPIERE-1702 Incorrect report result when there are more than 2 print formats with different report view where clause

This commit is contained in:
Elaine Tan 2014-01-21 11:45:50 +08:00
parent 8b256677d0
commit e060114381
1 changed files with 4 additions and 3 deletions

View File

@ -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);