diff --git a/CHANGELOG.md b/CHANGELOG.md index 46311689..0cf48e6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2024-09-23 v6.5.30 +- Добавлена передача контрагентов с типом ИП + ## 2024-09-19 v6.5.29 - Исправлена подписка модуля на событие сохранения заказа diff --git a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php index 7a916ef3..94667460 100644 --- a/intaro.retailcrm/classes/general/events/RetailCrmEvent.php +++ b/intaro.retailcrm/classes/general/events/RetailCrmEvent.php @@ -224,7 +224,7 @@ class RetailCrmEvent //TODO эта управляющая конструкция по функционалу дублирует RetailCrmOrder::createCustomerForOrder. // Необходимо устранить дублирование, вынеся логику в обособленный класс-сервис - if ('Y' === $optionCorpClient && $optionsContragentType[$arOrder['PERSON_TYPE_ID']] === 'legal-entity') { + if ('Y' === $optionCorpClient && in_array($optionsContragentType[$arOrder['PERSON_TYPE_ID']], ['legal-entity', 'enterpreneur'])) { //corparate cliente $nickName = ''; $address = ''; diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index 7f413c74..b2cdc67a 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -672,7 +672,7 @@ class RetailCrmHistory $personType = $newOrder->getField('PERSON_TYPE_ID'); if (RetailCrmOrder::isOrderCorporate($order) - || (!empty($order['contragentType']) && $order['contragentType'] == 'legal-entity') + || (!empty($order['contragentType']) && in_array($order['contragentType'], ['legal-entity', 'enterpreneur'])) ) { $personType = $contragentTypes['legal-entity']; $newOrder->setField('PERSON_TYPE_ID', $personType); diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php index 25893ea0..fbf4dfa4 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php @@ -714,7 +714,7 @@ class RetailCrmOrder if ( 'Y' === RetailcrmConfigProvider::getCorporateClientStatus() - && $optionsContragentType[$order['PERSON_TYPE_ID']] === 'legal-entity' + && in_array($optionsContragentType[$order['PERSON_TYPE_ID']], ['legal-entity', 'enterpreneur']) ) { // TODO check if order is corporate, and if it IS - make corporate order $arCustomer = RetailCrmUser::customerSend( @@ -728,7 +728,7 @@ class RetailCrmOrder $arCustomerCorporate = RetailCrmCorporateClient::clientSend( $order, $api, - 'legal-entity', + $optionsContragentType[$order['PERSON_TYPE_ID']], false, true, $site @@ -774,7 +774,7 @@ class RetailCrmOrder if ( isset($orderData['contragent']['contragentType']) - && $orderData['contragent']['contragentType'] === 'legal-entity' + && in_array($orderData['contragent']['contragentType'], ['legal-entity', 'enterpreneur']) && !empty($customerLegalName) ) { if (isset($cachedCorporateIds[$customerLegalName])) { diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 583cbb21..9cfe9edd 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Исправлена подписка модуля на событие сохранения заказа при установке +- Добавлена передача контрагентов с типом ИП diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 7ad9654f..3b3c1356 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.5.29', - 'VERSION_DATE' => '2024-09-19 15:00:00' + 'VERSION' => '6.5.30', + 'VERSION_DATE' => '2024-09-23 15:00:00' ];