From 1d2a87f2774ac314c8134e45712dc47d27e67758 Mon Sep 17 00:00:00 2001 From: ellynoize <111681973+ellynoize@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:21:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=B3=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=20=D1=81=20=D1=82=D0=B8=D0=BF=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=98=D0=9F=20(#363)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ intaro.retailcrm/classes/general/events/RetailCrmEvent.php | 2 +- .../classes/general/history/RetailCrmHistory_v5.php | 2 +- .../classes/general/order/RetailCrmOrder_v5.php | 6 +++--- intaro.retailcrm/description.ru | 2 +- intaro.retailcrm/install/version.php | 4 ++-- 6 files changed, 11 insertions(+), 8 deletions(-) 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' ];