1003869 Form to captured process parameter for scheduler. IDEMPIERE-1486 / Fixed captured value for null fields - fix default @#Date# being saved with time

This commit is contained in:
Carlos Ruiz 2014-04-02 20:02:36 -05:00
parent 5aa1701d01
commit aba6e6ca48
2 changed files with 14 additions and 5 deletions

View File

@ -769,8 +769,17 @@ public class GridField
{
// try timestamp format - then date format -- [ 1950305 ]
java.util.Date date = null;
SimpleDateFormat dateTimeFormat = DisplayType.getTimestampFormat_Default();
SimpleDateFormat dateFormat = DisplayType.getDateFormat_JDBC();
SimpleDateFormat timeFormat = DisplayType.getTimeFormat_Default();
try {
date = DisplayType.getTimestampFormat_Default().parse (value);
if (m_vo.displayType == DisplayType.Date) {
date = dateFormat.parse (value);
} else if (m_vo.displayType == DisplayType.Time) {
date = timeFormat.parse (value);
} else {
date = dateTimeFormat.parse (value);
}
} catch (java.text.ParseException e) {
date = DisplayType.getDateFormat_JDBC().parse (value);
}

View File

@ -71,14 +71,14 @@ public class WProcessParameter implements IFormController {
if (processPara.getColumnName().equals(para.getParameterName())) {
schedulerPara.setAD_Process_Para_ID(processPara.getAD_Process_Para_ID());
if (DisplayType.isNumeric(processPara.getAD_Reference_ID())) {
if (para.getP_Number() != null)
if (para.get_Value(MPInstancePara.COLUMNNAME_P_Number) != null)
schedulerPara.setParameterDefault(para.getP_Number().toString());
if (processPara.isRange() && para.getP_Number_To() != null)
if (processPara.isRange() && para.get_Value(MPInstancePara.COLUMNNAME_P_Number_To) != null)
schedulerPara.setParameterToDefault(para.getP_Number_To().toString());
} else if (DisplayType.isID(processPara.getAD_Reference_ID())) {
if (para.getP_Number() != null)
if (para.get_Value(MPInstancePara.COLUMNNAME_P_Number) != null)
schedulerPara.setParameterDefault(Integer.toString(para.getP_Number().intValue()));
if (processPara.isRange() && para.getP_Number_To() != null)
if (processPara.isRange() && para.get_Value(MPInstancePara.COLUMNNAME_P_Number_To) != null)
schedulerPara.setParameterToDefault(Integer.toString(para.getP_Number_To().intValue()));
} else if (DisplayType.isDate(processPara.getAD_Reference_ID())) {
if (para.getP_Date() != null)