addActionError("BreakDiscount is required");
}
if(hasErrors()){
return INPUT;
}
DiscountBreak discountBreak;
if(getDiscountBreak().getId() == null || "".equalsIgnoreCase(getDiscountBreak().getId())){
discountBreak = new DiscountBreak();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
discountBreak = (DiscountBreak) manager.getById(ProductCategory.class, getDiscountBreak().getId());
logInfo = discountBreak.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
discountBreak.setLogInformation(logInfo);
discountBreak.setSequence(getDiscountBreak().getSequence());
discountBreak.setBreakValue(getDiscountBreak().getBreakValue());
discountBreak.setBreakDiscount(getDiscountBreak().getBreakDiscount());
discountBreak.setBPartnerFlatDiscount(getDiscountBreak().getBPartnerFlatDiscount());
discountBreak.setProductCategory(getDiscountBreak().getProductCategory());
discountBreak.setProduct(getDiscountBreak().getProduct());
discountBreak.setDiscountSchema(getDiscountBreak().getDiscountSchema());
manager.save(discountBreak);
setDiscountBreak(getDiscountBreak());
return SUCCESS;