1
0
mirror of synced 2025-02-19 16:33:15 +03:00

Merge pull request #87 from Evgeniy-Goroh/master

Исправлены мелкие ошибки и недочеты
This commit is contained in:
Ilyas Salikhov 2019-11-14 17:06:38 +03:00 committed by GitHub
commit 202e0ffd17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 47 additions and 27 deletions

View File

@ -1,3 +1,8 @@
## 2019-11-1 v.2.5.3
* Исправление при обработке полученных изменений о контрагенте
* При обработки истории по клиентам добавлены кастомные поля
* Исправлены мелкие ошибки и недочеты
## 2019-09-17 v.2.5.2
* Поддержка функции добавления одинакового товара в заказ как разные товарные позиции из CRM

View File

@ -462,6 +462,9 @@
"text": {
"type": "string"
},
"address": {
"type": "string"
},
"shipmentStore": {
"type": "string"
},

View File

@ -612,6 +612,9 @@ class RetailCrmHistory
if (array_key_exists($key, $order)) {
$somePropValue = $propertyCollection->getItemByOrderPropertyId($propsKey[$orderProp]['ID']);
self::setProp($somePropValue, RCrmActions::fromJSON($order[$key]));
} elseif(array_key_exists($key, $order['contragent'])) {
$somePropValue = $propertyCollection->getItemByOrderPropertyId($propsKey[$orderProp]['ID']);
self::setProp($somePropValue, RCrmActions::fromJSON($order['contragent'][$key]));
}
}
}
@ -814,13 +817,16 @@ class RetailCrmHistory
if ($paymentExternalId) {
$newHistoryPayments[$orderPayment->getField('XML_ID')]['externalId'] = $paymentExternalId;
RCrmActions::apiMethod($api, 'paymentEditById', __METHOD__, $newHistoryPayments[$orderPayment->getField('XML_ID')]);
if ($paymentId) {
\Bitrix\Sale\Internals\PaymentTable::update($paymentId, array('XML_ID' => ''));
}
}
}
}
}
if (!$order['externalId']) {
$order["externalId"] = $newOrder->getId();
if (RCrmActions::apiMethod($api, 'ordersFixExternalIds', __METHOD__, array(array('id' => $order['id'], 'externalId' => $newOrder->getId()))) == false){
continue;
}
@ -907,6 +913,8 @@ class RetailCrmHistory
$customers[$change['customer']['id']]['contragent'][$fields['customerContragent'][$change['field']]] = $change['newValue'];
} elseif ($fields['customer'][$change['field']]) {
$customers[$change['customer']['id']][$fields['customer'][$change['field']]] = self::newValue($change['newValue']);
} elseif (strripos($change['field'], 'custom_') !== false) {
$customers[$change['customer']['id']]['customFields'][str_replace('custom_', '', $change['field'])] = self::newValue($change['newValue']);
}
if (isset($change['created'])) {

View File

@ -119,10 +119,12 @@ class RetailCrmOrder
$prop['VALUE'][0] = $location['NAME'];
}
if (!empty($prop['VALUE'][0])) {
$order['delivery']['address'][$search] = $prop['VALUE'][0];
}
}
}
}
//deliverys
if (array_key_exists($arFields['DELIVERYS'][0]['id'], $arParams['optionsDelivTypes'])) {

View File

@ -137,9 +137,6 @@ class RetailCrmUser
$normalizer = new RestNormalizer();
$customer = $normalizer->normalize($customer, 'customers');
$log = new Logger();
$log->write($customer, 'customerSend');
if (function_exists('retailCrmBeforeCustomerSend')) {
$newResCustomer = retailCrmBeforeCustomerSend($customer);
if (is_array($newResCustomer) && !empty($newResCustomer)) {
@ -151,6 +148,9 @@ class RetailCrmUser
}
}
$log = new Logger();
$log->write($customer, 'customerSend');
RCrmActions::apiMethod($api, 'customersEdit', __METHOD__, $customer, $site);
}

View File

@ -1 +1,3 @@
- Поддержка функции добавления одинакового товара в заказ как разные товарные позиции из CRM
- Исправление при обработке полученных изменений о контрагенте
- При обработки истории по клиентам добавлены кастомные поля
- Исправлены мелкие ошибки и недочеты

View File

@ -1,5 +1,5 @@
<?
$arModuleVersion = array(
"VERSION" => "2.5.2",
"VERSION_DATE" => "2019-09-17 15:20:00"
"VERSION" => "2.5.3",
"VERSION_DATE" => "2019-11-1 15:10:00"
);