Skip to content

Commit

Permalink
Merge pull request #20 from ghostrainman/master
Browse files Browse the repository at this point in the history
v.2.0.7
  • Loading branch information
gwinn authored Oct 20, 2016
2 parents eaa5479 + f7393dd commit 8e8415f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2016-10-20 v.2.0.7
* Исправлена ошибка с недобавлением товара в заказ по истории
* Исправлена ошибка с недобавлением сервиса доставки в црм

## 2016-10-14 v.2.0.6
* Оптимизация History
* Исправлены ошибки
Expand Down
12 changes: 6 additions & 6 deletions intaro.retailcrm/classes/general/history/RetailCrmHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ public static function orderHistory()
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(),
Expand All @@ -610,7 +610,7 @@ public static function orderHistory()
'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;
}
}
Expand Down Expand Up @@ -698,7 +698,7 @@ public static function orderHistory()

//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();
Expand Down Expand Up @@ -901,7 +901,7 @@ public static function shipmentUpdate($orderCrm, $optionsDelivTypes)
//найти текущую доставку в заказе
$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) {
Expand Down Expand Up @@ -953,7 +953,7 @@ public static function shipmentUpdate($orderCrm, $optionsDelivTypes)
//ищем у заказа на сайте доставки и удаляем/заменяем на без доставки
$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()) {
Expand Down Expand Up @@ -1078,7 +1078,7 @@ public static function paySystemUpdate($order, $optionsPayment)

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();
Expand Down
2 changes: 1 addition & 1 deletion intaro.retailcrm/classes/general/order/RetailCrmOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function orderSend($arFields, $api, $arParams, $send = false, $sit
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'];
}
}

Expand Down
4 changes: 2 additions & 2 deletions intaro.retailcrm/description.ru
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- Оптимизация History
- Исправлены ошибки
- Исправлена ошибка с недобавлением товара в заказ по истории
- Исправлена ошибка с недобавлением сервиса доставки в црм
4 changes: 2 additions & 2 deletions intaro.retailcrm/install/version.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?
$arModuleVersion = array(
"VERSION" => "2.0.6",
"VERSION_DATE" => "2016-10-14 18:00:00"
"VERSION" => "2.0.7",
"VERSION_DATE" => "2016-10-20 18:00:00"
);

0 comments on commit 8e8415f

Please sign in to comment.