From e28ce27b8953576559f93bd924de96fdbc1a39bd Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 18 Apr 2019 09:43:44 +0300 Subject: [PATCH 1/5] Fixed bug with incorrect value of delivery service received by order history --- .../classes/general/history/RetailCrmHistory_v5.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index 2e7265cc..9e2d7745 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -994,10 +994,15 @@ class RetailCrmHistory if (isset($orderCrm['delivery']['service']['code'])) { $deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId); - + $serviceCode = $orderCrm['delivery']['service']['code']; + $services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); + if (!array_key_exists($serviceCode, $services)) { + $serviceCode = strtoupper($serviceCode); + $serviceCode = str_replace(array('-'), "_", $serviceCode); + } if ($deliveryCode) { try { - $deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $orderCrm['delivery']['service']['code']); + $deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $serviceCode); } catch (Bitrix\Main\SystemException $systemException) { RCrmActions::eventLog('RetailCrmHistory::deliveryEdit', '\Bitrix\Sale\Delivery\Services\Manager::getObjectByCode', $systemException->getMessage()); } From f41d04fb0e0111b2f17d2094d8fdbe2ce1ce4205 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 18 Apr 2019 09:51:26 +0300 Subject: [PATCH 2/5] fixed delivery service bug --- .../classes/general/history/RetailCrmHistory_v5.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index 9e2d7745..568bd27e 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -994,12 +994,12 @@ class RetailCrmHistory if (isset($orderCrm['delivery']['service']['code'])) { $deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId); - $serviceCode = $orderCrm['delivery']['service']['code']; - $services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); - if (!array_key_exists($serviceCode, $services)) { - $serviceCode = strtoupper($serviceCode); - $serviceCode = str_replace(array('-'), "_", $serviceCode); - } + $serviceCode = $orderCrm['delivery']['service']['code']; + $services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); + if (!array_key_exists($serviceCode, $services)) { + $serviceCode = strtoupper($serviceCode); + $serviceCode = str_replace(array('-'), "_", $serviceCode); + } if ($deliveryCode) { try { $deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $serviceCode); From 8b1c130ba6717d5c3f06d1a78342d0bb2910bf75 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 18 Apr 2019 09:52:35 +0300 Subject: [PATCH 3/5] fixed delivery service bug --- .../classes/general/history/RetailCrmHistory_v5.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index 568bd27e..f50f59e3 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -994,12 +994,12 @@ class RetailCrmHistory if (isset($orderCrm['delivery']['service']['code'])) { $deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId); - $serviceCode = $orderCrm['delivery']['service']['code']; - $services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); - if (!array_key_exists($serviceCode, $services)) { - $serviceCode = strtoupper($serviceCode); - $serviceCode = str_replace(array('-'), "_", $serviceCode); - } + $serviceCode = $orderCrm['delivery']['service']['code']; + $services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList(); + if (!array_key_exists($serviceCode, $services)) { + $serviceCode = strtoupper($serviceCode); + $serviceCode = str_replace(array('-'), "_", $serviceCode); + } if ($deliveryCode) { try { $deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $serviceCode); From b4cadedadde4a0baf2a9c617d6bbe1a6e8043674 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Tue, 7 May 2019 08:28:15 +0300 Subject: [PATCH 4/5] Fixed the legal data encoding bug --- .../classes/general/history/RetailCrmHistory_v5.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index f50f59e3..27645412 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -606,7 +606,7 @@ class RetailCrmHistory foreach ($optionsLegalDetails[$personType] as $key => $orderProp) { if (array_key_exists($key, $order)) { $somePropValue = $propertyCollection->getItemByOrderPropertyId($propsKey[$orderProp]['ID']); - self::setProp($somePropValue, $order[$key]); + self::setProp($somePropValue, RCrmActions::fromJSON($order[$key])); } } } From 5c94edd285af9392f0c12ffca29f1e1e80791d84 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Tue, 7 May 2019 16:41:57 +0300 Subject: [PATCH 5/5] fixed generating icml bug highload block without sku --- intaro.retailcrm/export/export_setup.php | 2 +- intaro.retailcrm/install/step5.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/intaro.retailcrm/export/export_setup.php b/intaro.retailcrm/export/export_setup.php index c7116602..10c11f56 100644 --- a/intaro.retailcrm/export/export_setup.php +++ b/intaro.retailcrm/export/export_setup.php @@ -740,7 +740,7 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor BX(obj.id.replace('SKU','PRODUCT')).value = 'none'; var bid = obj.id.replace('SKU','PRODUCT'); $("#" + bid).siblings('#highloadblock').remove(); - } else { + } else if(BX(obj.id.replace('PRODUCT','SKU'))) { BX(obj.id.replace('PRODUCT','SKU')).value = 'none'; var bid = obj.id.replace('PRODUCT','SKU'); $("#" + bid).siblings('#highloadblock').remove(); diff --git a/intaro.retailcrm/install/step5.php b/intaro.retailcrm/install/step5.php index 6fa29689..310f2663 100644 --- a/intaro.retailcrm/install/step5.php +++ b/intaro.retailcrm/install/step5.php @@ -595,7 +595,7 @@ if (!empty($oldValues)) { BX(obj.id.replace('SKU','PRODUCT')).value = 'none'; var bid = obj.id.replace('SKU','PRODUCT'); $("#" + bid).siblings('#highloadblock').remove(); - } else { + } else if(BX(obj.id.replace('PRODUCT','SKU'))){ BX(obj.id.replace('PRODUCT','SKU')).value = 'none'; var bid = obj.id.replace('PRODUCT','SKU'); $("#" + bid).siblings('#highloadblock').remove();