}
if(getPODiscountSchema().getId() != null && !"".equalsIgnoreCase(getPODiscountSchema().getId())){
setPODiscountSchema((DiscountSchema) manager.getById(DiscountSchema.class, getPODiscountSchema().getId()));
}
BusinessPartnerGroup businessPartnerGroup;
if(getBusinessPartnerGroup().getId() == null || "".equalsIgnoreCase(getBusinessPartnerGroup().getId())){
businessPartnerGroup = new BusinessPartnerGroup();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
businessPartnerGroup = (BusinessPartnerGroup) manager.getById(BusinessPartnerGroup.class, getBusinessPartnerGroup().getId());
logInfo = new LogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
businessPartnerGroup.setLogInformation(logInfo);
businessPartnerGroup.setSearchKey(getBusinessPartnerGroup().getSearchKey());
businessPartnerGroup.setName(getBusinessPartnerGroup().getName());
businessPartnerGroup.setDescription(getBusinessPartnerGroup().getDescription());
businessPartnerGroup.setPdefault(getBusinessPartnerGroup().getPdefault());
businessPartnerGroup.setPriorityBase(getBusinessPartnerGroup().getPriorityBase());
businessPartnerGroup.setPriceList(getPriceList());
businessPartnerGroup.setDiscountSchema(getDiscountSchema());
businessPartnerGroup.setCreditWatch(getBusinessPartnerGroup().getCreditWatch());
businessPartnerGroup.setDunning(getDunning());
businessPartnerGroup.setConfidentalInfo(getBusinessPartnerGroup().getConfidentalInfo());
businessPartnerGroup.setPurchasePriseList(getPurchasePriceList());
businessPartnerGroup.setPODiscountSchema(getPODiscountSchema());
businessPartnerGroup.setPriceMacthTolerance(getBusinessPartnerGroup().getPriceMacthTolerance());
manager.save(businessPartnerGroup);
setBusinessPartnerGroup(businessPartnerGroup);
return SUCCESS;
}