IDEMPIERE-3521 InfoWindow problem on other SQL when make a register count

This commit is contained in:
Orlando Curieles 2017-10-17 19:06:59 +02:00
parent 1616e7a95b
commit 0a930345ba
2 changed files with 8 additions and 0 deletions

View File

@ -1705,6 +1705,10 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
} }
countSql = MRole.getDefault().addAccessSQL (countSql, getTableName(), countSql = MRole.getDefault().addAccessSQL (countSql, getTableName(),
MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
// Fix GroupBy On InfoWindow
String otherClause = infoWindow.getOtherClause();
if (otherClause !=null)
countSql = countSql+" "+otherClause;
countSql = "SELECT COUNT(*) FROM ( " + countSql + " ) a"; countSql = "SELECT COUNT(*) FROM ( " + countSql + " ) a";

View File

@ -1065,6 +1065,10 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
countSql = countSql.trim(); countSql = countSql.trim();
countSql = countSql.substring(0, countSql.length() - 5); countSql = countSql.substring(0, countSql.length() - 5);
} }
String otherClause = infoWindow.getOtherClause(); // Fix otherClause on count
if (otherClause != null)
countSql = countSql+" "+otherClause;
countSql = MRole.getDefault().addAccessSQL (countSql, getTableName(), countSql = MRole.getDefault().addAccessSQL (countSql, getTableName(),
MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO);
if (log.isLoggable(Level.FINER)) if (log.isLoggable(Level.FINER))