• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/cashbox/cashboxbitrix.php
  • Класс: BitrixSaleCashboxCashboxBitrix
  • Вызов: CashboxBitrix::applyPrintResult
static function applyPrintResult(array $data)
{
	$processedIds = array();

	foreach ($data['kkm'] as $kkm)
	{
		if (isset($kkm['printed']) && is_array($kkm['printed']))
		{
			foreach ($kkm['printed'] as $item)
			{
				$uuid = static::parseUuid($item['uuid']);

				$result = null;
				if ($uuid['type'] === static::UUID_TYPE_CHECK)
				{
					$result = static::applyCheckResult($item);
				}
				elseif ($uuid['type'] === static::UUID_TYPE_REPORT)
				{
					$result = static::applyZReportResult($item);
				}

				if ($result !== null)
				{
					if ($result->isSuccess())
					{
						$processedIds[] = $item['uuid'];
					}
					else
					{
						$errors = $result->getErrors();
						foreach ($errors as $error)
						{
							if ($error instanceof ErrorsError)
							{
								$processedIds[] = $item['uuid'];
								break;
							}
						}
					}
				}
			}
		}
	}

	return $processedIds;
}