• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/posting.php
  • Класс: BitrixSenderPostingTable
  • Вызов: PostingTable::getSendPercent
static function getSendPercent($id)
{
	$ar = static::getRecipientCountByStatus($id);
	$count = 0;
	foreach ($ar as $k => $v)
	{
		$count += $v;
	}

	$countNew = 0;
	if(isset($ar[PostingRecipientTable::SEND_RESULT_NONE]))
	{
		$countNew = $ar[PostingRecipientTable::SEND_RESULT_NONE];
	}

	if($count > 0 && $countNew > 0)
	{
		return round(($count - $countNew) / $count, 2) * 100;
	}
	else
	{
		return 100;
	}
}