IDEMPIERE-5773 - Fixed bug on advance detail not adding the parenthesis on detail tab queries (#2062)
* IDEMPIERE-5773 - Refactor FindWindow code that discovers the right and left bracket value * IDEMPIERE-5773 - Refactor FindWindow code that discovers the right and left bracket value - Improve method name * IDEMPIERE-5773 - Fixed bug on advance detail not adding the parenthesis on detail tab queries
This commit is contained in:
parent
bb3856dbb0
commit
46c7c4c06d
|
@ -2264,15 +2264,18 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
|
||||||
exists.append(PO.getUUIDColumnName(m_tableName));
|
exists.append(PO.getUUIDColumnName(m_tableName));
|
||||||
else
|
else
|
||||||
exists.append(m_tableName).append("_ID ");
|
exists.append(m_tableName).append("_ID ");
|
||||||
ColumnSQL = exists.toString() + " AND " + ColumnSQL;
|
|
||||||
|
exists.append(" AND ")
|
||||||
|
.append(getLeftBracketValue(row))
|
||||||
|
.append(ColumnSQL);
|
||||||
|
ColumnSQL = exists.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
isExists = true;
|
isExists = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Left brackets
|
// Left brackets
|
||||||
Listbox listLeftBracket = (Listbox)row.getFellow("listLeftBracket"+row.getId());
|
String lBrackets = getLeftBracketValue(row);
|
||||||
String lBrackets = listLeftBracket.getSelectedItem().getValue().toString();
|
|
||||||
if (lBrackets != null) {
|
if (lBrackets != null) {
|
||||||
openBrackets += lBrackets.length();
|
openBrackets += lBrackets.length();
|
||||||
if (isExists && !lBrackets.isEmpty()) {
|
if (isExists && !lBrackets.isEmpty()) {
|
||||||
|
@ -2283,8 +2286,7 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
|
||||||
lBrackets = "";
|
lBrackets = "";
|
||||||
}
|
}
|
||||||
// Right brackets
|
// Right brackets
|
||||||
Listbox listRightBracket = (Listbox)row.getFellow("listRightBracket"+row.getId());
|
String rBrackets = getRightBracketValue(row);
|
||||||
String rBrackets = listRightBracket.getSelectedItem().getValue().toString();
|
|
||||||
if (rBrackets != null) {
|
if (rBrackets != null) {
|
||||||
openBrackets -= rBrackets.length();
|
openBrackets -= rBrackets.length();
|
||||||
if(isCompositeExists && !rBrackets.isEmpty())
|
if(isCompositeExists && !rBrackets.isEmpty())
|
||||||
|
@ -2468,6 +2470,8 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
|
||||||
|
|
||||||
if(!isCompositeExists)
|
if(!isCompositeExists)
|
||||||
where += ")";
|
where += ")";
|
||||||
|
|
||||||
|
where += getRightBracketValue(row);
|
||||||
|
|
||||||
m_query.addRestriction(where, and, not, isExistCondition, openBrackets);
|
m_query.addRestriction(where, and, not, isExistCondition, openBrackets);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2489,6 +2493,28 @@ public class FindWindow extends Window implements EventListener<Event>, ValueCha
|
||||||
}
|
}
|
||||||
|
|
||||||
} // cmd_saveAdvanced
|
} // cmd_saveAdvanced
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value selected for the left bracket list item
|
||||||
|
* in the current row
|
||||||
|
* @param row
|
||||||
|
* @return empty, (, (( or (((
|
||||||
|
*/
|
||||||
|
private String getLeftBracketValue(ListItem row) {
|
||||||
|
Listbox listLeftBracket = (Listbox)row.getFellow("listLeftBracket"+row.getId());
|
||||||
|
return listLeftBracket.getSelectedItem().getValue().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value selected for the right bracket list item
|
||||||
|
* in the current row
|
||||||
|
* @param row
|
||||||
|
* @return empty, ), )) or )))
|
||||||
|
*/
|
||||||
|
private String getRightBracketValue(ListItem row) {
|
||||||
|
Listbox listRightBracket = (Listbox)row.getFellow("listRightBracket"+row.getId());
|
||||||
|
return listRightBracket.getSelectedItem().getValue().toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append values to code
|
* Append values to code
|
||||||
|
|
Loading…
Reference in New Issue