1
0
mirror of synced 2024-11-22 21:36:10 +03:00
This commit is contained in:
Евгений Тыщицкий 2016-10-14 15:25:02 +03:00
parent 0b4c15d819
commit 1482c93cdc
5 changed files with 25 additions and 16 deletions

View File

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

View File

@ -327,6 +327,8 @@ class RetailCrmHistory
} }
} }
$log->write($order, 'assemblyOrderHistory');
if (isset($order['deleted'])) { if (isset($order['deleted'])) {
continue; continue;
} }
@ -470,9 +472,9 @@ class RetailCrmHistory
if ($optionsPayStatuses[$order['status']]) { if ($optionsPayStatuses[$order['status']]) {
$newOrder->setField('STATUS_ID', $optionsPayStatuses[$order['status']]); $newOrder->setField('STATUS_ID', $optionsPayStatuses[$order['status']]);
if (in_array($optionsPayStatuses[$order['status']], $optionsCanselOrder)) { if (in_array($optionsPayStatuses[$order['status']], $optionsCanselOrder)) {
$newOrder->setField('CANCELED', 'Y'); $newOrder->setFieldNoDemand('CANCELED', 'Y');
} else { } else {
$newOrder->setField('CANCELED', 'N'); $newOrder->setFieldNoDemand('CANCELED', 'N');
} }
} }
@ -520,7 +522,10 @@ class RetailCrmHistory
$fio = ''; $fio = '';
foreach ($propertyCollectionArr['properties'] as $prop) { foreach ($propertyCollectionArr['properties'] as $prop) {
if (in_array($optionsOrderProps[$personType]['fio'], $prop)) { if (in_array($optionsOrderProps[$personType]['fio'], $prop)) {
$fio = $newOrder->getPropertyCollection()->getItemByOrderPropertyId($prop['ID'])->getValue(); $getFio = $newOrder->getPropertyCollection()->getItemByOrderPropertyId($prop['ID']);
if (method_exists($getFio, 'getValue')) {
$fio = $getFio->getValue();
}
} }
} }
@ -1141,12 +1146,12 @@ class RetailCrmHistory
return $outputArray; return $outputArray;
} }
public static function setProp($obj, $value, $prop) public static function setProp($obj, $value = '', $prop)
{ {
if (!isset($obj)) { if (!isset($obj)) {
return false; return false;
} }
if ($prop && $value) { if ($prop) {
$obj->setField($prop, $value); $obj->setField($prop, $value);
} elseif ($value) { } elseif ($value) {
$obj->setValue($value); $obj->setValue($value);

View File

@ -83,12 +83,13 @@ class RetailCrmOrder
$order[$search] = $prop['VALUE'][0];//телефон и почта $order[$search] = $prop['VALUE'][0];//телефон и почта
} }
} else {//остальное - адрес } else {//остальное - адрес
if ($prop['TYPE'] == 'LOCATION') { if ($prop['TYPE'] == 'LOCATION' && isset($prop['VALUE'][0]) && $prop['VALUE'][0] != '') {
$arLoc = \Bitrix\Sale\Location\LocationTable::getByCode($prop['VALUE'][0])->fetch(); $arLoc = \Bitrix\Sale\Location\LocationTable::getByCode($prop['VALUE'][0])->fetch();
if ($arLoc) {
$location = \Bitrix\Sale\Location\Name\LocationTable::getList(array( $location = \Bitrix\Sale\Location\Name\LocationTable::getList(array(
'filter' => array('=LOCATION_ID' => $arLoc['CITY_ID'], 'LANGUAGE_ID' => 'ru') 'filter' => array('=LOCATION_ID' => $arLoc['CITY_ID'], 'LANGUAGE_ID' => 'ru')
))->fetch(); ))->fetch();
}
$prop['VALUE'][0] = $location['NAME']; $prop['VALUE'][0] = $location['NAME'];
} }
@ -100,7 +101,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'])) { if (isset($arFields['DELIVERYS'][0]['service']) && $arFields['DELIVERYS'][0]['service'] != '') {
$order['delivery']['service'] = $arFields['DELIVERYS'][0]['service']; $order['delivery']['service'] = $arFields['DELIVERYS'][0]['service'];
} }
} }

View File

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

View File

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