if (customer == null)
throw new IllegalStateException("order.getCustomer() returned null!");
PersistenceManager pm = getPersistenceManager();
Trader trader = Trader.getTrader(pm);
OrganisationLegalEntity mandator = trader.getMandator();
if (mandator.equals(customer) && (vendor instanceof OrganisationLegalEntity)) {
tradeSide = TradeSide.customerCrossOrganisation;
// TODO: Implement foreign stuff
throw new UnsupportedOperationException("NYI");
}
else {
if (mandator.equals(vendor))
tradeSide = TradeSide.vendor;
else if (mandator.equals(customer))
tradeSide = TradeSide.customerLocal;
else
throw new IllegalStateException("mandator is neither customer nor vendor! order=" + recurringOrder + " mandator=" + mandator);
offerIDPrefix = getOfferIDPrefix(user, offerIDPrefix);