}
if(getPriceList().getId() != null && !"".equalsIgnoreCase(getPriceList().getId())){
setPriceList((PriceList) manager.getById(PriceList.class, getPriceList().getId()));
}
Vendor vendor;
if(getVendor().getId() == null && "".equalsIgnoreCase(getVendor().getId())){
vendor = new Vendor();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
vendor = (Vendor) manager.getById(Vendor.class, getVendor().getId());
logInfo = vendor.getLogInformation();
}
logInfo.setActiveFlag(1);
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
vendor.setLogInformation(logInfo);
vendor.setSearchKey(getBusinessPartner().getSearchKey());
vendor.setName(getBusinessPartner().getName1());
vendor.setIsVendor(getVendor().getIsVendor());
vendor.setSalesRepresentative(getVendor().getSalesRepresentative());
vendor.setPaymentRule(getVendor().getPaymentRule());
vendor.setPaymentTerm(getPaymentTerm());
vendor.setPriceList(getPriceList());
vendor.setDiscountSchema(getDiscountSchema());
manager.save(vendor);
setVendor(vendor);
return SUCCESS;
}