IDEMPIERE-1157: Adding functinality to add charts on the standard windows

This commit is contained in:
Deepak Pansheriya 2013-07-18 20:08:25 +05:30
parent bcc0bc6f73
commit 971eaecf43
1 changed files with 11 additions and 0 deletions

View File

@ -118,6 +118,17 @@ public class MChartDatasource extends X_AD_ChartDatasource {
sql += category + "<=TRUNC(" + DB.TO_DATE(new Timestamp(endDate.getTime())) + ", '" + unit + "') ";
}
int startIndex=0;
if ((startIndex = sql.indexOf('@')) != -1){
String variable = sql.substring(startIndex);
int endIndex = variable.indexOf('@',1);
if(endIndex != -1){
variable = variable.substring(0,endIndex+1);
String val = Env.getContext(getCtx(), variable.replace('@',' ').trim());
sql=sql.replaceFirst(variable, val);
}
}
MRole role = MRole.getDefault(getCtx(), false);
sql = role.addAccessSQL(sql, null, true, false);