Supplier/EventListener/SupplierOrderListener.php
protected function updateExchangeRate(SupplierOrderInterface $order)
    {
        // TODO Remove when supplier order payments will be implemented.
        if (null !== $order->getExchangeRate()) {
            return false;
        }

        if (!SupplierOrderStates::isStockableState($order->getState())) {
            return false;
        }

        $date = new \DateTime();

        $rate = $this->currencyConverter->getRate(
            $this->currencyConverter->getDefaultCurrency(),
            $order->getCurrency()->getCode(),
            $date
        );

        $order
            ->setExchangeRate($rate)
            ->setExchangeDate($date);

        return true;
    }
protected function updateExchangeRate(SupplierOrderInterface $order)
    {
        // TODO Remove when supplier order payments will be implemented.
        if (null !== $order->getExchangeRate()) {
            return false;
        }

        if (!SupplierOrderStates::isStockableState($order->getState())) {
            return false;
        }

        $date = new \DateTime();

        $rate = $this->currencyConverter->getRate(
            $this->currencyConverter->getDefaultCurrency(),
            $order->getCurrency()->getCode(),
            $date
        );

        $order
            ->setExchangeRate($rate)
            ->setExchangeDate($date);

        return true;
    }
Updates the order exchange rate.

@param SupplierOrderInterface $order

@return bool Whether the payment has been changed or not.