1
0
mirror of synced 2024-11-25 14:56:09 +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
* Исправлена ошибка при обработке Ф.И.О.
* Исправлена ошибка с неверной кодировкой свойств

View File

@ -327,6 +327,8 @@ class RetailCrmHistory
}
}
$log->write($order, 'assemblyOrderHistory');
if (isset($order['deleted'])) {
continue;
}
@ -470,9 +472,9 @@ class RetailCrmHistory
if ($optionsPayStatuses[$order['status']]) {
$newOrder->setField('STATUS_ID', $optionsPayStatuses[$order['status']]);
if (in_array($optionsPayStatuses[$order['status']], $optionsCanselOrder)) {
$newOrder->setField('CANCELED', 'Y');
$newOrder->setFieldNoDemand('CANCELED', 'Y');
} else {
$newOrder->setField('CANCELED', 'N');
$newOrder->setFieldNoDemand('CANCELED', 'N');
}
}
@ -520,7 +522,10 @@ class RetailCrmHistory
$fio = '';
foreach ($propertyCollectionArr['properties'] as $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;
}
public static function setProp($obj, $value, $prop)
public static function setProp($obj, $value = '', $prop)
{
if (!isset($obj)) {
return false;
}
if ($prop && $value) {
if ($prop) {
$obj->setField($prop, $value);
} elseif ($value) {
$obj->setValue($value);

View File

@ -83,12 +83,13 @@ class RetailCrmOrder
$order[$search] = $prop['VALUE'][0];//телефон и почта
}
} 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();
$location = \Bitrix\Sale\Location\Name\LocationTable::getList(array(
'filter' => array('=LOCATION_ID' => $arLoc['CITY_ID'], 'LANGUAGE_ID'=>'ru')
))->fetch();
if ($arLoc) {
$location = \Bitrix\Sale\Location\Name\LocationTable::getList(array(
'filter' => array('=LOCATION_ID' => $arLoc['CITY_ID'], 'LANGUAGE_ID' => 'ru')
))->fetch();
}
$prop['VALUE'][0] = $location['NAME'];
}
@ -100,7 +101,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'])) {
if (isset($arFields['DELIVERYS'][0]['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(
"VERSION" => "2.0.4",
"VERSION_DATE" => "2016-10-06 18:00:00"
"VERSION" => "2.0.6",
"VERSION_DATE" => "2016-10-14 18:00:00"
);