From f7393dd251440926a71d3ea691430c5818e9515f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=A2=D1=8B?= =?UTF-8?q?=D1=89=D0=B8=D1=86=D0=BA=D0=B8=D0=B9?= Date: Thu, 20 Oct 2016 13:16:59 +0300 Subject: [PATCH] v.2.0.7 --- CHANGELOG.md | 4 ++++ .../classes/general/history/RetailCrmHistory.php | 12 ++++++------ .../classes/general/order/RetailCrmOrder.php | 2 +- intaro.retailcrm/description.ru | 4 ++-- intaro.retailcrm/install/version.php | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48525d5f..18f9db4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2016-10-20 v.2.0.7 +* Исправлена ошибка с недобавлением товара в заказ по истории +* Исправлена ошибка с недобавлением сервиса доставки в црм + ## 2016-10-14 v.2.0.6 * Оптимизация History * Исправлены ошибки diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory.php index 98c37ac6..91005022 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory.php @@ -600,7 +600,7 @@ class RetailCrmHistory continue; } $item = $basket->createItem('catalog', $product['offer']['externalId']); - if ($item instanceof \Bitrix\Sale\Basket) { + if ($item instanceof \Bitrix\Sale\BasketItem) { $elem = self::getInfoElement($product['offer']['externalId']); $item->setFields(array( 'CURRENCY' => \Bitrix\Currency\CurrencyManager::getBaseCurrency(), @@ -610,7 +610,7 @@ class RetailCrmHistory 'DETAIL_PAGE_URL' => $elem['URL'] )); } else { - RCrmActions::eventLog('RetailCrmHistory::orderHistory', 'createItem', 'Error item add'); + RCrmActions::eventLog('RetailCrmHistory::orderHistory', 'createItem', 'Error item id=' . $product['offer']['externalId'] . ' add in order id=' . $order['externalId']); continue; } } @@ -698,7 +698,7 @@ class RetailCrmHistory //delivery cost if (array_key_exists('cost', $order['delivery'])) { - $shipment = Bitrix\Sale\Shipment::getList(array( + $shipment = Bitrix\Sale\Internals\ShipmentTable::getList(array( 'filter' => array('ORDER_ID' => $order['externalId'], 'SYSTEM' => 'N'), 'order' => array('ID') ))->fetch(); @@ -901,7 +901,7 @@ class RetailCrmHistory //найти текущую доставку в заказе $cnt = Bitrix\Sale\Internals\ShipmentTable::getCount(array('ORDER_ID' => $orderCrm['externalId'])); if ($cnt > 0) {//обновляем - $obDeliverys = \Bitrix\Sale\Shipment::getList(array('filter' => array('ORDER_ID' => $orderCrm['externalId']), + $obDeliverys = \Bitrix\Sale\Internals\ShipmentTable::getList(array('filter' => array('ORDER_ID' => $orderCrm['externalId']), 'order' => array('ID'))); while ($arDelivery = $obDeliverys->fetch()) { if ($arDelivery['DELIVERY_ID'] != $nowDelivery) { @@ -953,7 +953,7 @@ class RetailCrmHistory //ищем у заказа на сайте доставки и удаляем/заменяем на без доставки $noOrderId = \Bitrix\Sale\Delivery\Services\EmptyDeliveryService::getEmptyDeliveryServiceId(); \Bitrix\Sale\OrderTable::update($orderCrm['externalId'], array('DELIVERY_ID' => $noOrderId)); - $obDeliverys = Bitrix\Sale\Shipment::getList(array('filter' => array('ORDER_ID' => $orderCrm['externalId']), + $obDeliverys = Bitrix\Sale\Internals\ShipmentTable::getList(array('filter' => array('ORDER_ID' => $orderCrm['externalId']), 'order' => array('ID'))); $create = true; while ($arDelivery = $obDeliverys->fetch()) { @@ -1078,7 +1078,7 @@ class RetailCrmHistory if (in_array($optionsPayment[$order['paymentType']], $arPayments)) { \Bitrix\Sale\OrderTable::update($order['externalId'], array('PAY_SYSTEM_ID' => $optionsPayment[$order['paymentType']])); - $payment = \Bitrix\Sale\Payment::getList(array( + $payment = \Bitrix\Sale\Internals\PaymentTable::getList(array( 'filter' => array('ORDER_ID' => $order['externalId']), 'order' => array('ID') ))->fetch(); diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder.php index 7e3df3a1..8fdc48af 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder.php @@ -102,7 +102,7 @@ class RetailCrmOrder if (array_key_exists($arFields['DELIVERYS'][0]['id'], $arParams['optionsDelivTypes'])) { $order['delivery']['code'] = $arParams['optionsDelivTypes'][$arFields['DELIVERYS'][0]['id']]; if (isset($arFields['DELIVERYS'][0]['service']) && $arFields['DELIVERYS'][0]['service'] != '') { - $order['delivery']['service'] = $arFields['DELIVERYS'][0]['service']; + $order['delivery']['service']['code'] = $arFields['DELIVERYS'][0]['service']; } } diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 0347839e..06550085 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1,2 +1,2 @@ -- Оптимизация History -- Исправлены ошибки \ 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 8f87522f..365e2fcd 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ "2.0.6", - "VERSION_DATE" => "2016-10-14 18:00:00" + "VERSION" => "2.0.7", + "VERSION_DATE" => "2016-10-20 18:00:00" );