IDEMPIERE-5770 - Sql clauses are not applied on Related Info Window (#1897)
* IDEMPIERE-5770 - Sql clauses are not applied on Related Info Window * IDEMPIERE-5770 - surround where clause with parenthesis
This commit is contained in:
parent
31b2907b0a
commit
b4dcfa11d9
|
@ -873,6 +873,9 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL
|
|||
String s_sqlFrom = embedInfo.getFromClause();
|
||||
/** Where Clause */
|
||||
String s_sqlWhere = relatedInfo.getLinkColumnName() + "=?";
|
||||
String infoWhere = embedInfo.getWhereClause();
|
||||
if(!Util.isEmpty(infoWhere))
|
||||
s_sqlWhere += " AND (" + infoWhere + ")";
|
||||
String s_sqlCount = "SELECT COUNT(*) FROM " + s_sqlFrom + " WHERE " + s_sqlWhere;
|
||||
m_sqlEmbedded = embeddedTbl.prepareTable(s_layoutEmbedded, s_sqlFrom, s_sqlWhere, false, tableName);
|
||||
|
||||
|
|
|
@ -328,9 +328,22 @@ public class RelatedInfoWindow implements EventListener<Event>, Sortable<Object>
|
|||
|
||||
long startTime = System.currentTimeMillis();
|
||||
dataSql = info.getInfoSql();
|
||||
|
||||
// Other Clause and Order By clause
|
||||
String otherClause = info.getInfowin().getOtherClause();
|
||||
String orderByClause = info.getInfowin().getOrderByClause();
|
||||
if (!Util.isEmpty(otherClause)) {
|
||||
dataSql = dataSql + " " + otherClause;
|
||||
}
|
||||
if (!Util.isEmpty(m_sqlUserOrder)) {
|
||||
dataSql = dataSql + m_sqlUserOrder;
|
||||
if(!Util.isEmpty(orderByClause))
|
||||
dataSql = dataSql + orderByClause;
|
||||
}
|
||||
else if(!Util.isEmpty(orderByClause)) {
|
||||
dataSql = dataSql + " ORDER BY " + orderByClause;
|
||||
}
|
||||
//
|
||||
isHasNextPage = false;
|
||||
if (log.isLoggable(Level.FINER))
|
||||
log.finer(dataSql);
|
||||
|
|
Loading…
Reference in New Issue