• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/Accounting.php
  • Класс: Bitrix\Crm\Service\Accounting
  • Вызов: Accounting::resolvePersonTypeId
public function resolvePersonTypeId(Item $item): int
{
	$personTypes = \CCrmPaySystem::getPersonTypeIDs();

	if (isset($personTypes['COMPANY']) && ($item->getCompanyId() > 0))
	{
		return (int)$personTypes['COMPANY'];
	}
	if (isset($personTypes['CONTACT']))
	{
		return (int)$personTypes['CONTACT'];
	}

	return 0;
}