• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/onec/documentbase.php
  • Класс: BitrixSaleExchangeOneCDocumentBase
  • Вызов: DocumentBase::resolveCashBoxCheksParams
static function resolveCashBoxCheksParams(array $value, array $fieldsInfo)
{
	$result = null;
	$message = self::getMessage();

	if (isset($value["#"][$message["CC_BSC1_CASHBOX_CHECKS"]][0]["#"][$message["CC_BSC1_CASHBOX_CHECK"]][0]['#'])
		&& !empty($value["#"][$message["CC_BSC1_CASHBOX_CHECKS"]][0]["#"][$message["CC_BSC1_CASHBOX_CHECK"]][0]['#']))
	{
		$properties = array();
		$val = $value["#"][$message["CC_BSC1_CASHBOX_CHECKS"]][0]["#"][$message["CC_BSC1_CASHBOX_CHECK"]][0];

		$id = $val["#"][$message["CC_BSC1_ID"]][0]["#"];
		self::internalizeFields($id, $fieldsInfo);
		$result['ID'] = $id;

		if (isset($val["#"][$message["CC_BSC1_PROPERTY_VALUES"]][0]["#"][$message["CC_BSC1_PROPERTY_VALUE"]]) &&
			isset($val["#"][$message["CC_BSC1_PROPERTY_VALUES"]][0]["#"][$message["CC_BSC1_PROPERTY_VALUE"]][0]['#']) &&
			!empty($val["#"][$message["CC_BSC1_PROPERTY_VALUES"]][0]["#"][$message["CC_BSC1_PROPERTY_VALUE"]][0]['#']))
		{
			foreach($val["#"][$message["CC_BSC1_PROPERTY_VALUES"]][0]["#"][$message["CC_BSC1_PROPERTY_VALUE"]] as $property)
			{
				$propertyName = $property["#"][$message["CC_BSC1_ID"]][0]["#"];
				$propertyValue = $property["#"][$message["CC_BSC1_VALUE"]][0]["#"];
				if($propertyValue <> '')
					$properties[$propertyName] = $propertyValue;
			}
		}

		foreach($fieldsInfo['PROPERTIES']['FIELDS'] as $name => $fieldInfo)
		{
			if(!empty($properties[$message["CC_BSC1_".$name]]))
			{
				$fieldValue = $properties[$message["CC_BSC1_".$name]];

				self::internalizeFields($fieldValue, $fieldInfo);

				$result[$name] = $fieldValue;
			}
		}

		return $result;
	}
}