IDEMPIERE-1558 Performance indicators display fails using context variables in measure calculation / based on patch from Jesus Garcia (j2garcia)
This commit is contained in:
parent
074be8ab1a
commit
38c6ca185c
|
@ -109,6 +109,8 @@ public class MMeasure extends X_PA_Measure
|
||||||
String sql = mc.getSqlBarChart(goal.getRestrictions(false),
|
String sql = mc.getSqlBarChart(goal.getRestrictions(false),
|
||||||
goal.getMeasureDisplay(), goal.getDateFrom(),
|
goal.getMeasureDisplay(), goal.getDateFrom(),
|
||||||
MRole.getDefault()); // logged in role
|
MRole.getDefault()); // logged in role
|
||||||
|
if (sql.indexOf("@") >= 0)
|
||||||
|
sql = Env.parseContext(getCtx(), 0, sql, false, false);
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
|
|
|
@ -235,6 +235,8 @@ public class MMeasureCalc extends X_PA_MeasureCalc
|
||||||
.append("')=TRUNC(").append(DB.TO_DATE(date)).append(",'").append(trunc).append("')");
|
.append("')=TRUNC(").append(DB.TO_DATE(date)).append(",'").append(trunc).append("')");
|
||||||
}
|
}
|
||||||
String finalSQL = addRestrictions(sql.toString(), restrictions, role);
|
String finalSQL = addRestrictions(sql.toString(), restrictions, role);
|
||||||
|
if (finalSQL.indexOf("@") >= 0)
|
||||||
|
finalSQL = Env.parseContext(getCtx(), 0, finalSQL, false, false);
|
||||||
// Execute
|
// Execute
|
||||||
StringBuilder where = new StringBuilder();
|
StringBuilder where = new StringBuilder();
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
|
Loading…
Reference in New Issue