IDEMPIERE-5665 - [Multi Selection] - Negate option in process parameter (#1779)

* IDEMPIERE-5665

* IDEMPIERE-5665 - Fix code
This commit is contained in:
Jefferson Dalfre 2023-04-14 05:07:40 -03:00 committed by GitHub
parent 47891709ad
commit dd0e6c95ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -762,12 +762,14 @@ public abstract class SvrProcess implements ProcessCall
String name = parameter.getParameterName().trim().toLowerCase();
Field field = map.get(name);
Field toField = map.containsKey(name + "_to") ? map.get(name + "_to") : null;
Field notField = map.containsKey(name + "_not") ? map.get(name + "_not") : null;
// try to match fields using the "p_" prefix convention
if(field==null) {
String candidate = "p_" + name;
field = map.get(candidate);
toField = map.containsKey(candidate + "_to") ? map.get(candidate + "_to") : null;
notField = map.containsKey(candidate + "_not") ? map.get(candidate + "_not") : null;
}
// try to match fields with same name as metadata declaration after stripping "_"
@ -775,6 +777,7 @@ public abstract class SvrProcess implements ProcessCall
String candidate = name.replace("_", "");
field = map.get(candidate);
toField = map.containsKey(candidate + "to") ? map.get(candidate + "to") : null;
notField = map.containsKey(candidate + "not") ? map.get(candidate + "not") : null;
}
if(field==null)
@ -788,6 +791,8 @@ public abstract class SvrProcess implements ProcessCall
toField.set(this, parameter.getParameter_ToAsInt());
} else if (type.equals(String.class)) {
field.set(this, (String) parameter.getParameter());
if(notField != null)
notField.set(this, (boolean) parameter.isNotClause());
} else if (type.equals(java.sql.Timestamp.class)) {
field.set(this, (Timestamp) parameter.getParameter());
if(parameter.getParameter_To()!=null && toField != null)