diff --git a/CHANGELOG.md b/CHANGELOG.md index cc47e86a..08b53aea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2024-10-24 v6.5.36 +- Добавлена передача профилей доставки Официального модуля Почты России + ## 2024-10-22 v6.5.35 - Исправлена подписка модуля на событие сохранения заказа diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php index 37f07d1f..78b4e5b5 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php @@ -995,7 +995,9 @@ class RetailCrmOrder } if ($delivery['PARENT_ID']) { $service = explode(':', $delivery['CODE']); - $shipment = ['id' => $delivery['PARENT_ID'], 'service' => $service[1]]; + $shipment = $delivery['CLASS_NAME'] === '\Sale\Handlers\Delivery\RussianpostProfile' + ? ['id' => $delivery['PARENT_ID'], 'service' => 'bitrix-' . $delivery['ID']] + : ['id' => $delivery['PARENT_ID'], 'service' => $service[1]]; } else { $shipment = ['id' => $delivery['ID']]; } diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 0f5d5e40..1672b415 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Исправлена подписка модуля на событие сохранения заказа +- Добавлена передача профилей доставки Официального модуля Почты России diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 4c41c8fc..6edbb19c 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.5.35', - 'VERSION_DATE' => '2024-10-22 17:00:00' + 'VERSION' => '6.5.36', + 'VERSION_DATE' => '2024-10-24 15:00:00' ]; diff --git a/intaro.retailcrm/lib/component/constants.php b/intaro.retailcrm/lib/component/constants.php index 4156a051..a8ef89d6 100644 --- a/intaro.retailcrm/lib/component/constants.php +++ b/intaro.retailcrm/lib/component/constants.php @@ -18,7 +18,7 @@ namespace Intaro\RetailCrm\Component; */ class Constants { - public const MODULE_VERSION = '6.5.35'; + public const MODULE_VERSION = '6.5.36'; public const CRM_PURCHASE_PRICE_NULL = 'purchasePrice_null'; public const BITRIX_USER_ID_PREFIX = 'bitrixUserId-'; public const CRM_USERS_MAP = 'crm_users_map'; diff --git a/intaro.retailcrm/options.php b/intaro.retailcrm/options.php index 1aed6ded..fdaf5d65 100644 --- a/intaro.retailcrm/options.php +++ b/intaro.retailcrm/options.php @@ -85,7 +85,7 @@ if (method_exists(RCrmActions::class, 'customOrderPropList') } //ajax update deliveryServices -if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') && isset($_POST['ajax']) && ($_POST['ajax'] === 1)) { +if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') && isset($_POST['ajax']) && ($_POST['ajax'] === '1')) { $api_host = COption::GetOptionString($mid, Constants::CRM_API_HOST_OPTION, 0); $api_key = COption::GetOptionString($mid, Constants::CRM_API_KEY_OPTION , 0); $api = new RetailCrm\ApiClient($api_host, $api_key); @@ -108,7 +108,7 @@ if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && (strtolower($_SERVER['HTTP_X_RE foreach ($optionsDelivTypes as $key => $deliveryType) { foreach ($arDeliveryServiceAll as $deliveryService) { - if ($deliveryService['PARENT_ID'] != 0 && $deliveryService['PARENT_ID'] === $key) { + if ($deliveryService['PARENT_ID'] != 0 && $deliveryService['PARENT_ID'] == $key) { try { $api->deliveryServicesEdit(RCrmActions::clearArr([ 'code' => 'bitrix-' . $deliveryService['ID'],