Exemplo n.º 1
0
 public static function getConfig($siteId = false)
 {
     $shopLocationId = CSaleHelper::getShopLocationId($siteId);
     $arShopLocation = CSaleLocation::GetByID($shopLocationId);
     $locString = strlen($arShopLocation["COUNTRY_NAME_LANG"]) > 0 ? $arShopLocation["COUNTRY_NAME_LANG"] : "";
     $locString .= strlen($arShopLocation["REGION_NAME_LANG"]) > 0 ? (strlen($locString) > 0 ? ", " : "") . $arShopLocation["REGION_NAME_LANG"] : "";
     $locString .= strlen($arShopLocation["CITY_NAME_LANG"]) > 0 ? (strlen($locString) > 0 ? ", " : "") . $arShopLocation["CITY_NAME_LANG"] : "";
     $locDelivery = Adapter::mapLocation($shopLocationId);
     $arConfig = array('CONFIG_GROUPS' => array('exchange_sett' => GetMessage('SALE_DH_PECOM_EXCH_TITLE'), 'add_services' => GetMessage('SALE_DH_PECOM_ADD_SERVICES_TITLE'), 'auto' => GetMessage('SALE_DH_PECOM_AUTO_TITLE'), 'avia' => GetMessage('SALE_DH_PECOM_AVIA_TITLE')), "CONFIG" => array("LOGIN" => array("DEFAULT" => '', "TITLE" => GetMessage('SALE_DH_PECOM_EXCH_LOGIN'), "GROUP" => "exchange_sett"), "KEY" => array("DEFAULT" => '', "TITLE" => GetMessage('SALE_DH_PECOM_EXCH_KEY'), "GROUP" => "exchange_sett"), "NAME" => array("DEFAULT" => '', "TITLE" => GetMessage('SALE_DH_PECOM_EXCH_NAME'), "GROUP" => "exchange_sett"), "INN" => array("DEFAULT" => '', "TITLE" => GetMessage('SALE_DH_PECOM_EXCH_INN'), "GROUP" => "exchange_sett"), "CITY" => array("TYPE" => "TEXT_RO", "TITLE" => GetMessage('SALE_DH_PECOM_EXCH_CITY'), "VALUE" => $locString, "GROUP" => "exchange_sett"), "CITY_DELIVERY" => array("TYPE" => "DROPDOWN", "TITLE" => GetMessage('SALE_DH_PECOM_EXCH_CITY_DELIVERY'), "VALUES" => $locDelivery, "GROUP" => "exchange_sett"), "PHONE" => array("DEFAULT" => '', "TITLE" => GetMessage('SALE_DH_PECOM_EXCH_PHONE'), "GROUP" => "exchange_sett"), "PAYMENT_FORM" => array("TYPE" => "DROPDOWN", "DEFAULT" => self::$PAYER_BUYER, "TITLE" => GetMessage('SALE_DH_PECOM_AS_PAYMENT_FORM'), "GROUP" => "exchange_sett", "VALUES" => array(self::$PAYER_SHOP => GetMessage('SALE_DH_PECOM_AS_PAYMENT_BANK'), self::$PAYER_BUYER => GetMessage('SALE_DH_PECOM_AS_PAYMENT_KASSA'))), "SERVICE_TAKE" => array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_TAKE'), 'GROUP' => 'add_services'), "SERVICE_TAKE_ENABLED" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_TAKE_ENABLE'), 'GROUP' => 'add_services', 'DEFAULT' => '', 'HIDE_BY_NAMES' => array('SERVICE_TAKE_TENT_ENABLED', 'SERVICE_TAKE_HYDRO_ENABLED')), "SERVICE_TAKE_TENT_ENABLED" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_TAKE_TENT'), 'GROUP' => 'add_services', 'DEFAULT' => ''), "SERVICE_TAKE_HYDRO_ENABLED" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_TAKE_HYDRO'), 'GROUP' => 'add_services', 'DEFAULT' => ''), "SERVICE_DELIVERY" => array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_DELIVERY'), 'GROUP' => 'add_services'), "SERVICE_DELIVERY_ENABLED" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_DELIVERY_ENABLE'), 'GROUP' => 'add_services', 'DEFAULT' => '', 'HIDE_BY_NAMES' => array('SERVICE_DELIVERY_TENT_ENABLED', 'SERVICE_DELIVERY_HYDRO_ENABLED', 'SERVICE_OTHER_DELIVERY_PAYER')), "SERVICE_DELIVERY_TENT_ENABLED" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_DELIVERY_TENT'), 'GROUP' => 'add_services', 'DEFAULT' => ''), "SERVICE_DELIVERY_HYDRO_ENABLED" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_DELIVERY_HYDRO'), 'GROUP' => 'add_services', 'DEFAULT' => ''), "SERVICE_OTHER_DELIVERY_PAYER" => array('TYPE' => 'DROPDOWN', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_PAYER'), 'GROUP' => 'add_services', 'DEFAULT' => self::$PAYER_BUYER, "VALUES" => array(self::$PAYER_SHOP => GetMessage('SALE_DH_PECOM_AS_PAYER_SHOP'), self::$PAYER_BUYER => GetMessage('SALE_DH_PECOM_AS_PAYER_BUYER'))), "SERVICE_OTHER" => array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_OTHER'), 'GROUP' => 'add_services'), "SERVICE_OTHER_PLOMBIR_ENABLE" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_OTHER_PLOMBIR_ENABLE'), 'GROUP' => 'add_services', 'DEFAULT' => '', 'HIDE_BY_NAMES' => array('SERVICE_OTHER_PLOMBIR_COUNT', 'SERVICE_OTHER_PLOMBIR_PAYER')), "SERVICE_OTHER_PLOMBIR_COUNT" => array('TYPE' => 'STRING', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_OTHER_PLOMBIR_COUNT'), 'GROUP' => 'add_services', 'DEFAULT' => '0'), "SERVICE_OTHER_PLOMBIR_PAYER" => array('TYPE' => 'DROPDOWN', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_PAYER'), 'GROUP' => 'add_services', 'DEFAULT' => self::$PAYER_BUYER, "VALUES" => array(self::$PAYER_SHOP => GetMessage('SALE_DH_PECOM_AS_PAYER_SHOP'), self::$PAYER_BUYER => GetMessage('SALE_DH_PECOM_AS_PAYER_BUYER'))), "SERVICE_OTHER_PALLETE" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_OTHER_PALLETE'), 'GROUP' => 'add_services', 'DEFAULT' => '', 'TOP_LINE' => 'Y', 'HIDE_BY_NAMES' => array('SERVICE_OTHER_PALLETE_PAYER')), "SERVICE_OTHER_PALLETE_PAYER" => array('TYPE' => 'DROPDOWN', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_PAYER'), 'GROUP' => 'add_services', 'DEFAULT' => self::$PAYER_BUYER, "VALUES" => array(self::$PAYER_SHOP => GetMessage('SALE_DH_PECOM_AS_PAYER_SHOP'), self::$PAYER_BUYER => GetMessage('SALE_DH_PECOM_AS_PAYER_BUYER'))), "SERVICE_OTHER_INSURANCE" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_OTHER_INSURANCE'), 'GROUP' => 'add_services', 'DEFAULT' => '', 'TOP_LINE' => 'Y', 'HIDE_BY_NAMES' => array('SERVICE_OTHER_INSURANCE_PAYER')), "SERVICE_OTHER_INSURANCE_PAYER" => array('TYPE' => 'DROPDOWN', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_PAYER'), 'GROUP' => 'add_services', 'DEFAULT' => self::$PAYER_BUYER, "VALUES" => array(self::$PAYER_SHOP => GetMessage('SALE_DH_PECOM_AS_PAYER_SHOP'), self::$PAYER_BUYER => GetMessage('SALE_DH_PECOM_AS_PAYER_BUYER'))), "SERVICE_OTHER_RIGID_PACKING" => array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_OTHER_RIGID_PACKING'), 'GROUP' => 'add_services', 'DEFAULT' => '', 'TOP_LINE' => 'Y', 'HIDE_BY_NAMES' => array('SERVICE_OTHER_RIGID_PAYER')), "SERVICE_OTHER_RIGID_PAYER" => array('TYPE' => 'DROPDOWN', 'TITLE' => GetMessage('SALE_DH_PECOM_AS_PAYER'), 'GROUP' => 'add_services', 'DEFAULT' => self::$PAYER_BUYER, "VALUES" => array(self::$PAYER_SHOP => GetMessage('SALE_DH_PECOM_AS_PAYER_SHOP'), self::$PAYER_BUYER => GetMessage('SALE_DH_PECOM_AS_PAYER_BUYER')))));
     $aviableBoxes = self::getAviableBoxes();
     foreach ($aviableBoxes as $boxId => $arBox) {
         CSaleDeliveryHelper::makeBoxConfig($boxId, $arBox, 'auto', $arConfig);
         CSaleDeliveryHelper::makeBoxConfig($boxId, $arBox, 'avia', $arConfig);
     }
     return $arConfig;
 }
Exemplo n.º 2
0
 public static function preparePreregistrationReqData($arOrder, $profileId, $arConfig)
 {
     $result = array();
     $result["sender"] = array("inn" => $arConfig["INN"]["VALUE"], "city" => static::getFilialAndCity($arConfig["CITY_DELIVERY"]["VALUE"]), "title" => $arConfig["NAME"]["VALUE"], "phone" => $arConfig["PHONE"]["VALUE"]);
     $inn = "";
     $city = "";
     $title = "";
     $phone = "";
     $address = "";
     if (isset($extraParams["location"])) {
         $city = $extraParams["location"];
     }
     $dbOrderProps = \CSaleOrderPropsValue::GetOrderProps($arOrder["ID"]);
     while ($arOrderProps = $dbOrderProps->Fetch()) {
         if ($arOrderProps["CODE"] == "COMPANY" || $arOrderProps["CODE"] == "FIO") {
             $title = $arOrderProps["VALUE"];
         }
         if ($arOrderProps["CODE"] == "INN") {
             $inn = $arOrderProps["VALUE"];
         }
         if ($arOrderProps["CODE"] == "PHONE") {
             $phone = $arOrderProps["VALUE"];
         }
         if ($arOrderProps["CODE"] == "LOCATION") {
             $location = $arOrderProps["VALUE"];
             $locDelivery = Adapter::mapLocation($location);
             // todo: if more than one
             $city = static::getFilialAndCity(key($locDelivery));
         }
         if ($arOrderProps["CODE"] == "ADDRESS") {
             $address = $arOrderProps["VALUE"];
         }
     }
     $arPacks = \CSaleDeliveryHelper::getBoxesFromConfig($profileId, $arConfig);
     $arPackagesParams = \CSaleDeliveryHelper::getRequiredPacks($arOrder["ITEMS"], $arPacks, 0);
     $result["cargos"] = array(array("common" => array("positionsCount" => count($arPackagesParams), "decription" => GetMessage("SALE_DH_PECOM_DESCRIPTION_GOODS"), "orderNumber" => $arOrder["ACCOUNT_NUMBER"], "paymentForm" => $arConfig["PAYMENT_FORM"]["VALUE"], "accompanyingDocuments" => false), "receiver" => array("inn" => $inn, "city" => $city, "title" => $title, "phone" => $phone, "addressStock" => $address), "services" => array("transporting" => array("payer" => array("type" => 1)), "hardPacking" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_RIGID_PACKING'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_RIGID_PAYER'))), "palletTransporting" => array("enabled" => !\CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_RIGID_PACKING') && \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_PALLETE'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_PALLETE_PAYER'))), "insurance" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_INSURANCE'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_INSURANCE_PAYER')), "cost" => intval($arOrder["PRICE"])), "sealing" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_PLOMBIR_ENABLE'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_PLOMBIR_PAYER'))), "strapping" => array("enabled" => false), "documentsReturning" => array("enabled" => false), "delivery" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_DELIVERY_ENABLED'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_DELIVERY_PAYER'))))));
     return $result;
 }