CAllCrmQuote::PrepareSalePaymentData

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CAllCrmQuote
  4. PrepareSalePaymentData
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_quote.php
  • Класс: \CAllCrmQuote
  • Вызов: CAllCrmQuote::PrepareSalePaymentData
static function PrepareSalePaymentData(array &$arQuote)
{
	$ID = isset($arQuote['ID']) ? intval($arQuote['ID']) : 0;
	if($ID <= 0)
	{
		return null;
	}

	CCrmQuote::RewriteClientFields($arQuote, false);

	if (isset($arQuote['TERMS']) && !empty($arQuote['TERMS']))
	{
		$arQuote['TERMS'] = TextHelper::convertBbCodeToHtml($arQuote['TERMS']);
	}
	if (isset($arQuote['CONTENT']) && !empty($arQuote['CONTENT']))
	{
		$arQuote['CONTENT'] = TextHelper::convertBbCodeToHtml($arQuote['CONTENT']);
	}

	$fieldMap = self::GetSaleOrderMap();
	$order = array();
	foreach($fieldMap as $orderFileldID => $fileldID)
	{
		if(!is_array($fileldID))
		{
			$order[$orderFileldID] = isset($arQuote[$fileldID]) ? $arQuote[$fileldID] : '';
			if ($fileldID === 'CURRENCY_ID' && empty($order[$orderFileldID]))
				$order[$orderFileldID] = CCrmCurrency::GetBaseCurrencyID();
		}
		else
		{
			$v = '';
			foreach($fileldID as $item)
			{
				$s = isset($arQuote[$item]) ? trim($arQuote[$item]) : '';
				if($s === '')
				{
					continue;
				}

				if(preg_match('/$/i', $v) !== 1)
				{
					$v .= '
'; } $v .= $s; } $order[$orderFileldID] = $v; } } $personTypeIDs = CCrmPaySystem::getPersonTypeIDs(); $personTypeID = isset($arQuote['PERSON_TYPE_ID']) ? intval($arQuote['PERSON_TYPE_ID']) : 0; $propertyMap = isset($personTypeIDs['COMPANY']) && intval($personTypeIDs['COMPANY']) === $personTypeID ? self::GetCompanyPersonTypeMap() : self::GetContactPersonTypeMap(); $properties = array(); foreach($propertyMap as $propertyFileldID => $fileldID) { $properties[$propertyFileldID] = isset($arQuote[$fileldID]) ? $arQuote[$fileldID] : ''; } $userFields = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields(self::$sUFEntityID, 0, LANGUAGE_ID); $supportedUserTypeIDs = array('string', 'double', 'integer', 'boolean', 'datetime'); foreach($userFields as $name => &$userField) { $fieldType = $userField['USER_TYPE_ID']; if(!isset($arQuote[$name]) || !in_array($fieldType, $supportedUserTypeIDs, true)) { continue; } $fieldValue = $arQuote[$name]; if($fieldType === 'boolean') { $fieldValue = GetMessage(intval($fieldValue) > 0 ? 'MAIN_YES' : 'MAIN_NO'); } $properties[$name] = $fieldValue; } unset($userField); $productRows = self::LoadProductRows($ID); $currencyID = isset($arQuote['CURRENCY_ID']) ? $arQuote['CURRENCY_ID'] : CCrmCurrency::GetBaseCurrencyID(); $calculatedOrder = CCrmSaleHelper::Calculate( $productRows, $currencyID, $personTypeID, false, SITE_ID, array('LOCATION_ID' => isset($arQuote['LOCATION_ID']) ? $arQuote['LOCATION_ID'] : '') ); $taxList = isset($calculatedOrder['TAX_LIST']) ? $calculatedOrder['TAX_LIST'] : array(); foreach($taxList as &$taxInfo) { $taxInfo['TAX_NAME'] = isset($taxInfo['NAME']) ? $taxInfo['NAME'] : ''; } unset($taxInfo); if (CModule::IncludeModule('iblock')) { if (isset($calculatedOrder['BASKET_ITEMS']) && $calculatedOrder['BASKET_ITEMS']) { $productProps = array(); $productIds = array(); foreach ($calculatedOrder['BASKET_ITEMS'] as $i => $row) { $productIds[] = $row['PRODUCT_ID']; $productProps[$row['PRODUCT_ID']] = array(); } if ($productIds) { $productIdsByCatalogMap = array(); $dbRes = \CCrmProduct::GetList(array(), array('ID' => $productIds), array('ID', 'CATALOG_ID')); while ($data = $dbRes->Fetch()) { $catalogId = isset($data['CATALOG_ID']) ? intval($data['CATALOG_ID']) : \CCrmCatalog::EnsureDefaultExists(); if (!isset($productIdsByCatalogMap[$catalogId])) $productIdsByCatalogMap[$catalogId] = array(); $productIdsByCatalogMap[$catalogId][] = $data['ID']; } if ($productIdsByCatalogMap) { foreach ($productIdsByCatalogMap as $catalogId => $ids) CIBlockElement::GetPropertyValuesArray($productProps, $catalogId, array('ID' => $ids)); } } foreach ($calculatedOrder['BASKET_ITEMS'] as $i => $row) { foreach ($productProps[$row['PRODUCT_ID']] as $property) $calculatedOrder['BASKET_ITEMS'][$i]['PROPERTY_'.$property['ID']] = $property['VALUE']; } } } $requisiteUserFieldsInfo = null; // requisite identifiers $requisiteId = 0; $bankDetailId = 0; $mcRequisiteId = 0; $mcBankDetailId = 0; if ($row = \Bitrix\Crm\Requisite\EntityLink::getList( array( 'filter' => array( '=ENTITY_TYPE_ID' => CCrmOwnerType::Quote, '=ENTITY_ID' => $ID ), 'select' => array('REQUISITE_ID', 'BANK_DETAIL_ID', 'MC_REQUISITE_ID', 'MC_BANK_DETAIL_ID'), 'limit' => 1 ) )->fetch()) { if (isset($row['REQUISITE_ID']) && $row['REQUISITE_ID'] > 0) $requisiteId = (int)$row['REQUISITE_ID']; if (isset($row['BANK_DETAIL_ID']) && $row['BANK_DETAIL_ID'] > 0) $bankDetailId = (int)$row['BANK_DETAIL_ID']; if (isset($row['MC_REQUISITE_ID']) && $row['MC_REQUISITE_ID'] > 0) $mcRequisiteId = (int)$row['MC_REQUISITE_ID']; if (isset($row['MC_BANK_DETAIL_ID']) && $row['MC_BANK_DETAIL_ID'] > 0) $mcBankDetailId = (int)$row['MC_BANK_DETAIL_ID']; } if (!isset($arQuote['MYCOMPANY_ID']) || $arQuote['MYCOMPANY_ID'] <= 0) { $defLink = Bitrix\Crm\Requisite\EntityLink::getDefaultMyCompanyRequisiteLink(); if (is_array($defLink)) { $arQuote['MYCOMPANY_ID'] = isset($defLink['MYCOMPANY_ID']) ? (int)$defLink['MYCOMPANY_ID'] : 0; $mcRequisiteId = isset($defLink['MC_REQUISITE_ID']) ? (int)$defLink['MC_REQUISITE_ID'] : 0; $mcBankDetailId = isset($defLink['MC_BANK_DETAIL_ID']) ? (int)$defLink['MC_BANK_DETAIL_ID'] : 0; } unset($defLink); } // requisite values $requisiteValues = array(); $presetCountryId = 0; if ($requisiteId > 0) { $requisite = new \Bitrix\Crm\EntityRequisite(); $preset = new \Bitrix\Crm\EntityPreset(); if ($requisiteUserFieldsInfo === null) $requisiteUserFieldsInfo = $requisite->getFormUserFieldsInfo(); $row = $requisite->getList( array('select' => array('*', 'UF_*'), 'filter' => array('=ID' => $requisiteId), 'limit' => 1) )->fetch(); if (is_array($row)) { if (isset($row['PRESET_ID']) && $row['PRESET_ID'] > 0) { $presetFields = array(); $res = $preset->getList(array( 'order' => array('SORT' => 'ASC', 'ID' => 'ASC'), 'filter' => array( '=ENTITY_TYPE_ID' => \Bitrix\Crm\EntityPreset::Requisite, '=ID' => (int)$row['PRESET_ID'] ), 'select' => array('ID', 'COUNTRY_ID', 'SETTINGS'), 'limit' => 1 )); if ($presetData = $res->fetch()) { if (is_array($presetData['SETTINGS'])) { $presetFieldsInfo = $preset->settingsGetFields($presetData['SETTINGS']); foreach ($presetFieldsInfo as $fieldInfo) { if (isset($fieldInfo['FIELD_NAME'])) $presetFields[$fieldInfo['FIELD_NAME']] = true; } unset($presetFieldsInfo, $fieldInfo); } $presetCountryId = (int)$presetData['COUNTRY_ID']; } unset($res, $presetData); if ($presetCountryId > 0) { foreach ($row as $fieldName => $fieldValue) { if (isset($presetFields[$fieldName])) { if (is_array($requisiteUserFieldsInfo[$fieldName]) && $requisiteUserFieldsInfo[$fieldName]['type'] === 'boolean') { $requisiteValues[$fieldName.'|'.$presetCountryId] = $fieldValue ? GetMessage('MAIN_YES') : GetMessage('MAIN_NO'); } elseif ($requisite->isRqListField($fieldName)) { $requisiteValues[$fieldName.'|'.$presetCountryId] = $requisite->getRqListFieldValueTitle( $fieldName, $presetCountryId, (string)$fieldValue ) ; } else { $requisiteValues[$fieldName.'|'.$presetCountryId] = $fieldValue; } } } unset($fieldName, $fieldValue, $valueKey); // addresses foreach ($requisite->getAddresses($requisiteId) as $addrTypeId => $addrFields) { $valueKey = Bitrix\Crm\EntityRequisite::ADDRESS.'_'.$addrTypeId.'|'.$presetCountryId; $addressLines = explode( "\n", str_replace( ["\r\n", "\n", "\r"], "\n", AddressFormatter::getSingleInstance()->formatTextMultiline($addrFields) ) ); $requisiteValues[$valueKey] = is_array($addressLines) ? $addressLines : []; unset($valueKey, $addressLines); } } } } } // full name if ($presetCountryId > 0) { $fullName = isset($requisiteValues['RQ_NAME|'.$presetCountryId]) ? trim(strval($requisiteValues['RQ_NAME|'.$presetCountryId])) : ''; if (empty($fullName)) { $firstName = isset($requisiteValues['RQ_FIRST_NAME|'.$presetCountryId]) ? trim(strval($requisiteValues['RQ_FIRST_NAME|'.$presetCountryId])) : ''; $lastName = isset($requisiteValues['RQ_LAST_NAME|'.$presetCountryId]) ? trim(strval($requisiteValues['RQ_LAST_NAME|'.$presetCountryId])) : ''; $secondName = isset($requisiteValues['RQ_SECOND_NAME|'.$presetCountryId]) ? trim(strval($requisiteValues['RQ_SECOND_NAME|'.$presetCountryId])) : ''; if (!empty($firstName) || !empty($lastName) || !empty($secondName)) { $fullName = CUser::FormatName( \Bitrix\Crm\Format\PersonNameFormatter::getFormat(), array( 'LOGIN' => '[]', 'NAME' => $firstName, 'LAST_NAME' => $lastName, 'SECOND_NAME' => $secondName ), true, false ); if (!empty($fullName) && $fullName !== '[]') { $requisiteValues['RQ_NAME|'.$presetCountryId] = $fullName; } } } } // bank detail values $bankDetailValues = array(); if ($bankDetailId > 0) { $bankDetail = new \Bitrix\Crm\EntityBankDetail(); $row = $bankDetail->getById($bankDetailId); if (is_array($row)) { $countryId = isset($row['COUNTRY_ID']) ? (int)$row['COUNTRY_ID'] : 0; if ($countryId > 0) { foreach ($row as $fieldName => $fieldValue) { $bankDetailValues[$fieldName.'|'.$countryId] = $fieldValue; } unset($fieldName, $fieldValue, $valueKey); } } } // company values $companyValues = array(); $companyId = isset($arQuote['COMPANY_ID']) ? intval($arQuote['COMPANY_ID']) : 0; if ($companyId > 0) { $res = CCrmCompany::GetListEx( array(), array('ID' => $companyId), false, array('nTopCount' => 1), array('ID', 'TITLE') ); $row = $res->Fetch(); if (is_array($row)) { $companyValues = $row; $res = CCrmFieldMulti::GetList( array('ID' => 'asc'), array('ENTITY_ID' => 'COMPANY', 'ELEMENT_ID' => $companyId) ); $skip = array(); while($row = $res->Fetch()) { if (($row['TYPE_ID'] === 'PHONE' || $row['TYPE_ID'] === 'EMAIL') && !isset($skip[$row['COMPLEX_ID']])) { $companyValues[$row['COMPLEX_ID']] = $row['VALUE']; $skip[$row['COMPLEX_ID']] = true; } } } } // contact values $contactValues = array(); $contactId = isset($arQuote['CONTACT_ID']) ? intval($arQuote['CONTACT_ID']) : 0; if ($contactId > 0) { $res = CCrmContact::GetListEx( array(), array('ID' => $contactId), false, array('nTopCount' => 1), array('ID', 'NAME', 'SECOND_NAME', 'LAST_NAME', 'HONORIFIC') ); $row = $res->Fetch(); if (is_array($row)) { $contactValues['ID'] = $row['ID']; $contactValues['FULL_NAME'] = CCrmContact::PrepareFormattedName($row); $res = CCrmFieldMulti::GetList( array('ID' => 'asc'), array('ENTITY_ID' => 'CONTACT', 'ELEMENT_ID' => $contactId) ); $skip = array(); while($row = $res->Fetch()) { if (($row['TYPE_ID'] === 'PHONE' || $row['TYPE_ID'] === 'EMAIL') && !isset($skip[$row['COMPLEX_ID']])) { $contactValues[$row['COMPLEX_ID']] = $row['VALUE']; $skip[$row['COMPLEX_ID']] = true; } } } } // backward compatibility $countryIds = array(); if ($presetCountryId > 0) $countryIds[] = $presetCountryId; else $countryIds = \Bitrix\Crm\EntityRequisite::getAllowedRqFieldCountries(); $personTypeCode = ''; $arPersonTypes = CCrmPaySystem::getPersonTypeIDs(); if ($arPersonTypes['COMPANY'] != "" && $arPersonTypes['CONTACT'] != "") { $personTypeCompany = $arPersonTypes['COMPANY']; $personTypeContact = $arPersonTypes['CONTACT']; $personTypeId = $personTypeContact; $personTypeCode = 'CONTACT'; if ($companyId > 0) { $personTypeId = $personTypeCompany; $personTypeCode = 'COMPANY'; } $requisiteConverted = (COption::GetOptionString('crm', '~CRM_TRANSFER_REQUISITES_TO_'.$personTypeCode, 'N') !== 'Y'); if ($requisiteConverted) { $propsToRequisiteMap = array( $personTypeCompany => array( 'COMPANY_NAME' => 'RQ_COMPANY_NAME', 'COMPANY' => 'RQ_COMPANY_NAME', 'COMPANY_ADR' => 'RQ_ADDR_'.EntityAddressType::Registered, 'INN' => 'RQ_INN', 'KPP' => 'RQ_KPP', 'CONTACT_PERSON' => 'RQ_CONTACT', 'EMAIL' => 'RQ_EMAIL', 'PHONE' => 'RQ_PHONE' ), $personTypeContact => array( 'FIO' => 'RQ_NAME', 'EMAIL' => 'RQ_EMAIL', 'PHONE' => 'RQ_PHONE', 'ADDRESS' => 'RQ_ADDR_'.EntityAddressType::Primary, ), ); if (is_array($properties) && !empty($properties)) { foreach ($countryIds as $countryId) { foreach ($propsToRequisiteMap[$personTypeId] as $propertyCode => $rqIndex) { $rqIndex .= '|'.$countryId; if (isset($properties[$propertyCode]) && !empty($properties[$propertyCode]) && !isset($requisiteValues[$rqIndex])) { $requisiteValues[$rqIndex] = $properties[$propertyCode]; } } } } } } // company full name $companyFullName = ''; if ($presetCountryId > 0) { $companyFullName = isset($requisiteValues['RQ_COMPANY_FULL_NAME|'.$presetCountryId]) ? trim(strval($requisiteValues['RQ_COMPANY_FULL_NAME|'.$presetCountryId])) : ''; if (empty($companyFullName)) { $companyShortName = isset($requisiteValues['RQ_COMPANY_NAME|'.$presetCountryId]) ? trim(strval($requisiteValues['RQ_COMPANY_NAME|'.$presetCountryId])) : ''; if (!empty($companyShortName)) { $companyFullName = $companyShortName; } } } if (empty($companyFullName)) { $companyName = isset($companyValues['TITLE']) ? trim(strval($companyValues['TITLE'])) : ''; if (!empty($companyName)) $companyFullName = $companyName; } if (!empty($companyFullName)) { foreach ($countryIds as $countryId) $requisiteValues['RQ_COMPANY_FULL_NAME|'.$countryId] = $companyFullName; } unset($companyFullName, $companyShortName, $companyName); // my company requisite values $mcRequisiteValues = array(); $mcPresetCountryId = 0; if ($mcRequisiteId > 0) { $requisite = new \Bitrix\Crm\EntityRequisite(); $preset = new \Bitrix\Crm\EntityPreset(); if ($requisiteUserFieldsInfo === null) $requisiteUserFieldsInfo = $requisite->getFormUserFieldsInfo(); $row = $requisite->getList( array('select' => array('*', 'UF_*'), 'filter' => array('=ID' => $mcRequisiteId), 'limit' => 1) )->fetch(); if (is_array($row)) { if (isset($row['PRESET_ID']) && $row['PRESET_ID'] > 0) { $presetFields = array(); $res = $preset->getList(array( 'order' => array('SORT' => 'ASC', 'ID' => 'ASC'), 'filter' => array( '=ENTITY_TYPE_ID' => \Bitrix\Crm\EntityPreset::Requisite, '=ID' => (int)$row['PRESET_ID'] ), 'select' => array('ID', 'COUNTRY_ID', 'SETTINGS'), 'limit' => 1 )); if ($presetData = $res->fetch()) { if (is_array($presetData['SETTINGS'])) { $presetFieldsInfo = $preset->settingsGetFields($presetData['SETTINGS']); foreach ($presetFieldsInfo as $fieldInfo) { if (isset($fieldInfo['FIELD_NAME'])) $presetFields[$fieldInfo['FIELD_NAME']] = true; } unset($presetFieldsInfo, $fieldInfo); } $mcPresetCountryId = (int)$presetData['COUNTRY_ID']; } unset($res, $presetData); if ($mcPresetCountryId > 0) { foreach ($row as $fieldName => $fieldValue) { if (isset($presetFields[$fieldName])) { if (is_array($requisiteUserFieldsInfo[$fieldName]) && $requisiteUserFieldsInfo[$fieldName]['type'] === 'boolean') { $mcRequisiteValues[$fieldName.'|'.$mcPresetCountryId] = $fieldValue ? GetMessage('MAIN_YES') : GetMessage('MAIN_NO'); } elseif ($requisite->isRqListField($fieldName)) { $mcRequisiteValues[$fieldName.'|'.$mcPresetCountryId] = $requisite->getRqListFieldValueTitle( $fieldName, $mcPresetCountryId, (string)$fieldValue ) ; } else { $mcRequisiteValues[$fieldName.'|'.$mcPresetCountryId] = $fieldValue; } } } unset($fieldName, $fieldValue, $valueKey); // addresses foreach ($requisite->getAddresses($mcRequisiteId) as $addrTypeId => $addrFields) { $valueKey = Bitrix\Crm\EntityRequisite::ADDRESS.'_'.$addrTypeId.'|'.$mcPresetCountryId; $addressLines = explode( "\n", str_replace( ["\r\n", "\n", "\r"], "\n", AddressFormatter::getSingleInstance()->formatTextMultiline($addrFields) ) ); $mcRequisiteValues[$valueKey] = is_array($addressLines) ? $addressLines : []; unset($valueKey, $addressLines); } } } } } // full name if ($mcPresetCountryId > 0) { $fullName = isset($mcRequisiteValues['RQ_NAME|'.$mcPresetCountryId]) ? trim(strval($mcRequisiteValues['RQ_NAME|'.$mcPresetCountryId])) : ''; if (empty($fullName)) { $firstName = isset($mcRequisiteValues['RQ_FIRST_NAME|'.$mcPresetCountryId]) ? trim(strval($mcRequisiteValues['RQ_FIRST_NAME|'.$mcPresetCountryId])) : ''; $lastName = isset($mcRequisiteValues['RQ_LAST_NAME|'.$mcPresetCountryId]) ? trim(strval($mcRequisiteValues['RQ_LAST_NAME|'.$mcPresetCountryId])) : ''; $secondName = isset($mcRequisiteValues['RQ_SECOND_NAME|'.$mcPresetCountryId]) ? trim(strval($mcRequisiteValues['RQ_SECOND_NAME|'.$mcPresetCountryId])) : ''; if (!empty($firstName) || !empty($lastName) || !empty($secondName)) { $fullName = CUser::FormatName( \Bitrix\Crm\Format\PersonNameFormatter::getFormat(), array( 'LOGIN' => '[]', 'NAME' => $firstName, 'LAST_NAME' => $lastName, 'SECOND_NAME' => $secondName ), true, false ); if (!empty($fullName) && $fullName !== '[]') { $mcRequisiteValues['RQ_NAME|'.$mcPresetCountryId] = $fullName; } } } } // my company bank detail values $mcBankDetailValues = array(); if ($mcBankDetailId > 0) { $bankDetail = new \Bitrix\Crm\EntityBankDetail(); $row = $bankDetail->getById($mcBankDetailId); if (is_array($row)) { $countryId = isset($row['COUNTRY_ID']) ? (int)$row['COUNTRY_ID'] : 0; if ($countryId > 0) { foreach ($row as $fieldName => $fieldValue) { $mcBankDetailValues[$fieldName.'|'.$countryId] = $fieldValue; } unset($fieldName, $fieldValue, $valueKey); } } } // my company values $myCompanyValues = array(); $myCompanyId = isset($arQuote['MYCOMPANY_ID']) ? intval($arQuote['MYCOMPANY_ID']) : 0; if ($myCompanyId > 0) { $res = CCrmCompany::GetListEx( array(), array('ID' => $myCompanyId), false, array('nTopCount' => 1), array('ID', 'TITLE') ); $row = $res->Fetch(); if (is_array($row)) { $myCompanyValues = $row; $res = CCrmFieldMulti::GetList( array('ID' => 'asc'), array('ENTITY_ID' => 'COMPANY', 'ELEMENT_ID' => $myCompanyId) ); $skip = array(); while($row = $res->Fetch()) { if (($row['TYPE_ID'] === 'PHONE' || $row['TYPE_ID'] === 'EMAIL') && !isset($skip[$row['COMPLEX_ID']])) { $myCompanyValues[$row['COMPLEX_ID']] = $row['VALUE']; $skip[$row['COMPLEX_ID']] = true; } } } } // my company full name $myCompanyFullName = ''; if ($mcPresetCountryId > 0) { $myCompanyFullName = isset($mcRequisiteValues['RQ_COMPANY_FULL_NAME|'.$mcPresetCountryId]) ? trim(strval($mcRequisiteValues['RQ_COMPANY_FULL_NAME|'.$mcPresetCountryId])) : ''; if (empty($myCompanyFullName)) { $myCompanyShortName = isset($mcRequisiteValues['RQ_COMPANY_NAME|'.$mcPresetCountryId]) ? trim(strval($mcRequisiteValues['RQ_COMPANY_NAME|'.$mcPresetCountryId])) : ''; if (!empty($myCompanyShortName)) { $myCompanyFullName = $myCompanyShortName; } } } if (empty($myCompanyFullName)) { $myCompanyName = isset($myCompanyValues['TITLE']) ? trim(strval($myCompanyValues['TITLE'])) : ''; if (!empty($myCompanyName)) $myCompanyFullName = $myCompanyName; } if (!empty($myCompanyFullName)) { foreach ($countryIds as $countryId) $mcRequisiteValues['RQ_COMPANY_FULL_NAME|'.$countryId] = $myCompanyFullName; } unset($myCompanyFullName, $myCompanyShortName, $myCompanyName); return array( 'ORDER' => $order, 'PROPERTIES' => $properties, 'CART_ITEMS' => $calculatedOrder['BASKET_ITEMS'] ?? null, 'TAX_LIST' => $taxList, 'REQUISITE' => $requisiteValues, 'BANK_DETAIL' => $bankDetailValues, 'CRM_COMPANY' => $companyValues, 'CRM_CONTACT' => $contactValues, 'MC_REQUISITE' => $mcRequisiteValues, 'MC_BANK_DETAIL' => $mcBankDetailValues, 'CRM_MYCOMPANY' => $myCompanyValues, 'PAYMENT' => array( 'ID' => 0, 'PAY_SYSTEM_ID' => 0, 'SUM' => isset($order['SHOULD_PAY']) ? $order['SHOULD_PAY'] : 0.0, 'PAID' => '', 'DATE_BILL' => isset($order['DATE_BILL']) ? $order['DATE_BILL'] : null ), 'SHIPMENT' => array('DELIVERY_ID' => 0) ); }

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