protected function obtainDataLocationTypes(&$cachedData) { $types = Location\Admin\TypeHelper::getTypes(LANGUAGE_ID); $cachedData['TYPES'] = array(); foreach ($types as $type) { $type['NAME'] = $type['NAME_CURRENT']; unset($type['NAME_CURRENT']); $cachedData['TYPES'][$type['ID']] = $type; } }
"title" => GetMessage("SALE_MENU_LOCATION_ZONES_TITLE"), "url" => Location\Admin\SiteLocationHelper::getListUrl(), "more_url" => array(Location\Admin\SiteLocationHelper::getEditUrl()), ), array( "text" => GetMessage("SALE_MENU_LOCATION_DEFAULT"), "title" => GetMessage("SALE_MENU_LOCATION_DEFAULT_TITLE"), "url" => Location\Admin\DefaultSiteHelper::getListUrl(), "more_url" => array(Location\Admin\DefaultSiteHelper::getEditUrl()), ), array( "text" => GetMessage("SALE_MENU_LOCATION_TYPES"), "title" => GetMessage("SALE_MENU_LOCATION_TYPES_TITLE"), "url" => Location\Admin\TypeHelper::getListUrl(), "more_url" => array(Location\Admin\TypeHelper::getEditUrl()), ), array( "text" => GetMessage("SALE_MENU_LOCATION_SERVICES"), "title" => GetMessage("SALE_MENU_LOCATION_SERVICES_TITLE"), "url" => Location\Admin\ExternalServiceHelper::getListUrl(), "more_url" => array(Location\Admin\ExternalServiceHelper::getEditUrl()), ), array( "text" => GetMessage("SALE_LOCATION_IMPORT"), "title" => GetMessage("SALE_LOCATION_IMPORT_DESCR"), "url" => Location\Admin\Helper::getImportUrl(), ) ); } else
/** * @deprecated * * Use TypeHelper::getTypes() instead */ public static function getTypeList() { static $types; if ($types == null) { $types = array(); $typesWithNames = Location\Admin\TypeHelper::getTypes(); foreach ($typesWithNames as $type) { $types[intval($type['ID'])] = $type['NAME_CURRENT']; } } return $types; }
$nameMap = Helper::getNameMap(); ?> <?$tabControl->BeginCustomField('NAME', Loc::getMessage('SALE_LOCATION_E_HEADING_NAME_ALL'));?> <?foreach($languages as $lang):?> <tr class="heading"> <td colspan="2"><?php echo Loc::getMessage('SALE_LOCATION_E_HEADING_NAME', array('#LANGUAGE_ID#' => htmlspecialcharsbx($lang))); ?> </td> </tr> <?$lang = ToUpper($lang);?> <?foreach($nameMap as $code => $field):?> <?$value = Helper::makeSafeDisplay($formData[$code.'_'.$lang], $code);?> <tr<?php echo $field['required'] || $code == 'ID' ? $requiredFld : ''; ?> > <td width="40%"><?php echo $field['title']; ?> </td> <td width="60%"> <input type="text" name="element[<?php echo $code; ?> _<?php echo $lang; ?>
/** * Move data read from database to a specially formatted $arResult * @return void */ protected function formatResult() { $this->arResult =& $this->dbResult; $this->arResult['ERRORS'] =& $this->errors; $this->arResult['URLS'] = array('IMPORT' => $this->arParams['PATH_TO_IMPORT'], 'IMPORT_AJAX' => $this->getPath() . '/get.php', 'TYPE_LIST' => TypeHelper::getListUrl(), 'EXTERNAL_SERVICE_LIST' => ExternalServiceHelper::getListUrl()); unset($this->componentData); }
function GetRealValue($propertyID, $propertyCode, $propertyType, $value, $lang = false) { $propertyID = IntVal($propertyID); $propertyCode = Trim($propertyCode); $propertyType = Trim($propertyType); if ($lang === false) { $lang = LANGUAGE_ID; } $arResult = array(); $curKey = strlen($propertyCode) > 0 ? $propertyCode : $propertyID; if ($propertyType == "SELECT" || $propertyType == "RADIO") { $arValue = CSaleOrderPropsVariant::GetByValue($propertyID, $value); $arResult[$curKey] = $arValue["NAME"]; } elseif ($propertyType == "MULTISELECT") { $curValue = ""; if (!is_array($value)) { $value = explode(",", $value); } for ($i = 0, $max = count($value); $i < $max; $i++) { if ($arValue1 = CSaleOrderPropsVariant::GetByValue($propertyID, $value[$i])) { if ($i > 0) { $curValue .= ","; } $curValue .= $arValue1["NAME"]; } } $arResult[$curKey] = $curValue; } elseif ($propertyType == "LOCATION") { if (CSaleLocation::isLocationProMigrated()) { $curValue = ''; if (strlen($value)) { $arValue = array(); if (intval($value)) { try { $locationStreetPropertyValue = ''; $res = \Bitrix\Sale\Location\LocationTable::getPathToNode($value, array('select' => array('LNAME' => 'NAME.NAME', 'TYPE_ID'), 'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID))); $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypeCodeIdMapCached(); $path = array(); while ($item = $res->fetch()) { // copy street to STREET property if ($types['ID2CODE'][$item['TYPE_ID']] == 'STREET') { $arResult[$curKey . "_STREET"] = $item['LNAME']; } if ($types['ID2CODE'][$item['TYPE_ID']] == 'COUNTRY') { $arValue["COUNTRY_NAME"] = $item['LNAME']; } if ($types['ID2CODE'][$item['TYPE_ID']] == 'REGION') { $arValue["REGION_NAME"] = $item['LNAME']; } if ($types['ID2CODE'][$item['TYPE_ID']] == 'CITY') { $arValue["CITY_NAME"] = $item['LNAME']; } if ($types['ID2CODE'][$item['TYPE_ID']] == 'VILLAGE') { $arResult[$curKey . "_VILLAGE"] = $item['LNAME']; } $path[] = $item['LNAME']; } $curValue = implode(' - ', $path); } catch (\Bitrix\Main\SystemException $e) { } } } } else { $arValue = CSaleLocation::GetByID($value, $lang); $curValue = $arValue["COUNTRY_NAME"] . (strlen($arValue["COUNTRY_NAME"]) <= 0 || strlen($arValue["REGION_NAME"]) <= 0 ? "" : " - ") . $arValue["REGION_NAME"] . (strlen($arValue["COUNTRY_NAME"]) <= 0 || strlen($arValue["CITY_NAME"]) <= 0 ? "" : " - ") . $arValue["CITY_NAME"]; } $arResult[$curKey] = $curValue; $arResult[$curKey . "_COUNTRY"] = $arValue["COUNTRY_NAME"]; $arResult[$curKey . "_REGION"] = $arValue["REGION_NAME"]; $arResult[$curKey . "_CITY"] = $arValue["CITY_NAME"]; } else { $arResult[$curKey] = $value; } return $arResult; }
public function getStatistics($type = 'TOTAL') { if (empty($this->stat)) { $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypes(array('LANGUAGE_ID' => $this->getLanguageId())); $res = Location\LocationTable::getList(array('select' => array('CNT', 'TCODE' => 'TYPE.CODE'), 'group' => array('TYPE_ID'))); $total = 0; $stat = array(); while ($item = $res->fetch()) { $total += intval($item['CNT']); $stat[$item['TCODE']] = $item['CNT']; } foreach ($types as $code => $data) { $this->stat[$code] = array('NAME' => $data['NAME_CURRENT'], 'CODE' => $code, 'CNT' => isset($stat[$code]) ? intval($stat[$code]) : 0); } $this->stat['TOTAL'] = array('CNT' => $total, 'CODE' => 'TOTAL'); $res = Location\GroupTable::getList(array('runtime' => array('CNT' => array('data_type' => 'integer', 'expression' => array('COUNT(*)'))), 'select' => array('CNT')))->fetch(); $this->stat['GROUPS'] = array('CNT' => intval($res['CNT']), 'CODE' => 'GROUPS'); } return intval($this->stat[$type]['CNT']); }
function ExportOrders2Xml($arFilter = array(), $nTopCount = 0, $currency = "", $crmMode = false, $time_limit = 0, $version = false, $arOptions = array()) { global $DB; $count = false; if (IntVal($nTopCount) > 0) { $count = array("nTopCount" => $nTopCount); } $bNewVersion = strlen($version) > 0; $bExportFromCrm = isset($arOptions["EXPORT_FROM_CRM"]) && $arOptions["EXPORT_FROM_CRM"] === "Y"; if (IntVal($time_limit) > 0) { //This is an optimization. We assume than no step can take more than one year. if ($time_limit > 0) { $end_time = time() + $time_limit; } else { $end_time = time() + 365 * 24 * 3600; } // One year //$version $lastOrderPrefix = "LAST_ORDER_ID"; if ($crmMode) { $lastOrderPrefix = md5(serialize($arFilter)); if (!empty($_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]) && IntVal($nTopCount) > 0) { $count["nTopCount"] = $count["nTopCount"] + count($_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]); } } else { if (IntVal($_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]) > 0) { $arFilter["<ID"] = $_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]; } } } $arResultStat = array("ORDERS" => 0, "CONTACTS" => 0, "COMPANIES" => 0); $accountNumberPrefix = COption::GetOptionString("sale", "1C_SALE_ACCOUNT_NUMBER_SHOP_PREFIX", ""); $dbPaySystem = CSalePaySystem::GetList(array("ID" => "ASC"), array("ACTIVE" => "Y"), false, false, array("ID", "NAME", "ACTIVE")); while ($arPaySystem = $dbPaySystem->Fetch()) { $paySystems[$arPaySystem["ID"]] = $arPaySystem["NAME"]; } $dbDelivery = CSaleDelivery::GetList(array("ID" => "ASC"), array("ACTIVE" => "Y"), false, false, array("ID", "NAME", "ACTIVE")); while ($arDelivery = $dbDelivery->Fetch()) { $delivery[$arDelivery["ID"]] = $arDelivery["NAME"]; } $rsDeliveryHandlers = CSaleDeliveryHandler::GetAdminList(array("SID" => "ASC")); while ($arHandler = $rsDeliveryHandlers->Fetch()) { if (is_array($arHandler["PROFILES"])) { foreach ($arHandler["PROFILES"] as $k => $v) { $delivery[$arHandler["SID"] . ":" . $k] = $v["TITLE"] . " (" . $arHandler["NAME"] . ")"; } } } $arStore = array(); $arMeasures = array(); if (CModule::IncludeModule("catalog")) { $dbList = CCatalogStore::GetList(array("SORT" => "DESC", "ID" => "ASC"), array("ACTIVE" => "Y", "ISSUING_CENTER" => "Y"), false, false, array("ID", "SORT", "TITLE", "ADDRESS", "DESCRIPTION", "PHONE", "EMAIL", "XML_ID")); while ($arStoreTmp = $dbList->Fetch()) { if (strlen($arStoreTmp["XML_ID"]) <= 0) { $arStoreTmp["XML_ID"] = $arStoreTmp["ID"]; } $arStore[$arStoreTmp["ID"]] = $arStoreTmp; } $dbList = CCatalogMeasure::getList(array(), array(), false, false, array("CODE", "MEASURE_TITLE")); while ($arList = $dbList->Fetch()) { $arMeasures[$arList["CODE"]] = $arList["MEASURE_TITLE"]; } } if (empty($arMeasures)) { $arMeasures[796] = GetMessage("SALE_EXPORT_SHTUKA"); } $dbExport = CSaleExport::GetList(); while ($arExport = $dbExport->Fetch()) { $arAgent[$arExport["PERSON_TYPE_ID"]] = unserialize($arExport["VARS"]); } $dateFormat = CSite::GetDateFormat("FULL"); if ($crmMode) { echo "<" . "?xml version=\"1.0\" encoding=\"UTF-8\"?" . ">\n"; $arCharSets = array(); $dbSitesList = CSite::GetList($b = "", $o = ""); while ($arSite = $dbSitesList->Fetch()) { $arCharSets[$arSite["ID"]] = $arSite["CHARSET"]; } } else { echo "<" . "?xml version=\"1.0\" encoding=\"windows-1251\"?" . ">\n"; } ?> <<?php echo GetMessage("SALE_EXPORT_COM_INFORMATION"); ?> <?php echo GetMessage("SALE_EXPORT_SHEM_VERSION"); ?> ="<?php echo $bNewVersion ? "2.08" : "2.05"; ?> " <?php echo GetMessage("SALE_EXPORT_SHEM_DATE_CREATE"); ?> ="<?php echo date("Y-m-d"); ?> T<?php echo date("G:i:s"); ?> " <?php echo GetMessage("SALE_EXPORT_DATE_FORMAT"); ?> ="<?php echo GetMessage("SALE_EXPORT_DATE_FORMAT_DF"); ?> =yyyy-MM-dd; <?php echo GetMessage("SALE_EXPORT_DATE_FORMAT_DLF"); ?> =DT" <?php echo GetMessage("SALE_EXPORT_DATE_FORMAT_DATETIME"); ?> ="<?php echo GetMessage("SALE_EXPORT_DATE_FORMAT_DF"); ?> =<?php echo GetMessage("SALE_EXPORT_DATE_FORMAT_TIME"); ?> ; <?php echo GetMessage("SALE_EXPORT_DATE_FORMAT_DLF"); ?> =T" <?php echo GetMessage("SALE_EXPORT_DEL_DT"); ?> ="T" <?php echo GetMessage("SALE_EXPORT_FORM_SUMM"); ?> ="<?php echo GetMessage("SALE_EXPORT_FORM_CC"); ?> =18; <?php echo GetMessage("SALE_EXPORT_FORM_CDC"); ?> =2; <?php echo GetMessage("SALE_EXPORT_FORM_CRD"); ?> =." <?php echo GetMessage("SALE_EXPORT_FORM_QUANT"); ?> ="<?php echo GetMessage("SALE_EXPORT_FORM_CC"); ?> =18; <?php echo GetMessage("SALE_EXPORT_FORM_CDC"); ?> =2; <?php echo GetMessage("SALE_EXPORT_FORM_CRD"); ?> =."> <?php $arOrder = array("ID" => "DESC"); if ($crmMode) { $arOrder = array("DATE_UPDATE" => "ASC"); } $arSelect = array("ID", "LID", "PERSON_TYPE_ID", "PAYED", "DATE_PAYED", "EMP_PAYED_ID", "CANCELED", "DATE_CANCELED", "EMP_CANCELED_ID", "REASON_CANCELED", "STATUS_ID", "DATE_STATUS", "PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE", "EMP_STATUS_ID", "PRICE_DELIVERY", "ALLOW_DELIVERY", "DATE_ALLOW_DELIVERY", "EMP_ALLOW_DELIVERY_ID", "PRICE", "CURRENCY", "DISCOUNT_VALUE", "SUM_PAID", "USER_ID", "PAY_SYSTEM_ID", "DELIVERY_ID", "DATE_INSERT", "DATE_INSERT_FORMAT", "DATE_UPDATE", "USER_DESCRIPTION", "ADDITIONAL_INFO", "PS_STATUS", "PS_STATUS_CODE", "PS_STATUS_DESCRIPTION", "PS_STATUS_MESSAGE", "PS_SUM", "PS_CURRENCY", "PS_RESPONSE_DATE", "COMMENTS", "TAX_VALUE", "STAT_GID", "RECURRING_ID", "ACCOUNT_NUMBER", "SUM_PAID", "DELIVERY_DOC_DATE", "DELIVERY_DOC_NUM", "TRACKING_NUMBER", "STORE_ID", "ID_1C", "VERSION"); $bCrmModuleIncluded = false; if ($bExportFromCrm) { $arSelect[] = "UF_COMPANY_ID"; $arSelect[] = "UF_CONTACT_ID"; if (IsModuleInstalled("crm") && CModule::IncludeModule("crm")) { $bCrmModuleIncluded = true; } } $dbOrderList = CSaleOrder::GetList($arOrder, $arFilter, false, $count, $arSelect); while ($arOrder = $dbOrderList->Fetch()) { if ($crmMode) { if ($bNewVersion && is_array($_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]) && in_array($arOrder["ID"], $_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix]) && empty($arFilter["ID"])) { continue; } ob_start(); } $arResultStat["ORDERS"]++; $agentParams = $arAgent[$arOrder["PERSON_TYPE_ID"]]; $arProp = array(); $arProp["ORDER"] = $arOrder; if (IntVal($arOrder["USER_ID"]) > 0) { $dbUser = CUser::GetByID($arOrder["USER_ID"]); if ($arUser = $dbUser->Fetch()) { $arProp["USER"] = $arUser; } } if ($bExportFromCrm) { $arProp["CRM"] = array(); $companyID = isset($arOrder["UF_COMPANY_ID"]) ? intval($arOrder["UF_COMPANY_ID"]) : 0; $contactID = isset($arOrder["UF_CONTACT_ID"]) ? intval($arOrder["UF_CONTACT_ID"]) : 0; if ($companyID > 0) { $arProp["CRM"]["CLIENT_ID"] = "CRMCO" . $companyID; } else { $arProp["CRM"]["CLIENT_ID"] = "CRMC" . $contactID; } $clientInfo = array("LOGIN" => "", "NAME" => "", "LAST_NAME" => "", "SECOND_NAME" => ""); if ($bCrmModuleIncluded) { if ($companyID > 0) { $arCompanyFilter = array('=ID' => $companyID); $dbCompany = CCrmCompany::GetListEx(array(), $arCompanyFilter, false, array("nTopCount" => 1), array("TITLE")); $arCompany = $dbCompany->Fetch(); unset($dbCompany, $arCompanyFilter); if (is_array($arCompany)) { if (isset($arCompany["TITLE"])) { $clientInfo["NAME"] = $arCompany["TITLE"]; } } unset($arCompany); } else { if ($contactID > 0) { $arContactFilter = array('=ID' => $contactID); $dbContact = CCrmContact::GetListEx(array(), $arContactFilter, false, array("nTopCount" => 1), array("NAME", "LAST_NAME", "SECOND_NAME")); $arContact = $dbContact->Fetch(); unset($dbContact, $arContactFilter); if (is_array($arContact)) { if (isset($arContact["NAME"])) { $clientInfo["NAME"] = $arContact["NAME"]; } if (isset($arContact["LAST_NAME"])) { $clientInfo["LAST_NAME"] = $arContact["LAST_NAME"]; } if (isset($arContact["SECOND_NAME"])) { $clientInfo["SECOND_NAME"] = $arContact["SECOND_NAME"]; } } unset($arContact); } } } $arProp["CRM"]["CLIENT"] = $clientInfo; unset($clientInfo); } if (IntVal($arOrder["PAY_SYSTEM_ID"]) > 0) { $arProp["ORDER"]["PAY_SYSTEM_NAME"] = $paySystems[$arOrder["PAY_SYSTEM_ID"]]; } if (strlen($arOrder["DELIVERY_ID"]) > 0) { $arProp["ORDER"]["DELIVERY_NAME"] = $delivery[$arOrder["DELIVERY_ID"]]; } $dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE")); $locationStreetPropertyValue = ''; while ($arOrderPropVals = $dbOrderPropVals->Fetch()) { if ($arOrderPropVals["PROP_TYPE"] == "CHECKBOX") { if ($arOrderPropVals["VALUE"] == "Y") { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "true"; } else { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "false"; } } elseif ($arOrderPropVals["PROP_TYPE"] == "TEXT" || $arOrderPropVals["PROP_TYPE"] == "TEXTAREA") { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"]; } elseif ($arOrderPropVals["PROP_TYPE"] == "SELECT" || $arOrderPropVals["PROP_TYPE"] == "RADIO") { $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["VALUE"]); $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arVal["NAME"]; } elseif ($arOrderPropVals["PROP_TYPE"] == "MULTISELECT") { $curVal = explode(",", $arOrderPropVals["VALUE"]); foreach ($curVal as $vm) { $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $vm); $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] .= ", " . $arVal["NAME"]; } $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = substr($arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]], 2); } elseif ($arOrderPropVals["PROP_TYPE"] == "LOCATION") { $arVal = CSaleLocation::GetByID($arOrderPropVals["VALUE"], LANGUAGE_ID); if (CSaleLocation::isLocationProEnabled()) { if (intval($arVal['ID'])) { try { $res = \Bitrix\Sale\Location\LocationTable::getPathToNode($arVal['ID'], array('select' => array('LNAME' => 'NAME.NAME', 'TYPE_ID'), 'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID))); $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypeCodeIdMapCached(); $path = array(); while ($item = $res->fetch()) { // copy street to STREET property if ($types['ID2CODE'][$item['TYPE_ID']] == 'STREET') { $locationStreetPropertyValue = $item['LNAME']; } $path[] = $item['LNAME']; } $locationString = implode(' - ', $path); } catch (\Bitrix\Main\SystemException $e) { $locationString = ''; } } else { $locationString = ''; } } else { $locationString = $arVal["COUNTRY_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["REGION_NAME"]) <= 0 ? "" : " - ") . $arVal["REGION_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["CITY_NAME"]) <= 0 ? "" : " - ") . $arVal["CITY_NAME"]; } $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $locationString; $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_CITY"] = $arVal["CITY_NAME"]; $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_COUNTRY"] = $arVal["COUNTRY_NAME"]; $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_REGION"] = $arVal["REGION_NAME"]; } else { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"]; } } $resShipment = \Bitrix\Sale\Internals\ShipmentTable::getList(array('select' => array('DELIVERY_ID', 'ALLOW_DELIVERY', 'DEDUCTED', 'DATE_ALLOW_DELIVERY', 'DATE_DEDUCTED'), 'filter' => array('ORDER_ID' => $arOrder['ID'], '=SYSTEM' => 'N'), 'limit' => array(1))); $arShipment = $resShipment->fetch(); $resPayment = \Bitrix\Sale\Internals\PaymentTable::getList(array('select' => array('PAY_VOUCHER_NUM', 'PAY_SYSTEM_ID', 'PAY_VOUCHER_DATE'), 'filter' => array('ORDER_ID' => $arOrder['ID'], '!PAY_SYSTEM_ID' => \Bitrix\Sale\Internals\PaySystemInner::getId()), 'limit' => array(1))); $arPayment = $resPayment->fetch(); foreach ($agentParams as $k => $v) { if (strpos($k, "REKV_") !== false) { if (!is_array($v)) { $agent["REKV"][$k] = $v; } else { if (strlen($v["TYPE"]) <= 0) { $agent["REKV"][$k] = $v["VALUE"]; } else { $agent["REKV"][$k] = $arProp[$v["TYPE"]][$v["VALUE"]]; } } } else { if (!is_array($v)) { $agent[$k] = $v; } else { if (strlen($v["TYPE"]) <= 0) { $agent[$k] = $v["VALUE"]; } else { $agent[$k] = $arProp[$v["TYPE"]][$v["VALUE"]]; } if ($k == 'STREET' && strlen($locationStreetPropertyValue)) { $agent[$k] = $locationStreetPropertyValue . (strlen($agent[$k]) ? ', ' : '') . $agent[$k]; } } } } ?> <<?php echo GetMessage("SALE_EXPORT_DOCUMENT"); ?> > <<?php echo GetMessage("SALE_EXPORT_ID"); ?> ><?php echo $arOrder["ID"]; ?> </<?php echo GetMessage("SALE_EXPORT_ID"); ?> > <<?php echo GetMessage("SALE_EXPORT_NUMBER"); ?> ><?php echo $accountNumberPrefix . $arOrder["ACCOUNT_NUMBER"]; ?> </<?php echo GetMessage("SALE_EXPORT_NUMBER"); ?> > <<?php echo GetMessage("SALE_EXPORT_DATE"); ?> ><?php echo $DB->FormatDate($arOrder["DATE_INSERT_FORMAT"], $dateFormat, "YYYY-MM-DD"); ?> </<?php echo GetMessage("SALE_EXPORT_DATE"); ?> > <<?php echo GetMessage("SALE_EXPORT_HOZ_OPERATION"); ?> ><?php echo GetMessage("SALE_EXPORT_ITEM_ORDER"); ?> </<?php echo GetMessage("SALE_EXPORT_HOZ_OPERATION"); ?> > <<?php echo GetMessage("SALE_EXPORT_ROLE"); ?> ><?php echo GetMessage("SALE_EXPORT_SELLER"); ?> </<?php echo GetMessage("SALE_EXPORT_ROLE"); ?> > <<?php echo GetMessage("SALE_EXPORT_CURRENCY"); ?> ><?php echo htmlspecialcharsbx(strlen($currency) > 0 ? substr($currency, 0, 3) : substr($arOrder["CURRENCY"], 0, 3)); ?> </<?php echo GetMessage("SALE_EXPORT_CURRENCY"); ?> > <<?php echo GetMessage("SALE_EXPORT_CURRENCY_RATE"); ?> >1</<?php echo GetMessage("SALE_EXPORT_CURRENCY_RATE"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo $arOrder["PRICE"]; ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > <?php if ($bNewVersion) { ?> <<?php echo GetMessage("SALE_EXPORT_VERSION"); ?> ><?php echo IntVal($arOrder["VERSION"]) > 0 ? $arOrder["VERSION"] : 0; ?> </<?php echo GetMessage("SALE_EXPORT_VERSION"); ?> > <?php if (strlen($arOrder["ID_1C"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_ID_1C"); ?> ><?php echo htmlspecialcharsbx($arOrder["ID_1C"]); ?> </<?php echo GetMessage("SALE_EXPORT_ID_1C"); ?> ><?php } } if ($crmMode) { ?> <DateUpdate><?php echo $DB->FormatDate($arOrder["DATE_UPDATE"], $dateFormat, "YYYY-MM-DD HH:MI:SS"); ?> </DateUpdate><?php } $deliveryAdr = CSaleExport::ExportContragents($arOrder, $arProp, $agent, $arResultStat, $bNewVersion, $bExportFromCrm ? array("EXPORT_FROM_CRM" => "Y") : array()); ?> <<?php echo GetMessage("SALE_EXPORT_TIME"); ?> ><?php echo $DB->FormatDate($arOrder["DATE_INSERT_FORMAT"], $dateFormat, "HH:MI:SS"); ?> </<?php echo GetMessage("SALE_EXPORT_TIME"); ?> > <<?php echo GetMessage("SALE_EXPORT_COMMENTS"); ?> ><?php echo htmlspecialcharsbx($arOrder["COMMENTS"]); ?> </<?php echo GetMessage("SALE_EXPORT_COMMENTS"); ?> > <?php $dbOrderTax = CSaleOrderTax::GetList(array(), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "TAX_NAME", "VALUE", "VALUE_MONEY", "CODE", "IS_IN_PRICE")); $i = -1; $orderTax = 0; while ($arOrderTax = $dbOrderTax->Fetch()) { $arOrderTax["VALUE_MONEY"] = roundEx($arOrderTax["VALUE_MONEY"], 2); $orderTax += $arOrderTax["VALUE_MONEY"]; $i++; if ($i == 0) { echo "<" . GetMessage("SALE_EXPORT_TAXES") . ">"; } ?> <<?php echo GetMessage("SALE_EXPORT_TAX"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo htmlspecialcharsbx($arOrderTax["TAX_NAME"]); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> ><?php echo $arOrderTax["IS_IN_PRICE"] == "Y" ? "true" : "false"; ?> </<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo $arOrderTax["VALUE_MONEY"]; ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAX"); ?> > <?php } if ($i != -1) { echo "</" . GetMessage("SALE_EXPORT_TAXES") . ">"; } ?> <?php if (DoubleVal($arOrder["DISCOUNT_VALUE"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_DISCOUNTS"); ?> > <<?php echo GetMessage("SALE_EXPORT_DISCOUNT"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_ORDER_DISCOUNT"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo $arOrder["DISCOUNT_VALUE"]; ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > <<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> >false</<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> > </<?php echo GetMessage("SALE_EXPORT_DISCOUNT"); ?> > </<?php echo GetMessage("SALE_EXPORT_DISCOUNTS"); ?> > <?php } $storeBasket = ""; if (IntVal($arOrder["STORE_ID"]) > 0 && !empty($arStore[$arOrder["STORE_ID"]])) { ?> <<?php echo GetMessage("SALE_EXPORT_STORIES"); ?> > <<?php echo GetMessage("SALE_EXPORT_STORY"); ?> > <<?php echo GetMessage("SALE_EXPORT_ID"); ?> ><?php echo $arStore[$arOrder["STORE_ID"]]["XML_ID"]; ?> </<?php echo GetMessage("SALE_EXPORT_ID"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo htmlspecialcharsbx($arStore[$arOrder["STORE_ID"]]["TITLE"]); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_ADDRESS"); ?> > <<?php echo GetMessage("SALE_EXPORT_PRESENTATION"); ?> ><?php echo htmlspecialcharsbx($arStore[$arOrder["STORE_ID"]]["ADDRESS"]); ?> </<?php echo GetMessage("SALE_EXPORT_PRESENTATION"); ?> > <<?php echo GetMessage("SALE_EXPORT_ADDRESS_FIELD"); ?> > <<?php echo GetMessage("SALE_EXPORT_TYPE"); ?> ><?php echo GetMessage("SALE_EXPORT_STREET"); ?> </<?php echo GetMessage("SALE_EXPORT_TYPE"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arStore[$arOrder["STORE_ID"]]["ADDRESS"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_ADDRESS_FIELD"); ?> > </<?php echo GetMessage("SALE_EXPORT_ADDRESS"); ?> > <<?php echo GetMessage("SALE_EXPORT_CONTACTS"); ?> > <<?php echo GetMessage("SALE_EXPORT_CONTACT"); ?> > <<?php echo GetMessage("SALE_EXPORT_TYPE"); ?> ><?php echo $bNewVersion ? GetMessage("SALE_EXPORT_WORK_PHONE_NEW") : GetMessage("SALE_EXPORT_WORK_PHONE"); ?> </<?php echo GetMessage("SALE_EXPORT_TYPE"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arStore[$arOrder["STORE_ID"]]["PHONE"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_CONTACT"); ?> > </<?php echo GetMessage("SALE_EXPORT_CONTACTS"); ?> > </<?php echo GetMessage("SALE_EXPORT_STORY"); ?> > </<?php echo GetMessage("SALE_EXPORT_STORIES"); ?> > <?php /* $storeBasket = " <".GetMessage("SALE_EXPORT_STORIES")."> <".GetMessage("SALE_EXPORT_STORY")."> <".GetMessage("SALE_EXPORT_ID").">".$arStore[$arOrder["STORE_ID"]]["XML_ID"]."</".GetMessage("SALE_EXPORT_ID")."> <".GetMessage("SALE_EXPORT_ITEM_NAME").">".htmlspecialcharsbx($arStore[$arOrder["STORE_ID"]]["TITLE"])."</".GetMessage("SALE_EXPORT_ITEM_NAME")."> </".GetMessage("SALE_EXPORT_STORY")."> </".GetMessage("SALE_EXPORT_STORIES")."> "; */ } ?> <<?php echo GetMessage("SALE_EXPORT_ITEMS"); ?> > <?php $dbBasket = \Bitrix\Sale\Internals\BasketTable::getList(array('select' => array("ID", "NOTES", "PRODUCT_XML_ID", "CATALOG_XML_ID", "NAME", "PRICE", "QUANTITY", "DISCOUNT_PRICE", "VAT_RATE", "MEASURE_CODE"), 'filter' => array("ORDER_ID" => $arOrder["ID"]), 'order' => array("NAME" => "ASC"))); $basketSum = 0; $priceType = ""; $bVat = false; $vatRate = 0; $vatSum = 0; while ($arBasket = $dbBasket->fetch()) { if (strlen($priceType) <= 0) { $priceType = $arBasket["NOTES"]; } ?> <<?php echo GetMessage("SALE_EXPORT_ITEM"); ?> > <<?php echo GetMessage("SALE_EXPORT_ID"); ?> ><?php echo htmlspecialcharsbx($arBasket["PRODUCT_XML_ID"]); ?> </<?php echo GetMessage("SALE_EXPORT_ID"); ?> > <<?php echo GetMessage("SALE_EXPORT_CATALOG_ID"); ?> ><?php echo htmlspecialcharsbx($arBasket["CATALOG_XML_ID"]); ?> </<?php echo GetMessage("SALE_EXPORT_CATALOG_ID"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo htmlspecialcharsbx($arBasket["NAME"]); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <?php if ($bNewVersion) { if (IntVal($arBasket["MEASURE_CODE"]) <= 0) { $arBasket["MEASURE_CODE"] = 796; } ?> <<?php echo GetMessage("SALE_EXPORT_UNIT"); ?> > <<?php echo GetMessage("SALE_EXPORT_CODE"); ?> ><?php echo $arBasket["MEASURE_CODE"]; ?> </<?php echo GetMessage("SALE_EXPORT_CODE"); ?> > <<?php echo GetMessage("SALE_EXPORT_FULL_NAME_UNIT"); ?> ><?php echo htmlspecialcharsbx($arMeasures[$arBasket["MEASURE_CODE"]]); ?> </<?php echo GetMessage("SALE_EXPORT_FULL_NAME_UNIT"); ?> > </<?php echo GetMessage("SALE_EXPORT_UNIT"); ?> > <<?php echo GetMessage("SALE_EXPORT_KOEF"); ?> >1</<?php echo GetMessage("SALE_EXPORT_KOEF"); ?> > <?php } else { ?> <<?php echo GetMessage("SALE_EXPORT_BASE_UNIT"); ?> <?php echo GetMessage("SALE_EXPORT_CODE"); ?> ="796" <?php echo GetMessage("SALE_EXPORT_FULL_NAME_UNIT"); ?> ="<?php echo GetMessage("SALE_EXPORT_SHTUKA"); ?> " <?php echo GetMessage("SALE_EXPORT_INTERNATIONAL_ABR"); ?> ="<?php echo GetMessage("SALE_EXPORT_RCE"); ?> "><?php echo GetMessage("SALE_EXPORT_SHT"); ?> </<?php echo GetMessage("SALE_EXPORT_BASE_UNIT"); ?> > <?php } if (DoubleVal($arBasket["DISCOUNT_PRICE"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_DISCOUNTS"); ?> > <<?php echo GetMessage("SALE_EXPORT_DISCOUNT"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_ITEM_DISCOUNT"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo $arBasket["DISCOUNT_PRICE"]; ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > <<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> >true</<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> > </<?php echo GetMessage("SALE_EXPORT_DISCOUNT"); ?> > </<?php echo GetMessage("SALE_EXPORT_DISCOUNTS"); ?> > <?php } ?> <<?php echo GetMessage("SALE_EXPORT_PRICE_PER_ITEM"); ?> ><?php echo $arBasket["PRICE"]; ?> </<?php echo GetMessage("SALE_EXPORT_PRICE_PER_ITEM"); ?> > <<?php echo GetMessage("SALE_EXPORT_QUANTITY"); ?> ><?php echo $arBasket["QUANTITY"]; ?> </<?php echo GetMessage("SALE_EXPORT_QUANTITY"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo $arBasket["PRICE"] * $arBasket["QUANTITY"]; ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTIES_VALUES"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_TYPE_NOMENKLATURA"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo GetMessage("SALE_EXPORT_ITEM"); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_TYPE_OF_NOMENKLATURA"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo GetMessage("SALE_EXPORT_ITEM"); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php $dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arBasket["ID"], "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")), false, false, array("NAME", "VALUE", "CODE")); while ($arProp = $dbProp->Fetch()) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo htmlspecialcharsbx($arProp["NAME"]); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arProp["VALUE"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } ?> </<?php echo GetMessage("SALE_EXPORT_PROPERTIES_VALUES"); ?> > <?php if (DoubleVal($arBasket["VAT_RATE"]) > 0) { $bVat = true; $vatRate = DoubleVal($arBasket["VAT_RATE"]); $basketVatSum = $arBasket["PRICE"] / ($arBasket["VAT_RATE"] + 1) * $arBasket["VAT_RATE"]; $vatSum += roundEx($basketVatSum * $arBasket["QUANTITY"], 2); ?> <<?php echo GetMessage("SALE_EXPORT_TAX_RATES"); ?> > <<?php echo GetMessage("SALE_EXPORT_TAX_RATE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_VAT"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_RATE"); ?> ><?php echo $arBasket["VAT_RATE"] * 100; ?> </<?php echo GetMessage("SALE_EXPORT_RATE"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAX_RATE"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAX_RATES"); ?> > <<?php echo GetMessage("SALE_EXPORT_TAXES"); ?> > <<?php echo GetMessage("SALE_EXPORT_TAX"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_VAT"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> >true</<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo roundEx($basketVatSum, 2); ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAX"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAXES"); ?> > <?php } ?> <?php echo $storeBasket; ?> </<?php echo GetMessage("SALE_EXPORT_ITEM"); ?> > <?php $basketSum += $arBasket["PRICE"] * $arBasket["QUANTITY"]; } if (IntVal($arOrder["PRICE_DELIVERY"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_ITEM"); ?> > <<?php echo GetMessage("SALE_EXPORT_ID"); ?> >ORDER_DELIVERY</<?php echo GetMessage("SALE_EXPORT_ID"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_ORDER_DELIVERY"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <?php if ($bNewVersion) { ?> <<?php echo GetMessage("SALE_EXPORT_UNIT"); ?> > <<?php echo GetMessage("SALE_EXPORT_CODE"); ?> >796</<?php echo GetMessage("SALE_EXPORT_CODE"); ?> > <<?php echo GetMessage("SALE_EXPORT_FULL_NAME_UNIT"); ?> ><?php echo htmlspecialcharsbx($arMeasures[796]); ?> </<?php echo GetMessage("SALE_EXPORT_FULL_NAME_UNIT"); ?> > </<?php echo GetMessage("SALE_EXPORT_UNIT"); ?> > <<?php echo GetMessage("SALE_EXPORT_KOEF"); ?> >1</<?php echo GetMessage("SALE_EXPORT_KOEF"); ?> > <?php } else { ?> <<?php echo GetMessage("SALE_EXPORT_BASE_UNIT"); ?> <?php echo GetMessage("SALE_EXPORT_CODE"); ?> ="796" <?php echo GetMessage("SALE_EXPORT_FULL_NAME_UNIT"); ?> ="<?php echo GetMessage("SALE_EXPORT_SHTUKA"); ?> " <?php echo GetMessage("SALE_EXPORT_INTERNATIONAL_ABR"); ?> ="<?php echo GetMessage("SALE_EXPORT_RCE"); ?> "><?php echo GetMessage("SALE_EXPORT_SHT"); ?> </<?php echo GetMessage("SALE_EXPORT_BASE_UNIT"); ?> > <?php } ?> <<?php echo GetMessage("SALE_EXPORT_PRICE_PER_ITEM"); ?> ><?php echo $arOrder["PRICE_DELIVERY"]; ?> </<?php echo GetMessage("SALE_EXPORT_PRICE_PER_ITEM"); ?> > <<?php echo GetMessage("SALE_EXPORT_QUANTITY"); ?> >1</<?php echo GetMessage("SALE_EXPORT_QUANTITY"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo $arOrder["PRICE_DELIVERY"]; ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTIES_VALUES"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_TYPE_NOMENKLATURA"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo GetMessage("SALE_EXPORT_SERVICE"); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_TYPE_OF_NOMENKLATURA"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo GetMessage("SALE_EXPORT_SERVICE"); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTIES_VALUES"); ?> > <?php if ($bVat) { $deliveryTax = roundEx($arOrder["PRICE_DELIVERY"] / ($vatRate + 1) * $vatRate, 2); if ($orderTax > $vatSum && $orderTax == roundEx($vatSum + $deliveryTax, 2)) { ?> <<?php echo GetMessage("SALE_EXPORT_TAX_RATES"); ?> > <<?php echo GetMessage("SALE_EXPORT_TAX_RATE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_VAT"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_RATE"); ?> ><?php echo $vatRate * 100; ?> </<?php echo GetMessage("SALE_EXPORT_RATE"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAX_RATE"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAX_RATES"); ?> > <<?php echo GetMessage("SALE_EXPORT_TAXES"); ?> > <<?php echo GetMessage("SALE_EXPORT_TAX"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_VAT"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> >true</<?php echo GetMessage("SALE_EXPORT_IN_PRICE"); ?> > <<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> ><?php echo $deliveryTax; ?> </<?php echo GetMessage("SALE_EXPORT_AMOUNT"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAX"); ?> > </<?php echo GetMessage("SALE_EXPORT_TAXES"); ?> > <?php } } ?> </<?php echo GetMessage("SALE_EXPORT_ITEM"); ?> > <?php } ?> </<?php echo GetMessage("SALE_EXPORT_ITEMS"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTIES_VALUES"); ?> > <?php if (strlen($arOrder["DATE_PAYED"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_DATE_PAID"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arOrder["DATE_PAYED"]; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } if (strlen($arPayment["PAY_VOUCHER_NUM"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_PAY_NUMBER"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arPayment["PAY_VOUCHER_NUM"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } if (IntVal($arPayment["PAY_SYSTEM_ID"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_PAY_SYSTEM"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($paySystems[$arPayment["PAY_SYSTEM_ID"]]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_PAY_SYSTEM_ID"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arPayment["PAY_SYSTEM_ID"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } if (strlen($arShipment["DATE_ALLOW_DELIVERY"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_DATE_ALLOW_DELIVERY"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arShipment["DATE_ALLOW_DELIVERY"]; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } if (strlen($arShipment["DELIVERY_ID"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_DELIVERY_SERVICE"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($delivery[$arShipment["DELIVERY_ID"]]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_ORDER_PAID"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arOrder["PAYED"] == "Y" ? "true" : "false"; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_ALLOW_DELIVERY"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arShipment["ALLOW_DELIVERY"] == "Y" ? "true" : "false"; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_CANCELED"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arOrder["CANCELED"] == "Y" ? "true" : "false"; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_FINAL_STATUS"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arOrder["STATUS_ID"] == "F" ? "true" : "false"; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_ORDER_STATUS"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php $arStatus = CSaleStatus::GetLangByID($arOrder["STATUS_ID"]); echo htmlspecialcharsbx("[" . $arOrder["STATUS_ID"] . "] " . $arStatus["NAME"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_ORDER_STATUS_ID"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arOrder["STATUS_ID"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php if (strlen($arOrder["DATE_CANCELED"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_DATE_CANCEL"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arOrder["DATE_CANCELED"]; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_CANCEL_REASON"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arOrder["REASON_CANCELED"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } if (strlen($arOrder["DATE_STATUS"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_DATE_STATUS"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo $arOrder["DATE_STATUS"]; ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } if (strlen($arOrder["USER_DESCRIPTION"]) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_USER_DESCRIPTION"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($arOrder["USER_DESCRIPTION"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } $dbSite = CSite::GetByID($arOrder["LID"]); $arSite = $dbSite->Fetch(); ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_SITE_NAME"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> >[<?php echo $arOrder["LID"]; ?> ] <?php echo htmlspecialcharsbx($arSite["NAME"]); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php if (!empty($agent["REKV"])) { foreach ($agent["REKV"] as $k => $v) { if (strlen($agentParams[$k]["NAME"]) > 0 && strlen($v) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo htmlspecialcharsbx($agentParams[$k]["NAME"]); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($v); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } } } if (strlen($deliveryAdr) > 0) { ?> <<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> ><?php echo GetMessage("SALE_EXPORT_DELIVERY_ADDRESS"); ?> </<?php echo GetMessage("SALE_EXPORT_ITEM_NAME"); ?> > <<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> ><?php echo htmlspecialcharsbx($deliveryAdr); ?> </<?php echo GetMessage("SALE_EXPORT_VALUE"); ?> > </<?php echo GetMessage("SALE_EXPORT_PROPERTY_VALUE"); ?> > <?php } ?> </<?php echo GetMessage("SALE_EXPORT_PROPERTIES_VALUES"); ?> > </<?php echo GetMessage("SALE_EXPORT_DOCUMENT"); ?> > <?php if ($crmMode) { $c = ob_get_clean(); $c = CharsetConverter::ConvertCharset($c, $arCharSets[$arOrder["LID"]], "utf-8"); echo $c; $_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix][] = $arOrder["ID"]; } else { $_SESSION["BX_CML2_EXPORT"][$lastOrderPrefix] = $arOrder["ID"]; } if (IntVal($time_limit) > 0 && time() > $end_time) { break; } } ?> </<?php echo GetMessage("SALE_EXPORT_COM_INFORMATION"); ?> > <?php return $arResultStat; }
$arMenu["items"][] = array("text" => GetMessage("SALE_TAX"), "title" => GetMessage("SALE_TAX_DESCR"), "items_id" => "menu_sale_taxes", "items" => $arSubItems); } if ($APPLICATION->GetGroupRight("sale") == "W") { $arMenu["items"][] = array("text" => GetMessage("SALE_PERSON_TYPE"), "title" => GetMessage("SALE_PERSON_TYPE_DESCR"), "url" => "sale_person_type.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_person_type_edit.php")); $arMenu["items"][] = array("text" => GetMessage("SALE_STATUS"), "title" => GetMessage("SALE_STATUS_DESCR"), "url" => "sale_status.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_status_edit.php")); if (Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'N') == 'Y') { $arMenu["items"][] = array("text" => GetMessage("SALE_BUSINESS_VALUE"), "title" => 'SALE_BUSINESS_VALUE title', "url" => "sale_business_value.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_business_value.php")); } $arMenu["items"][] = array("text" => GetMessage("SALE_ORDER_PROPS"), "title" => GetMessage("SALE_ORDER_PROPS_DESCR"), "items_id" => "menu_sale_properties", "items" => array(array("text" => GetMessage("sale_menu_properties"), "title" => GetMessage("sale_menu_properties_title"), "url" => "sale_order_props.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_order_props_edit.php")), array("text" => GetMessage("SALE_ORDER_PROPS_GR"), "title" => GetMessage("SALE_ORDER_PROPS_GR_DESCR"), "url" => "sale_order_props_group.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_order_props_group_edit.php")))); /* LOCATIONS BEGIN */ // this file can be loaded directly, without module include, so ... require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/include.php"; if (class_exists('CSaleLocation')) { $locationMenu = array("text" => GetMessage("SALE_LOCATION"), "title" => GetMessage("SALE_LOCATION_DESCR"), "items_id" => "menu_sale_locations"); if (CSaleLocation::isLocationProEnabled()) { $locationMenu["items"] = array(array("text" => GetMessage("sale_menu_locations"), "title" => GetMessage("sale_menu_locations_title"), "url" => Location\Admin\LocationHelper::getListUrl(0), "more_url" => array(Location\Admin\LocationHelper::getEditUrl()), "module_id" => "sale", "items_id" => Location\Admin\LocationHelper::packItemsQueryString(), "dynamic" => true, "items" => Location\Admin\LocationHelper::getLocationSubMenu()), array("text" => GetMessage("SALE_LOCATION_GROUPS"), "title" => GetMessage("SALE_LOCATION_GROUPS_DESCR"), "url" => Location\Admin\GroupHelper::getListUrl(), "more_url" => array(Location\Admin\GroupHelper::getEditUrl())), array("text" => GetMessage("SALE_MENU_LOCATION_ZONES"), "title" => GetMessage("SALE_MENU_LOCATION_ZONES_TITLE"), "url" => Location\Admin\SiteLocationHelper::getListUrl(), "more_url" => array(Location\Admin\SiteLocationHelper::getEditUrl())), array("text" => GetMessage("SALE_MENU_LOCATION_DEFAULT"), "title" => GetMessage("SALE_MENU_LOCATION_DEFAULT_TITLE"), "url" => Location\Admin\DefaultSiteHelper::getListUrl(), "more_url" => array(Location\Admin\DefaultSiteHelper::getEditUrl())), array("text" => GetMessage("SALE_MENU_LOCATION_TYPES"), "title" => GetMessage("SALE_MENU_LOCATION_TYPES_TITLE"), "url" => Location\Admin\TypeHelper::getListUrl(), "more_url" => array(Location\Admin\TypeHelper::getEditUrl())), array("text" => GetMessage("SALE_MENU_LOCATION_SERVICES"), "title" => GetMessage("SALE_MENU_LOCATION_SERVICES_TITLE"), "url" => Location\Admin\ExternalServiceHelper::getListUrl(), "more_url" => array(Location\Admin\ExternalServiceHelper::getEditUrl())), array("text" => GetMessage("SALE_LOCATION_IMPORT"), "title" => GetMessage("SALE_LOCATION_IMPORT_DESCR"), "url" => Location\Admin\Helper::getImportUrl()), array("text" => GetMessage("SALE_LOCATION_REINDEX"), "title" => GetMessage("SALE_LOCATION_REINDEX_DESCR"), "url" => Location\Admin\Helper::getReindexUrl())); } else { $locationMenu["items"] = array(array("text" => GetMessage("sale_menu_locations"), "title" => GetMessage("sale_menu_locations_title"), "url" => "sale_location_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_location_edit.php")), array("text" => GetMessage("SALE_LOCATION_GROUPS"), "title" => GetMessage("SALE_LOCATION_GROUPS_DESCR"), "url" => "sale_location_group_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_location_group_edit.php")), array("text" => GetMessage("SALE_LOCATION_IMPORT"), "title" => GetMessage("SALE_LOCATION_IMPORT_DESCR"), "url" => "sale_location_import.php?lang=" . LANGUAGE_ID)); $locationMenu["items"][] = array("text" => GetMessage("SALE_MENU_LOCATION_MIGRATION"), "title" => GetMessage("SALE_MENU_LOCATION_MIGRATION_TITLE"), "url" => Location\Admin\Helper::getMigrationUrl()); } $arMenu["items"][] = $locationMenu; unset($locationMenu); } /* LOCATIONS END */ $arMenu["items"][] = array("text" => GetMessage("MAIN_MENU_1C_INTEGRATION"), "title" => GetMessage("MAIN_MENU_1C_INTEGRATION_TITLE"), "url" => "1c_admin.php?lang=" . LANGUAGE_ID, "more_url" => array("1c_admin.php")); $arMenu["items"][] = array("text" => GetMessage("MAIN_MENU_REPORT_EDIT"), "title" => GetMessage("MAIN_MENU_REPORT_EDIT_TITLE"), "url" => "sale_report_edit.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_report_edit.php")); if ($APPLICATION->GetGroupRight("sale") == "W" && (LANGUAGE_ID == "ru" || LANGUAGE_ID == "ua")) { $arMenu["items"][] = array("text" => GetMessage("SALE_TRADING_PLATFORMS"), "title" => GetMessage("SALE_TRADING_PLATFORMS_DESCR"), "items_id" => "menu_sale_trading_platforms", "items" => array(array("text" => GetMessage("SALE_YANDEX_MARKET"), "title" => GetMessage("SALE_YANDEX_MARKET_DESCR"), "url" => "sale_ymarket.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_ymarket.php")), array("text" => "Ebay", "title" => "Ebay", "items_id" => "menu_sale_trading_platforms_ebay", "more_url" => array("sale_ebay_actions.php"), "items" => array(array("text" => GetMessage("SALE_MENU_EBAY_WIZARD"), "title" => GetMessage("SALE_MENU_EBAY_EXCHANGE_DESCR"), "url" => "sale_ebay_wizard.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_ebay_wizard.php")), array("text" => GetMessage("SALE_MENU_EBAY_SETT"), "title" => GetMessage("SALE_MENU_EBAY_SETT_DESCR"), "url" => "sale_ebay.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_ebay.php")), array("text" => GetMessage("SALE_MENU_EBAY_POLICY"), "title" => GetMessage("SALE_MENU_EBAY_POLICY_DESCR"), "url" => "sale_ebay_policy.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_ebay_policy.php")), array("text" => GetMessage("SALE_MENU_EBAY_EXCHANGE"), "title" => GetMessage("SALE_MENU_EBAY_EXCHANGE_DESCR"), "url" => "sale_ebay_exchange.php?lang=" . LANGUAGE_ID, "more_url" => array("sale_ebay_exchange.php")))))); } } $aMenu[] = $arMenu;
/** * Do smth when called over ajax * @return mixed[] */ public static function doAjaxStuff($parameters = array()) { $errors = static::checkAccessPermissions(array('CHECK_CSRF' => true)); $data = array(); if (count($errors) == 0) { $request = static::getRequest(); // action: process ajax if (isset($request['POST']['AJAX_CALL'])) { if ($request['POST']['ACT'] == 'REINDEX') { $process = new Search\ReindexProcess($request['POST']['ACT_DATA']); } if ($request['POST']['step'] == 0) { if (is_array($request['POST']['ACT_DATA']['TYPES'])) { $all = false; foreach ($request['POST']['ACT_DATA']['TYPES'] as $k => $type) { if ($type == '') { $all = true; break; } $request['POST']['ACT_DATA']['TYPES'][$k] = intval($type); } $optValue = array(); if (!$all) { $optValue = array_unique($request['POST']['ACT_DATA']['TYPES']); } Search\Finder::setIndexedTypes($optValue); } if (is_array($request['POST']['ACT_DATA']['LANG'])) { $langs = TypeHelper::getLanguageList(); $all = false; foreach ($request['POST']['ACT_DATA']['LANG'] as $k => $lang) { if ($lang == '') { $all = true; break; } if (!isset($langs[$lang])) { unset($request['POST']['ACT_DATA']['LANG'][$k]); } } $optValue = array(); if (!$all) { $optValue = array_unique($request['POST']['ACT_DATA']['LANG']); } Search\Finder::setIndexedLanguages($optValue); } $process->reset(); } try { @set_time_limit(0); $data['PERCENT'] = $process->performStage(); $data['NEXT_STAGE'] = $process->getStageCode(); } catch (Main\SystemException $e) { $errors[] = $e->getMessage(); } if ($data['PERCENT'] == 100) { //$GLOBALS['CACHE_MANAGER']->ClearByTag('sale-location-data'); } } } return array('ERRORS' => $errors, 'DATA' => $data); }
/** * @param \Bitrix\Sale\Order $order * @param $arOrder * @param $agentParams * @param $bExportFromCrm * @param $bCrmModuleIncluded * @param $paySystems * @param $delivery * @param array $options * * @return array|void */ function getSaleProperties(Bitrix\Sale\Order $order, $arOrder, $agentParams, $bExportFromCrm, $bCrmModuleIncluded, $paySystems, $delivery, array $options = array()) { $providersInstance = self::getProvidersInstanceByOrder($order); $personTypeId = $order->getPersonTypeId(); $personTypes = BusinessValue::getPersonTypes(); if (!($personType = $personTypes[$personTypeId])) { self::logError($order->getId(), 'Undefined DOMAIN for person type id "' . $personTypeId . '"'); return; } $systemCodes1C = array_flip(self::$systemCodes[$personType['DOMAIN']]); $arProp = array(); $arProp["ORDER"] = $arOrder; if (IntVal($arOrder["USER_ID"]) > 0) { $dbUser = CUser::GetByID($arOrder["USER_ID"]); if ($arUser = $dbUser->Fetch()) { $arProp["USER"] = $arUser; } } if ($bExportFromCrm) { $arProp["CRM"] = array(); $companyID = isset($arOrder["UF_COMPANY_ID"]) ? intval($arOrder["UF_COMPANY_ID"]) : 0; $contactID = isset($arOrder["UF_CONTACT_ID"]) ? intval($arOrder["UF_CONTACT_ID"]) : 0; if ($companyID > 0) { $arProp["CRM"]["CLIENT_ID"] = "CRMCO" . $companyID; } else { $arProp["CRM"]["CLIENT_ID"] = "CRMC" . $contactID; } $clientInfo = array("LOGIN" => "", "NAME" => "", "LAST_NAME" => "", "SECOND_NAME" => ""); if ($bCrmModuleIncluded) { if ($companyID > 0) { $arCompanyFilter = array('=ID' => $companyID); $dbCompany = CCrmCompany::GetListEx(array(), $arCompanyFilter, false, array("nTopCount" => 1), array("TITLE")); $arCompany = $dbCompany->Fetch(); unset($dbCompany, $arCompanyFilter); if (is_array($arCompany)) { if (isset($arCompany["TITLE"])) { $clientInfo["NAME"] = $arCompany["TITLE"]; } } unset($arCompany); } else { if ($contactID > 0) { $arContactFilter = array('=ID' => $contactID); $dbContact = CCrmContact::GetListEx(array(), $arContactFilter, false, array("nTopCount" => 1), array("NAME", "LAST_NAME", "SECOND_NAME")); $arContact = $dbContact->Fetch(); unset($dbContact, $arContactFilter); if (is_array($arContact)) { if (isset($arContact["NAME"])) { $clientInfo["NAME"] = $arContact["NAME"]; } if (isset($arContact["LAST_NAME"])) { $clientInfo["LAST_NAME"] = $arContact["LAST_NAME"]; } if (isset($arContact["SECOND_NAME"])) { $clientInfo["SECOND_NAME"] = $arContact["SECOND_NAME"]; } } unset($arContact); } } } $arProp["CRM"]["CLIENT"] = $clientInfo; unset($clientInfo); } if (IntVal($arOrder["PAY_SYSTEM_ID"]) > 0) { $arProp["ORDER"]["PAY_SYSTEM_NAME"] = $paySystems[$arOrder["PAY_SYSTEM_ID"]]; } if (strlen($arOrder["DELIVERY_ID"]) > 0) { $arProp["ORDER"]["DELIVERY_NAME"] = $delivery[$arOrder["DELIVERY_ID"]]; } $dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE")); $locationStreetPropertyValue = ''; while ($arOrderPropVals = $dbOrderPropVals->Fetch()) { if ($arOrderPropVals["PROP_TYPE"] == "CHECKBOX") { if ($arOrderPropVals["VALUE"] == "Y") { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "true"; } else { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "false"; } } elseif ($arOrderPropVals["PROP_TYPE"] == "TEXT" || $arOrderPropVals["PROP_TYPE"] == "TEXTAREA") { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"]; } elseif ($arOrderPropVals["PROP_TYPE"] == "SELECT" || $arOrderPropVals["PROP_TYPE"] == "RADIO") { $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["VALUE"]); $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arVal["NAME"]; } elseif ($arOrderPropVals["PROP_TYPE"] == "MULTISELECT") { $curVal = explode(",", $arOrderPropVals["VALUE"]); foreach ($curVal as $vm) { $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $vm); $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] .= ", " . $arVal["NAME"]; } $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = substr($arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]], 2); } elseif ($arOrderPropVals["PROP_TYPE"] == "LOCATION") { $arVal = CSaleLocation::GetByID($arOrderPropVals["VALUE"], LANGUAGE_ID); if (CSaleLocation::isLocationProEnabled()) { if (intval($arVal['ID'])) { try { $res = \Bitrix\Sale\Location\LocationTable::getPathToNode($arVal['ID'], array('select' => array('LNAME' => 'NAME.NAME', 'TYPE_ID'), 'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID))); $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypeCodeIdMapCached(); $path = array(); while ($item = $res->fetch()) { // copy street to STREET property if ($types['ID2CODE'][$item['TYPE_ID']] == 'STREET') { $locationStreetPropertyValue = $item['LNAME']; } $path[] = $item['LNAME']; } $locationString = implode(' - ', $path); } catch (\Bitrix\Main\SystemException $e) { $locationString = ''; } } else { $locationString = ''; } } else { $locationString = $arVal["COUNTRY_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["REGION_NAME"]) <= 0 ? "" : " - ") . $arVal["REGION_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["CITY_NAME"]) <= 0 ? "" : " - ") . $arVal["CITY_NAME"]; } $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $locationString; $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_CITY"] = $arVal["CITY_NAME"]; $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_COUNTRY"] = $arVal["COUNTRY_NAME"]; $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_REGION"] = $arVal["REGION_NAME"]; } else { $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"]; } } foreach ($agentParams as $k => $v) { if (strpos($k, "REKV_") !== false) { //params if (!is_array($v)) { $agent["REKV"][$k] = $v; } else { if (strlen($v["TYPE"]) <= 0) { $agent["REKV"][$k] = $v["VALUE"]; } else { switch ($v["TYPE"]) { case 'CRM': $agent["REKV"][$k] = $arProp[$v["TYPE"]][$v["VALUE"]]; //value break; default: if (!($codeKey = $systemCodes1C[$k]) && substr($k, 0, 5) === 'REKV_' && ($codeIndex = substr($k, 5)) !== '' && ($codeKey = BusinessValueConsumer1C::getRekvCodeKey($order->getPersonTypeId(), $codeIndex)) && ($providerInstance = $providersInstance[$order->getId()][$v["TYPE"]]) && is_set($providerInstance)) { $agent["REKV"][$k] = Bitrix\Sale\BusinessValue::getValueFromProvider($providerInstance, $codeKey, BusinessValueConsumer1C::CONSUMER_KEY); } } } } } else { if (!is_array($v)) { $agent[$k] = $v; } else { if (strlen($v["TYPE"]) <= 0) { $agent[$k] = $v["VALUE"]; } else { switch ($v["TYPE"]) { case 'CRM': $agent[$k] = $arProp[$v["TYPE"]][$v["VALUE"]]; break; default: if (($codeKey = $systemCodes1C[$k]) && ($providerInstance = $providersInstance[$order->getId()][$v["TYPE"]]) && is_set($providerInstance)) { $agent[$k] = Bitrix\Sale\BusinessValue::getValueFromProvider($providerInstance, $codeKey, BusinessValueConsumer1C::CONSUMER_KEY); } } } if ($k == 'STREET' && strlen($locationStreetPropertyValue)) { $agent[$k] = $locationStreetPropertyValue . (strlen($agent[$k]) ? ', ' : '') . $agent[$k]; } } } } return array('agent' => $agent, 'arProp' => $arProp); }
##################################### ?> <?//temporal code?> <?if(!CSaleLocation::locationProCheckEnabled())require($DOCUMENT_ROOT."/bitrix/modules/main/include/epilog_admin.php");?> <?if(strlen($fatal)):?> <div class="error-message"> <?CAdminMessage::ShowMessage(array('MESSAGE' => $fatal, 'type' => 'ERROR'))?> </div> <?else:?> <form method="GET" action="<?php echo Helper::getListUrl($itemId ? array('id' => $itemId) : array()); ?> " name="filter_form"> <input type="hidden" name="filter" value="Y" /> <?if($itemId):?> <input type="hidden" name="id" value="<?php echo $itemId; ?> " /> <?endif?> <?$oFilter->Begin();?> <?foreach($columns as $code => $fld):?> <?//if(!in_array($code, $excludedColumns)):?> <tr>