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:
parent
5aa1701d01
commit
aba6e6ca48
|
@ -769,8 +769,17 @@ public class GridField
|
||||||
{
|
{
|
||||||
// try timestamp format - then date format -- [ 1950305 ]
|
// try timestamp format - then date format -- [ 1950305 ]
|
||||||
java.util.Date date = null;
|
java.util.Date date = null;
|
||||||
|
SimpleDateFormat dateTimeFormat = DisplayType.getTimestampFormat_Default();
|
||||||
|
SimpleDateFormat dateFormat = DisplayType.getDateFormat_JDBC();
|
||||||
|
SimpleDateFormat timeFormat = DisplayType.getTimeFormat_Default();
|
||||||
try {
|
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) {
|
} catch (java.text.ParseException e) {
|
||||||
date = DisplayType.getDateFormat_JDBC().parse (value);
|
date = DisplayType.getDateFormat_JDBC().parse (value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,14 +71,14 @@ public class WProcessParameter implements IFormController {
|
||||||
if (processPara.getColumnName().equals(para.getParameterName())) {
|
if (processPara.getColumnName().equals(para.getParameterName())) {
|
||||||
schedulerPara.setAD_Process_Para_ID(processPara.getAD_Process_Para_ID());
|
schedulerPara.setAD_Process_Para_ID(processPara.getAD_Process_Para_ID());
|
||||||
if (DisplayType.isNumeric(processPara.getAD_Reference_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());
|
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());
|
schedulerPara.setParameterToDefault(para.getP_Number_To().toString());
|
||||||
} else if (DisplayType.isID(processPara.getAD_Reference_ID())) {
|
} 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()));
|
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()));
|
schedulerPara.setParameterToDefault(Integer.toString(para.getP_Number_To().intValue()));
|
||||||
} else if (DisplayType.isDate(processPara.getAD_Reference_ID())) {
|
} else if (DisplayType.isDate(processPara.getAD_Reference_ID())) {
|
||||||
if (para.getP_Date() != null)
|
if (para.getP_Date() != null)
|
||||||
|
|
Loading…
Reference in New Issue