• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/businessvalue_old.php
  • Класс: BitrixSaleBusinessValueOld
  • Вызов: BusinessValueOld::getForPayment
static function getForPayment($payment, $codeName, $order = null)
{
	static $cache = array();

	if (is_numeric($payment))
	{
		$payment = ($v = $cache[$payment]) ? $v : PaymentTable::getById($payment)->fetch();
	}
	elseif ($payment instanceof Payment)
	{
		if (($collection = $payment->getCollection()) && ($o = $collection->getOrder()))
			$order = $o;

		$payment = $payment->getFieldValues();
	}

	if (is_array($payment))
	{
		$cache[$payment['ID']] = $payment;

		return self::get($codeName, $order ? $order : $payment['ORDER_ID'], $payment, null);
	}
	else
	{
		return null;
	}
}