From d25c7fc484806da28cf91b3fa23f36e0fb2d9f1d Mon Sep 17 00:00:00 2001 From: ellynoize <111681973+ellynoize@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:21:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F=20=D0=9F=D0=BE=D1=87=D1=82?= =?UTF-8?q?=D1=8B=20=D0=A0=D0=BE=D1=81=D1=81=D0=B8=D0=B8=20(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php | 4 +++- intaro.retailcrm/description.ru | 2 +- intaro.retailcrm/install/version.php | 4 ++-- intaro.retailcrm/lib/component/constants.php | 2 +- intaro.retailcrm/options.php | 4 ++-- 6 files changed, 12 insertions(+), 7 deletions(-) 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'],