CCrmExternalSaleImport::ParseOrderDataOrderTaxes

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmExternalSaleImport
  4. ParseOrderDataOrderTaxes
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_external_sale_import.php
  • Класс: \CCrmExternalSaleImport
  • Вызов: CCrmExternalSaleImport::ParseOrderDataOrderTaxes
private function ParseOrderDataOrderTaxes($document, $arSettings, &$arOrder)
{
	if (!is_array($document["Tax"]))
		return;

	$arOrder["TAXES"] = array();
	foreach ($document["Tax"] as $arTax)
	{
		$arTax = $arTax["#"];
		$arResultTmp = array();

		foreach ($arTax as $key => $value)
		{
			$value = $value[0]["#"];
			switch ($key)
			{
				case 'ItemName':
					$arResultTmp["NAME"] = $value;
					break;
				case 'InPrice':
					$arResultTmp["IN_PRICE"] = (mb_strtolower($value) == 'true') ? true : false;
					break;
				case 'Amount':
					$arResultTmp["PRICE"] = str_replace($arSettings["SumFormat"]["CRD"], ".", $value);
					break;
				default:
					$arResultTmp[$key] = $value;
					break;
			}
		}

		$arOrder["TAXES"][] = $arResultTmp;
	}
}

Добавить комментарий