From 7a2ab16cf36ceed173c5052c9c0e233e2312bee9 Mon Sep 17 00:00:00 2001 From: Uryvskiy Dima Date: Mon, 12 Jun 2023 20:16:23 +0300 Subject: [PATCH] =?UTF-8?q?ref=20#89248=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=B8=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B8=20=D1=82=D0=BE=D1=80=D0=B3=D0=BE=D0=B2?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BB=D0=BE=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D1=82=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=80=D0=B5=20(#299)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ .../classes/general/order/RetailCrmOrder_v5.php | 7 ++++--- intaro.retailcrm/description.ru | 2 +- intaro.retailcrm/install/version.php | 4 ++-- intaro.retailcrm/lib/service/orderloyaltydataservice.php | 4 +++- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da44246a..3f935322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-06-12 v.6.3.14 +- Исправлена ошибка при изменении торгового предложения в товаре + ## 2023-06-09 v.6.3.13 - Правка генерации при работе со значением Без НДС diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php index bb6562ed..21d0e7c4 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php @@ -180,6 +180,7 @@ public static function orderSend( if ('ordersEdit' === $methodApi) { $response = RCrmActions::apiMethod($api, 'ordersGet', __METHOD__, $order['externalId'], $site); + if (isset($response['order'])) { foreach ($response['order']['items'] as $k => $item) { $externalId = $k .'_'. $item['offer']['externalId']; @@ -223,12 +224,12 @@ public static function orderSend( ) { $externalIds[$keyBasketId] = [ 'code' => 'bitrixBasketId', - 'value' => $product['ID'], + 'value' => $product['ID'] . '#' . $externalId, ]; } else { $externalIds[] = [ 'code' => 'bitrixBasketId', - 'value' => $product['ID'], + 'value' => $product['ID'] . '#' . $externalId, ]; } } else { //create @@ -239,7 +240,7 @@ public static function orderSend( ], [ 'code' => 'bitrixBasketId', - 'value' => $product['ID'], + 'value' => $product['ID'] . '#' . $externalId, ], ]; } diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index f23752de..a8c09c58 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Правка генерации при работе со значением Без НДС \ No newline at end of file +- Исправлена ошибка при изменении торгового предложения в товаре \ No newline at end of file diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index e749f77f..d04c2c01 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.3.13', - 'VERSION_DATE' => '2023-06-09 15:00:00' + 'VERSION' => '6.3.14', + 'VERSION_DATE' => '2023-06-12 20:00:00' ]; diff --git a/intaro.retailcrm/lib/service/orderloyaltydataservice.php b/intaro.retailcrm/lib/service/orderloyaltydataservice.php index 898b9846..e65f871c 100644 --- a/intaro.retailcrm/lib/service/orderloyaltydataservice.php +++ b/intaro.retailcrm/lib/service/orderloyaltydataservice.php @@ -199,7 +199,9 @@ public function updateOrderFromCrm(int $orderId): void array_column($itemArray['externalIds'], 'code'), true ); - $basketItem = $basket->getItemById($item->externalIds[$basketIdKey]->value); + + $basketId = explode('#', $item->externalIds[$basketIdKey]->value)[0] ?? null; + $basketItem = $basket->getItemById($basketId); if ($basketItem === null) { continue;