• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/update/crmentitycreatorstepper.php
  • Класс: BitrixSaleUpdateCrmEntityCreator
  • Вызов: CrmEntityCreator::create
public function create(): SaleResult
{
	$result = new SaleResult();

	$contactCompanyCollection = $this->order->getContactCompanyCollection();
	if ($contactCompanyCollection && $contactCompanyCollection->isEmpty())
	{
		$this->addContactCompany();
	}

	$this->setContactCompanyRequisites();

	if (!$this->isSetResponsible())
	{
		$this->setResponsible();
	}

	$saveOrderResult = $this->order->save();
	if ($saveOrderResult->isSuccess())
	{
		$this->addTimeLines();
	}
	else
	{
		$result->addErrors($saveOrderResult->getErrors());
	}

	return $result;
}