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

	if(empty($arProps) && CModule::IncludeModule('sale'))
	{
		$arPersTypeIds = self::getPersonTypeIDs();

		$dbRes = \Bitrix\Crm\Invoice\Property::getList([
			'select' => [
				'ID', 'CODE', 'NAME', 'TYPE', 'SORT', 'PERSON_TYPE_ID'
			],
			'filter' => [
				'PERSON_TYPE_ID' => $arPersTypeIds
			],
			'order' => [
				'SORT' => 'ASC',
				'NAME' => 'ASC'
			]
		]);

		while ($arOrderProps = $dbRes->fetch())
		{
			$title = htmlspecialcharsbx($arOrderProps["NAME"]);
			$code = htmlspecialcharsbx($arOrderProps["CODE"]);

			$idx = $arOrderProps["CODE"] <> '' ? $code : $arOrderProps["ID"];
			$arProps[$arOrderProps["PERSON_TYPE_ID"]][$idx] = $title;

			if ($arOrderProps["TYPE"] == "LOCATION")
			{
				$idx = $code <> '' ? $code."_COUNTRY" : $arOrderProps["ID"]."_COUNTRY";
				$arProps[$arOrderProps["PERSON_TYPE_ID"]][$idx] = $title." (".GetMessage("CRM_PS_JCOUNTRY").")";

				$idx = $code <> '' ? $code."_CITY" : $arOrderProps["ID"]."_CITY";
				$arProps[$arOrderProps["PERSON_TYPE_ID"]][$idx] = $title." (".GetMessage("CRM_PS_JCITY").")";
			}
		}
	}

	if($persTypeId && isset($arProps[$persTypeId]))
		$arReturn = $arProps[$persTypeId];
	elseif($persTypeId && !isset($arProps[$persTypeId]))
		$arReturn = false;
	else
		$arReturn = $arProps;

	return $arReturn;
}