IDEMPIERE-1422 Inconsistence passing ID parameters to jasper reports / Implement the same for range

This commit is contained in:
Carlos Ruiz 2013-10-02 18:19:59 -05:00
parent db4a4f5afd
commit ab6efd300c
1 changed files with 14 additions and 7 deletions

View File

@ -1253,21 +1253,28 @@ public class ReportStarter implements ProcessCall, ClientProcess
if (para != null) { if (para != null) {
for (int i = 0; i < para.length; i++) { for (int i = 0; i < para.length; i++) {
if (para[i].getParameter_To() == null) { if (para[i].getParameter_To() == null) {
if (para[i].getParameterName().endsWith("_ID") && para[i].getParameter() instanceof BigDecimal) if (para[i].getParameterName().endsWith("_ID") && para[i].getParameter() instanceof BigDecimal) {
{
params.put(para[i].getParameterName(), ((BigDecimal)para[i].getParameter()).intValue()); params.put(para[i].getParameterName(), ((BigDecimal)para[i].getParameter()).intValue());
} } else {
else
{
params.put(para[i].getParameterName(), para[i].getParameter()); params.put(para[i].getParameterName(), para[i].getParameter());
} }
} else { } else {
// range - from
if (para[i].getParameterName().endsWith("_ID") && para[i].getParameter() != null && para[i].getParameter() instanceof BigDecimal) {
params.put( para[i].getParameterName()+"1", ((BigDecimal)para[i].getParameter()).intValue());
} else {
params.put( para[i].getParameterName()+"1", para[i].getParameter()); params.put( para[i].getParameterName()+"1", para[i].getParameter());
}
// range - to
if (para[i].getParameterName().endsWith("_ID") && para[i].getParameter_To() instanceof BigDecimal) {
params.put( para[i].getParameterName()+"2", ((BigDecimal)para[i].getParameter_To()).intValue());
} else {
params.put( para[i].getParameterName()+"2", para[i].getParameter_To()); params.put( para[i].getParameterName()+"2", para[i].getParameter_To());
} }
} }
} }
} }
}
/** /**
* @author rlemeill * @author rlemeill