CCrmStatusInvoice::getStatusIds

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmStatusInvoice
  4. getStatusIds
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_status_invoice.php
  • Класс: \CCrmStatusInvoice
  • Вызов: CCrmStatusInvoice::getStatusIds
static function getStatusIds($statusType)
{
	$result = array();

	if (!in_array($statusType, array('success', 'failed', 'neutral'), true))
		return $result;

	$statuses = self::getStatusList('INVOICE_STATUS');
	if ($statusType === 'success')
	{
		$result[] = 'P';
	}
	else if ($statusType === 'failed')
	{
		$check = false;
		foreach($statuses as $statusId => $statusInfo)
		{
			if ($check)
				$result[] = $statusId;
			if ($statusId === 'P')
				$check = true;
		}
		unset($check);
	}
	else if ($statusType === 'neutral')
	{
		foreach($statuses as $statusId => $statusInfo)
		{
			if ($statusId === 'P')
				break;
			$result[] = $statusId;
		}
	}

	return $result;
}

Добавить комментарий