IDEMPIERE-1558 Performance indicators display fails using context variables in measure calculation / based on patch from Jesus Garcia (j2garcia)

This commit is contained in:
Carlos Ruiz 2013-12-11 12:18:16 -05:00
parent 074be8ab1a
commit 38c6ca185c
2 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,8 @@ public class MMeasure extends X_PA_Measure
String sql = mc.getSqlBarChart(goal.getRestrictions(false),
goal.getMeasureDisplay(), goal.getDateFrom(),
MRole.getDefault()); // logged in role
if (sql.indexOf("@") >= 0)
sql = Env.parseContext(getCtx(), 0, sql, false, false);
PreparedStatement pstmt = null;
ResultSet rs = null;
try

View File

@ -235,6 +235,8 @@ public class MMeasureCalc extends X_PA_MeasureCalc
.append("')=TRUNC(").append(DB.TO_DATE(date)).append(",'").append(trunc).append("')");
}
String finalSQL = addRestrictions(sql.toString(), restrictions, role);
if (finalSQL.indexOf("@") >= 0)
finalSQL = Env.parseContext(getCtx(), 0, finalSQL, false, false);
// Execute
StringBuilder where = new StringBuilder();
PreparedStatement pstmt = null;