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

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

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

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

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