}
if(hasErrors()){
return INPUT;
}
RevenueRecognition revenueRecognition;
if(getRevenueRecognition().getId() == null || "".equalsIgnoreCase(getRevenueRecognition().getId())){
revenueRecognition = new RevenueRecognition();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
revenueRecognition = (RevenueRecognition) manager.getById(RevenueRecognition.class, getRevenueRecognition().getId());
logInfo = revenueRecognition.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
revenueRecognition.setName(getRevenueRecognition().getName());
revenueRecognition.setDescription(getRevenueRecognition().getDescription());
revenueRecognition.setTimeBased(getRevenueRecognition().getTimeBased());
revenueRecognition.setRevenueFrequency(getRevenueRecognition().getRevenueFrequency());
revenueRecognition.setNumberOfMonts(getRevenueRecognition().getNumberOfMonts());
manager.save(revenueRecognition);
setRevenueRecognition(revenueRecognition);
return SUCCESS;
}