ExpenseFormVOX vox = new ExpenseFormVOX(userobjectd, hrexpenseForm);
ExpenseFormVO expenseFormVO = vox.getVO();
HrFacadeHome hm = (HrFacadeHome)CVUtility.getHomeObject("com.centraview.hr.hrfacade.HrFacadeHome", "HrFacade");
HrFacade remote = (HrFacade)hm.create();
remote.setDataSource(dataSource);
if (expenseFormID > 0 && request.getParameter("DUPLICATE") != null)
{
hrexpenseForm.convertItemLines();
expenseFormVO = remote.createExpense(expenseFormVO, individualID);
hrexpenseForm.setExpenseFormID((new Integer(expenseFormVO.getExpenseFormID())).intValue());
//set("expenseFormID",(new Integer(expenseFormVO.getExpenseFormID())).toString());
java.sql.Timestamp date = expenseFormVO.getCreatedDate();
if (date != null)
{
hrexpenseForm.setCreatedDate(date.toString());
}
hrexpenseForm.setItemLines(expenseFormVO.getHrExpenseLines());
request.setAttribute("HrExpenseLines", expenseFormVO.getHrExpenseLines());
}
else if (expenseFormID > 0)
{
expenseFormVO.setExpenseFormID(expenseFormID);
remote.updateExpense(expenseFormVO, individualID);
expenseFormVO = remote.getExpenseFormVO(expenseFormID);
//Set all elements in form.
hrexpenseForm.setExpenseFormID(expenseFormID);
java.sql.Timestamp date = expenseFormVO.getCreatedDate();
//set values on hrexpenseForm
hrexpenseForm.setCreatedDate(date.toString());
//set("CreatedDate",dForm.format(date));
//expenseForm.setCreatedDate(date);
hrexpenseForm.setExpenseFormID(expenseFormID);
hrexpenseForm.setFormDescription(expenseFormVO.getDescription());
hrexpenseForm.setEmployee(expenseFormVO.getEmployee());
hrexpenseForm.setEmployeeID(expenseFormVO.getEmployeeId());
hrexpenseForm.setReportto(expenseFormVO.getReportingTo());
hrexpenseForm.setReporttoID(expenseFormVO.getReportingId());
hrexpenseForm.setStatus(expenseFormVO.getStatus());
hrexpenseForm.setNotes(expenseFormVO.getNotes());
if (expenseFormVO.getFrom() != null)
{
java.sql.Date fromDate = expenseFormVO.getFrom();
String sfromDate = fromDate.toString();
Vector fromDateSplitUp = getDate(sfromDate);
hrexpenseForm.setFromyear((String)fromDateSplitUp.get(0));
hrexpenseForm.setFrommonth((String)fromDateSplitUp.get(1));
hrexpenseForm.setFromday((String)fromDateSplitUp.get(2));
}
if (expenseFormVO.getTo() != null)
{
java.sql.Date toDate = expenseFormVO.getTo();
String stoDate = toDate.toString();
//String[] sTokenizedDate = getDate(stoDate);
Vector toDateSplitUp = getDate(stoDate);
hrexpenseForm.setToyear((String)toDateSplitUp.get(0));
hrexpenseForm.setTomonth((String)toDateSplitUp.get(1));
hrexpenseForm.setToday((String)toDateSplitUp.get(2));
}
hrexpenseForm.setItemLines(expenseFormVO.getHrExpenseLines());
// @@@@@COMMENNTED ON 30/10/03
//hrexpenseForm.setItemLines(expenseFormVO.getHrExpenseLines());
request.setAttribute("HrExpenseLines", expenseFormVO.getHrExpenseLines());
}
else if (expenseFormID == 0)
{
expenseFormVO = remote.createExpense(expenseFormVO, individualID);
hrexpenseForm.setExpenseFormID((new Integer(expenseFormVO.getExpenseFormID())).intValue());
//set("expenseFormID",(new Integer(expenseFormVO.getExpenseFormID())).toString());
java.sql.Timestamp date = expenseFormVO.getCreatedDate();