diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e3840bc..7fdea7f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-09-07 v.6.4.6 +- Исправлена передача ФИО покупателя в заказе + ## 2023-09-01 v.6.4.5 - Удалена поддержка API V4 diff --git a/helpers/installation/Installer.php b/helpers/installation/Installer.php index 7334b37f..b3694f1e 100644 --- a/helpers/installation/Installer.php +++ b/helpers/installation/Installer.php @@ -129,8 +129,8 @@ class Installer '__wiz_admin_password' => 'admin123', '__wiz_admin_password_confirm' => 'admin123', '__wiz_email' => 'admin@mail.com', - '__wiz_user_name' => '', - '__wiz_user_surname' => '', + '__wiz_user_name' => 'FirstName', + '__wiz_user_surname' => 'LastName', '__wiz_selected_wizard' => 'bitrix.eshop:bitrix:eshop', ); diff --git a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php index cf2335fa..d9e42b58 100644 --- a/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php +++ b/intaro.retailcrm/classes/general/order/RetailCrmOrder_v5.php @@ -422,6 +422,17 @@ class RetailCrmOrder // Check and set privilegeType $order['privilegeType'] = LoyaltyAccountService::getPrivilegeType($client, $arParams); + $arUser = UserTable::getById($arOrder['USER_ID'])->fetch(); + $fioCrm = [$order['firstName'] ?? null, $order['lastName'] ?? null, $order['patronymic'] ?? null]; + + if (in_array($arUser['NAME'], $fioCrm)) { + $order['firstName'] = $arUser['NAME']; + } + + if (in_array($arUser['LAST_NAME'], $fioCrm)) { + $order['lastName'] = $arUser['LAST_NAME']; + } + if ($send) { if ($methodApi === 'ordersCreate') { if (isset($arParams['customerCorporate']) && !empty($order['contact']['externalId'])) { diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index f2c60018..9b5f9018 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Удалена поддержка API V4 +- Исправлена передача ФИО покупателя в заказе diff --git a/intaro.retailcrm/install/export/local/components/intaro/lp.score/templates/.default/lang/ru/template.php b/intaro.retailcrm/install/export/local/components/intaro/lp.score/templates/.default/lang/ru/template.php index 9d3163fc..0369d29a 100644 --- a/intaro.retailcrm/install/export/local/components/intaro/lp.score/templates/.default/lang/ru/template.php +++ b/intaro.retailcrm/install/export/local/components/intaro/lp.score/templates/.default/lang/ru/template.php @@ -29,7 +29,7 @@ $MESS['CARD'] = 'Номер бонусной карты:'; $MESS['PHONE'] = 'Привязанный телефон:'; $MESS['REGISTER_DATE'] = 'Дата регистрации:'; $MESS['LOYALTY_LEVEL_TYPE'] = 'Правила текущего уровня:'; -$MESS['BONUS_PERCENT'] = 'кешбек от стоимости'; +$MESS['BONUS_PERCENT'] = 'кешбэк от стоимости'; $MESS['BONUS_CONVERTING'] = '1 бонус начисляется за каждые'; $MESS['PERSONAL_DISCOUNT'] = 'персональная скидка'; $MESS['EACH_RUB'] = 'рублей покупки'; diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 5d14bc99..33c9f4b0 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.4.5', - 'VERSION_DATE' => '2023-09-01 10:30:00' + 'VERSION' => '6.4.6', + 'VERSION_DATE' => '2023-09-07 16:30:00' ]; diff --git a/intaro.retailcrm/lib/model/api/loyaltylevel.php b/intaro.retailcrm/lib/model/api/loyaltylevel.php index 3badde19..4de8f8c7 100644 --- a/intaro.retailcrm/lib/model/api/loyaltylevel.php +++ b/intaro.retailcrm/lib/model/api/loyaltylevel.php @@ -46,7 +46,7 @@ class LoyaltyLevel * Тип уровня. * * Возможные значения: - * bonus_percent - кешбек от стоимости + * bonus_percent - кешбэк от стоимости * bonus_converting - Пример: начисление 1 бонус за каждые 10 рублей покупки * discount - скидочный уровень * diff --git a/tests/BitrixTestCase.php b/tests/BitrixTestCase.php index 53c43d56..5ae65904 100644 --- a/tests/BitrixTestCase.php +++ b/tests/BitrixTestCase.php @@ -47,7 +47,7 @@ class BitrixTestCase extends \PHPUnit\Framework\TestCase 'USER_DESCRIPTION' => 'userComment', 'COMMENTS' => 'managerComment', 'PRICE_DELIVERY' => '100', - 'PROPS' => ['properties' => []], + 'PROPS' => ['properties' => [['CODE' => 'FIO', 'VALUE' => ['FirstName LastName']]]], 'DELIVERYS' => [[ 'id' => 'test', 'service' => 'service' diff --git a/tests/classes/general/order/RetailCrmOrder_v5Test.php b/tests/classes/general/order/RetailCrmOrder_v5Test.php index d2212486..78d65795 100644 --- a/tests/classes/general/order/RetailCrmOrder_v5Test.php +++ b/tests/classes/general/order/RetailCrmOrder_v5Test.php @@ -102,6 +102,7 @@ class RetailCrmOrder_v5Test extends BitrixTestCase { 'optionsContragentType' => RetailcrmConfigProvider::getContragentTypes(), 'optionsDelivTypes' => RetailcrmConfigProvider::getDeliveryTypes(), 'optionsPayTypes' => RetailcrmConfigProvider::getPaymentTypes(), + 'optionsOrderProps' => ['bitrixType' => ['fio' => 'FIO']], 'optionsPayment' => ['Y' => 'paid'] ]; @@ -133,7 +134,9 @@ class RetailCrmOrder_v5Test extends BitrixTestCase { 'paidAt' => $this->getDateTime()->format('Y-m-d H:i:s') ]], 'privilegeType' => 'none', - 'statusComment' => $arFields['REASON_CANCELED'] + 'statusComment' => $arFields['REASON_CANCELED'], + 'firstName' => 'FirstName', + 'lastName' => 'LastName' ], ]]; }