• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/journal.php
  • Класс: BitrixSaleTradingPlatformVkJournal
  • Вызов: Journal::getCheckedEndingJournal
static function getCheckedEndingJournal($type, $exportId, $journal)
{
	$runningProcess = self::getCurrentProcess($exportId);
	$runningProcessType = FeedManager::prepareType($runningProcess['TYPE']);
	
	if ($runningProcess && $runningProcessType == $type)
	{
//			if process was running, but not eyt cleared journal
		if (isset($journal[$type]["START"]) && isset($journal[$type]["END"]))
		{
			unset($journal[$type]["END"]);
			unset($journal[$type]["ABORT"]);
			$journal[$type]["COUNT"] = 0;
			
			ExportProfileTable::update($exportId, array("JOURNAL" => $journal));
		}
	}
	
	else
	{
//			if journal not closed, but process not running, it means that process was stopped manually - close journal
		if (isset($journal[$type]["START"]) && !isset($journal[$type]["END"]))
		{
			$journal[$type]["ABORT"] = true;
			$journal[$type]["END"] = $journal[$type]["START"];
			
			ExportProfileTable::update($exportId, array("JOURNAL" => $journal));
		}
	}
	
	return $journal;
}