• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_pay_system.php
  • Класс: \CCrmPaySystem
  • Вызов: CCrmPaySystem::getPersonTypesList
static function getPersonTypesList($getEmpty = false)
{
	$arPtIDs = self::getPersonTypeIDs();

	if(empty($arPtIDs) || !CModule::IncludeModule('sale'))
		return array();

	$arReturn = array();

	if($getEmpty)
		$arReturn[""] = GetMessage('CRM_ANY');

	$dbRes = \Bitrix\Crm\Invoice\PersonType::getList([
		'select' => ['ID', 'CODE'],
		'filter' => [
			'@ID' => [$arPtIDs['COMPANY'], $arPtIDs['CONTACT']]
		],
		'order' => [
			'SORT' => "ASC",
			'NAME' => 'ASC'
		]
	]);

	while($arPT = $dbRes->fetch())
		$arReturn[$arPT['ID']] = GetMessage($arPT['CODE']."_PT");

	return $arReturn;
}