}
if(hasErrors()){
return INPUT;
}
PriceListVersion priceListVersion;
if(getPriceListVersion().getId() == null || "".equalsIgnoreCase(getPriceListVersion().getId())){
priceListVersion = new PriceListVersion();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
priceListVersion = (PriceListVersion) manager.getById(PriceListVersion.class, getPriceList().getId());
logInfo = priceListVersion.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
priceListVersion.setLogInformation(logInfo);
priceListVersion.setSPriceList(getPriceListVersion().getSPriceList());
priceListVersion.setName(getPriceListVersion().getName());
priceListVersion.setDescription(getPriceListVersion().getDescription());
priceListVersion.setValidFrom(getPriceListVersion().getValidFrom());
priceListVersion.setPriceListSchema(getPriceListVersion().getPriceListSchema());
priceListVersion.setBasePriceList(getPriceListVersion().getBasePriceList());
manager.save(priceListVersion);
setPriceListVersion(getPriceListVersion());
return SUCCESS;
}