1
0
mirror of synced 2025-02-07 18:49:23 +03:00

Merge pull request #20 from ghostrainman/master

v.2.0.7
This commit is contained in:
Alex Lushpai 2016-10-20 14:47:09 +04:00 committed by GitHub
commit 8e8415f6ea
5 changed files with 15 additions and 11 deletions

View File

@ -1,3 +1,7 @@
## 2016-10-20 v.2.0.7
* Исправлена ошибка с недобавлением товара в заказ по истории
* Исправлена ошибка с недобавлением сервиса доставки в црм
## 2016-10-14 v.2.0.6 ## 2016-10-14 v.2.0.6
* Оптимизация History * Оптимизация History
* Исправлены ошибки * Исправлены ошибки

View File

@ -600,7 +600,7 @@ class RetailCrmHistory
continue; continue;
} }
$item = $basket->createItem('catalog', $product['offer']['externalId']); $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']); $elem = self::getInfoElement($product['offer']['externalId']);
$item->setFields(array( $item->setFields(array(
'CURRENCY' => \Bitrix\Currency\CurrencyManager::getBaseCurrency(), 'CURRENCY' => \Bitrix\Currency\CurrencyManager::getBaseCurrency(),
@ -610,7 +610,7 @@ class RetailCrmHistory
'DETAIL_PAGE_URL' => $elem['URL'] 'DETAIL_PAGE_URL' => $elem['URL']
)); ));
} else { } 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; continue;
} }
} }
@ -698,7 +698,7 @@ class RetailCrmHistory
//delivery cost //delivery cost
if (array_key_exists('cost', $order['delivery'])) { 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'), 'filter' => array('ORDER_ID' => $order['externalId'], 'SYSTEM' => 'N'),
'order' => array('ID') 'order' => array('ID')
))->fetch(); ))->fetch();
@ -901,7 +901,7 @@ class RetailCrmHistory
//найти текущую доставку в заказе //найти текущую доставку в заказе
$cnt = Bitrix\Sale\Internals\ShipmentTable::getCount(array('ORDER_ID' => $orderCrm['externalId'])); $cnt = Bitrix\Sale\Internals\ShipmentTable::getCount(array('ORDER_ID' => $orderCrm['externalId']));
if ($cnt > 0) {//обновляем 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'))); 'order' => array('ID')));
while ($arDelivery = $obDeliverys->fetch()) { while ($arDelivery = $obDeliverys->fetch()) {
if ($arDelivery['DELIVERY_ID'] != $nowDelivery) { if ($arDelivery['DELIVERY_ID'] != $nowDelivery) {
@ -953,7 +953,7 @@ class RetailCrmHistory
//ищем у заказа на сайте доставки и удаляем/заменяем на без доставки //ищем у заказа на сайте доставки и удаляем/заменяем на без доставки
$noOrderId = \Bitrix\Sale\Delivery\Services\EmptyDeliveryService::getEmptyDeliveryServiceId(); $noOrderId = \Bitrix\Sale\Delivery\Services\EmptyDeliveryService::getEmptyDeliveryServiceId();
\Bitrix\Sale\OrderTable::update($orderCrm['externalId'], array('DELIVERY_ID' => $noOrderId)); \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'))); 'order' => array('ID')));
$create = true; $create = true;
while ($arDelivery = $obDeliverys->fetch()) { while ($arDelivery = $obDeliverys->fetch()) {
@ -1078,7 +1078,7 @@ class RetailCrmHistory
if (in_array($optionsPayment[$order['paymentType']], $arPayments)) { if (in_array($optionsPayment[$order['paymentType']], $arPayments)) {
\Bitrix\Sale\OrderTable::update($order['externalId'], array('PAY_SYSTEM_ID' => $optionsPayment[$order['paymentType']])); \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']), 'filter' => array('ORDER_ID' => $order['externalId']),
'order' => array('ID') 'order' => array('ID')
))->fetch(); ))->fetch();

View File

@ -102,7 +102,7 @@ class RetailCrmOrder
if (array_key_exists($arFields['DELIVERYS'][0]['id'], $arParams['optionsDelivTypes'])) { if (array_key_exists($arFields['DELIVERYS'][0]['id'], $arParams['optionsDelivTypes'])) {
$order['delivery']['code'] = $arParams['optionsDelivTypes'][$arFields['DELIVERYS'][0]['id']]; $order['delivery']['code'] = $arParams['optionsDelivTypes'][$arFields['DELIVERYS'][0]['id']];
if (isset($arFields['DELIVERYS'][0]['service']) && $arFields['DELIVERYS'][0]['service'] != '') { 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'];
} }
} }

View File

@ -1,2 +1,2 @@
- Оптимизация History - Исправлена ошибка с недобавлением товара в заказ по истории
- Исправлены ошибки - Исправлена ошибка с недобавлением сервиса доставки в црм

View File

@ -1,6 +1,6 @@
<? <?
$arModuleVersion = array( $arModuleVersion = array(
"VERSION" => "2.0.6", "VERSION" => "2.0.7",
"VERSION_DATE" => "2016-10-14 18:00:00" "VERSION_DATE" => "2016-10-20 18:00:00"
); );