}
if(hasErrors()){
return INPUT;
}
InvoiceSchedule invoiceSchedule;
if(getInvoiceSchedule().getId() == null || "".equalsIgnoreCase(getInvoiceSchedule().getId())){
invoiceSchedule = new InvoiceSchedule();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
invoiceSchedule = (InvoiceSchedule) manager.getById(InvoiceSchedule.class, getInvoiceSchedule().getId());
logInfo = invoiceSchedule.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
invoiceSchedule.setLogInformation(logInfo);
invoiceSchedule.setName(getInvoiceSchedule().getName());
invoiceSchedule.setDescription(getInvoiceSchedule().getDescription());
invoiceSchedule.setPdefault(getInvoiceSchedule().getPdefault());
invoiceSchedule.setAmount(getInvoiceSchedule().getAmount());
invoiceSchedule.setAmountLimit(getInvoiceSchedule().getAmountLimit());
invoiceSchedule.setInvoiceFrequency(getInvoiceSchedule().getInvoiceFrequency());
invoiceSchedule.setIncvoiceDayCutOff(getInvoiceSchedule().getIncvoiceDayCutOff());
invoiceSchedule.setInvoiceDay(getInvoiceSchedule().getInvoiceDay());
manager.save(invoiceSchedule);
setInvoiceSchedule(invoiceSchedule);
return SUCCESS;
}