CCrmVat::GetAll

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmVat
  4. GetAll
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_vat.php
  • Класс: \CCrmVat
  • Вызов: CCrmVat::GetAll
static function GetAll()
{
	if (!Loader::includeModule('catalog'))
		return false;

	$VATS = self::$VATS ?? null;

	if (!$VATS)
	{
		$VATS = [];
		$iterator = Catalog\VatTable::getList([
			'select' => [
				'ID',
				'ACTIVE',
				'SORT',
				'NAME',
				'RATE',
				'EXCLUDE_VAT',
				'XML_ID',
			],
			'order' => [
				'SORT' => 'ASC',
				'ID' => 'ASC',
			]
		]);
		while ($row = $iterator->fetch())
		{
			$id = (int)$row['ID'];
			$row['C_SORT'] = $row['SORT']; // compatibility - legacy code
			$VATS[$id] = $row;
		}
		unset($row, $iterator);

		self::$VATS = $VATS;
	}

	return $VATS;
}

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