Common/Calculator/MarginCalculator.php
private function getPurchaseCost(Model\SaleItemInterface $item)
    {
        /** @var \Ekyna\Component\Commerce\Subject\Model\SubjectInterface $subject */
        if (null === $subject = $this->subjectHelper->resolve($item)) {
            return null;
        }

        $currency = $item->getSale()->getCurrency()->getCode();

        if (null !== $cost = $this->purchaseCostGuesser->guess($subject, $currency)) {
            return $cost;
        }

        return null;
    }
private function getPurchaseCost(Model\SaleItemInterface $item)
    {
        /** @var \Ekyna\Component\Commerce\Subject\Model\SubjectInterface $subject */
        if (null === $subject = $this->subjectHelper->resolve($item)) {
            return null;
        }

        $currency = $item->getSale()->getCurrency()->getCode();

        if (null !== $cost = $this->purchaseCostGuesser->guess($subject, $currency)) {
            return $cost;
        }

        return null;
    }
Returns the sale item purchase cost.

@param Model\SaleItemInterface $item

@return float|null