Common/EventListener/AbstractSaleListener.php
protected function preventForbiddenChange(SaleInterface $sale)
    {
        if ($this->persistenceHelper->isChanged($sale, 'customer')) {
            list($old, $new) = $this->persistenceHelper->getChangeSet($sale, 'customer');
            if ($old != $new && (0 < $sale->getOutstandingAccepted() || 0 < $sale->getOutstandingExpired())) {
                throw new Exception\IllegalOperationException(
                    "Changing the customer while there is pending outstanding is not yet supported."
                );
            }
        }
    }
protected function preventForbiddenChange(SaleInterface $sale)
    {
        if ($this->persistenceHelper->isChanged($sale, 'customer')) {
            list($old, $new) = $this->persistenceHelper->getChangeSet($sale, 'customer');
            if ($old != $new && (0 < $sale->getOutstandingAccepted() || 0 < $sale->getOutstandingExpired())) {
                throw new Exception\IllegalOperationException(
                    "Changing the customer while there is pending outstanding is not yet supported."
                );
            }
        }
    }
Prevent forbidden change(s).

@param SaleInterface $sale

@throws Exception\IllegalOperationException