• Модуль: catalogmobile
  • Путь к файлу: ~/bitrix/modules/catalogmobile/lib/Controller/StoreDocument.php
  • Класс: BitrixCatalogMobileControllerStoreDocument
  • Вызов: StoreDocument::conductAction
public function conductAction(int $id, string $docType, CurrentUser $currentUser): ?array
{
	if ($docType === StoreDocumentTable::TYPE_SALES_ORDERS)
	{
		return $this->setShipped($id, 'Y');
	}

	if (!$this->checkDocumentAccess(ActionDictionary::ACTION_STORE_DOCUMENT_CONDUCT, $id, $currentUser))
	{
		$this->addError(new Error(Loc::getMessage('MOBILE_CONTROLLER_CATALOG_ERROR_CONDUCT_PERMS')));

		return null;
	}

	$command = new ConductDocumentCommand($id, (int)$currentUser->getId());
	$result = $command();
	if (!$result->isSuccess())
	{
		$this->addErrors($result->getErrors());
		return null;
	}

	$statuses = $this->getStatusesList();

	return [
		'result' => $result->isSuccess(),
		'item' => [
			'statuses' => [
				CCatalogDocs::CONDUCTED,
			],
			'fields' => [
				[
					'name' => 'DOC_STATUS',
					'value' => [
						$statuses[CCatalogDocs::CONDUCTED],
					]
				],
			],
		],
	];
}