1
0
mirror of synced 2024-11-22 05:16:09 +03:00

Merge pull request #65 from Frosin/master

Fixed delivery service bug
This commit is contained in:
Alex Lushpai 2019-05-07 17:32:05 +03:00 committed by GitHub
commit 581b7de410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -606,7 +606,7 @@ class RetailCrmHistory
foreach ($optionsLegalDetails[$personType] as $key => $orderProp) {
if (array_key_exists($key, $order)) {
$somePropValue = $propertyCollection->getItemByOrderPropertyId($propsKey[$orderProp]['ID']);
self::setProp($somePropValue, $order[$key]);
self::setProp($somePropValue, RCrmActions::fromJSON($order[$key]));
}
}
}
@ -994,10 +994,15 @@ class RetailCrmHistory
if (isset($orderCrm['delivery']['service']['code'])) {
$deliveryCode = \Bitrix\Sale\Delivery\Services\Manager::getCodeById($deliveryId);
$serviceCode = $orderCrm['delivery']['service']['code'];
$services = \Bitrix\Sale\Delivery\Services\Manager::getService($deliveryId)->getProfilesList();
if (!array_key_exists($serviceCode, $services)) {
$serviceCode = strtoupper($serviceCode);
$serviceCode = str_replace(array('-'), "_", $serviceCode);
}
if ($deliveryCode) {
try {
$deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $orderCrm['delivery']['service']['code']);
$deliveryService = \Bitrix\Sale\Delivery\Services\Manager::getObjectByCode($deliveryCode . ':' . $serviceCode);
} catch (Bitrix\Main\SystemException $systemException) {
RCrmActions::eventLog('RetailCrmHistory::deliveryEdit', '\Bitrix\Sale\Delivery\Services\Manager::getObjectByCode', $systemException->getMessage());
}

View File

@ -740,7 +740,7 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/retailcrm/expor
BX(obj.id.replace('SKU','PRODUCT')).value = 'none';
var bid = obj.id.replace('SKU','PRODUCT');
$("#" + bid).siblings('#highloadblock').remove();
} else {
} else if(BX(obj.id.replace('PRODUCT','SKU'))) {
BX(obj.id.replace('PRODUCT','SKU')).value = 'none';
var bid = obj.id.replace('PRODUCT','SKU');
$("#" + bid).siblings('#highloadblock').remove();

View File

@ -595,7 +595,7 @@ if (!empty($oldValues)) {
BX(obj.id.replace('SKU','PRODUCT')).value = 'none';
var bid = obj.id.replace('SKU','PRODUCT');
$("#" + bid).siblings('#highloadblock').remove();
} else {
} else if(BX(obj.id.replace('PRODUCT','SKU'))){
BX(obj.id.replace('PRODUCT','SKU')).value = 'none';
var bid = obj.id.replace('PRODUCT','SKU');
$("#" + bid).siblings('#highloadblock').remove();