• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/order/order.php
  • Класс: Bitrix\Crm\Order\Order
  • Вызов: Order::addTimelineEntryOnCancel
private function addTimelineEntryOnCancel()
{
	$fields = [
		'ID' => $this->getId(),
		'CANCELED' => $this->getField('CANCELED'),
	];

	if ($this->getField('CANCELED') === 'Y')
	{
		$fields['REASON_CANCELED'] = $this->getField('REASON_CANCELED');
		$fields['EMP_CANCELED_ID'] = $this->getField('EMP_CANCELED_ID');
	}

	Crm\Timeline\OrderController::getInstance()->onCancel(
		$this->getId(),
		[
			'FIELDS' => $fields,
			'BINDINGS' => TimelineBindingsMaker::makeByOrder($this, ['withDeal' => false])
		]
	);
}