// cache the form data
convertItemLines();
try {
// initialize validation
Validation validation = new Validation();
validation.checkForRequired("label.hrs.hr.ReportingTo", reportto,
"error.application.required", errors);
validation.checkForRequired("label.hrs.hr.Employee", getEmployee(),
"error.application.required", errors);
validation.checkForRequired("label.hrs.hr.From", getFromday(), "error.application.required",
errors);
validation.checkForRequired("label.hrs.hr.To", getToday(), "error.application.required",
errors);
if ((getFromday() != null && getFromday().length() != 0)
|| (getFromyear() != null && (getFromyear()).length() != 0)
|| (getFrommonth() != null && (getFrommonth()).length() != 0)) {
validation.checkForDate("label.hrs.hr.From", getFromyear(), getFrommonth(), getFromday(),
"error.application.date", errors);
}
if ((getToday() != null && getToday().length() != 0)
|| (getToyear() != null && getToyear().length() != 0)
|| (getTomonth() != null && getTomonth().length() != 0)) {
validation.checkForDate("label.hrs.hr.To", getToyear(), getTomonth(), getToday(),
"error.application.date", errors);
}
if ((getFromday()) != null
&& (getFromday().length() != 0 && (getToday()) != null && (getToday()).length() != 0))
validation.checkForDateComparison("label.hrs.hr.From", (getFromyear()), (getFrommonth()),
(getFromday()), "label.hrs.hr.To", (getToyear()), (getTomonth()), (getToday()),
"error.application.datecomparison", errors);
boolean itemPresent = false;
int counter = 0;