// Business Partner
if (bp_id == null) {
final BusinessPartner syncBp = extPos.getBusinessPartner();
iOrder.setBusinessPartner(syncBp);
final Location syncBpLoc = (syncBp.getBusinessPartnerLocationList()
.isEmpty()) ? null : syncBp
.getBusinessPartnerLocationList().get(0);
iOrder.setPartnerAddress(syncBpLoc);
// Payment Term
iOrder.setPaymentTerms(syncBp.getPaymentTerms());
} else {
final BusinessPartner syncSelBp = (BusinessPartner) OBDal
.getInstance().get("BusinessPartner", bp_id);
iOrder.setBusinessPartner(syncSelBp);
final Location syncBpLoc = (syncSelBp
.getBusinessPartnerLocationList().isEmpty()) ? null
: syncSelBp.getBusinessPartnerLocationList().get(0);
iOrder.setPartnerAddress(syncBpLoc);
}