}
if(hasErrors()){
return INPUT;
}
PriceList priceList;
if(getPriceList().getId() == null || "".equalsIgnoreCase(getPriceList().getId())){
priceList = new PriceList();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
msg = "Succesfully Add"+getPriceList().getName();
} else {
priceList = (PriceList) manager.getById(PriceList.class, getPriceList().getId());
logInfo = priceList.getLogInformation();
msg = "Succesfully Edit"+getPriceList().getName();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
priceList.setLogInformation(logInfo);
priceList.setCurrency(getCurrency());
priceList.setName(getPriceList().getName());
priceList.setDescription(getPriceList().getDescription());
priceList.setPdefault(getPriceList().getPdefault());
priceList.setSalesPriceList(getPriceList().getSalesPriceList());
priceList.setEnforcePriceLimit(getPriceList().getEnforcePriceLimit());
priceList.setPriceIncludesTax(getPriceList().getPriceIncludesTax());
priceList.setPriceDecision(getPriceList().getPriceDecision());
manager.save(priceList);
setPriceList(priceList);
return SUCCESS;
}