• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Reservation/OrderSynchronizer.php
  • Класс: Bitrix\Crm\Reservation\OrderSynchronizer
  • Вызов: OrderSynchronizer::makeFormDataForOrderBuilder
private function makeFormDataForOrderBuilder(array $products): array
{
	$result = [
		'OWNER_ID' => $this->dealId,
		'OWNER_TYPE_ID' => \CCrmOwnerType::Deal,
		'RESPONSIBLE_ID' => $this->dealFields['ASSIGNED_BY_ID'],
		'CURRENCY' => $this->dealFields['CURRENCY_ID'],
	];

	if ($this->order)
	{
		$result['ID'] = $this->order->getId();

		if ($this->order->getCurrency())
		{
			$result['CURRENCY'] = $this->order->getCurrency();
		}

		if ($this->order->getUserId())
		{
			$result['USER_ID'] = $this->order->getUserId();
		}
	}

	$result['PRODUCT'] = $this->prepareProductsForBuilder($products);

	/**
	 * Client Info
	 */
	if ($this->order && !$this->order->getContactCompanyCollection()->isEmpty())
	{
		$result['CLIENT'] = ClientInfo::createFromOwner(\CCrmOwnerType::Order, $this->order->getId())->toArray(false);
	}
	else
	{
		$result['CLIENT'] = ClientInfo::createFromOwner(\CCrmOwnerType::Deal, $this->dealId)->toArray(false);
	}

	return $result;
}