• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/import/import.php
  • Класс: BitrixSaleLocationImportis
  • Вызов: is::getSubpercentForStageProcessFiles
protected function getSubpercentForStageProcessFiles()
{
	$pRange = $this->getStagePercent($this->stage) - $this->getStagePercent($this->stage - 1);
	
	$totalSize = 0;
	$fileBytesRead = 0;

	if(!isset($this->data['current']['fIndex']))
		return 0;

	$fIndex = $this->data['current']['fIndex'];

	$i = -1;
	foreach($this->data['files'] as $file)
	{
		$i++;

		if($i < $fIndex)
			$fileBytesRead += $file['size'];

		$totalSize += $file['size'];
	}

	if(!$totalSize)
		return 0;

	return round($pRange * (intval($fileBytesRead + $this->data['current']['bytesRead']) / $totalSize));
}