CCrmSipHelper::getInvoices

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmSipHelper
  4. getInvoices
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/sip_helper.php
  • Класс: \CCrmSipHelper
  • Вызов: CCrmSipHelper::getInvoices
static function getInvoices($entityID, $isAdmin): array
{
	$invoices = [];
	$dbInvoice = CCrmInvoice::GetList(
		['DATE_INSERT' => 'ASC'],
		[
			'=UF_CONTACT_ID' => $entityID,
			'PAYED' => 'N',
			'CANCELED' => 'N',
			'CHECK_PERMISSIONS' => $isAdmin ? 'N' : 'Y'
		],
		false,
		['nTopCount' => 2],
		['ID', 'ORDER_TOPIC', 'DATE_BILL', 'PRICE', 'CURRENCY', 'STATUS_ID']
	);
	if(is_object($dbInvoice))
	{
		while($invoiceFields = $dbInvoice->Fetch())
		{
			$invoiceFields['PRICE_FORMATTED'] = CCrmCurrency::MoneyToString($invoiceFields['PRICE'], $invoiceFields['CURRENCY']);
			$invoiceFields['SHOW_URL'] = CCrmOwnerType::GetEntityShowPath(CCrmOwnerType::Invoice, $invoiceFields['ID']);
			$invoices[] = $invoiceFields;
		}
	}

	return $invoices;
}

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