1
0
mirror of synced 2024-11-28 16:26:07 +03:00

ref #87457 generate password corporate client and checking emptines user in order (#271)

This commit is contained in:
Kocmonavtik 2023-01-09 12:18:37 +03:00 committed by GitHub
parent e046a1d6f1
commit be5d7ba33e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 3 deletions

View File

@ -1,3 +1,7 @@
## 2022-12-28 v.6.1.12
- Исправление генерации пароля у корпоративного клиента
- Добавлена проверка на существование пользователя в заказе
## 2022-12-13 v.6.1.11 ## 2022-12-13 v.6.1.11
- Добавление фильтрации не активных справочников и статусов - Добавление фильтрации не активных справочников и статусов

View File

@ -335,6 +335,7 @@ class RetailCrmHistory
->setContragentTypes($contragentTypes) ->setContragentTypes($contragentTypes)
->setDataCrm($order) ->setDataCrm($order)
->build(); ->build();
$corporateCustomerBuilder->getCustomerBuilder()->buildPassword();
if (RetailCrmOrder::isOrderCorporate($order)) { if (RetailCrmOrder::isOrderCorporate($order)) {
// Fetch contact only if we think it's data is not fully present in order // Fetch contact only if we think it's data is not fully present in order

View File

@ -495,6 +495,16 @@ class RetailCrmOrder
continue; continue;
} }
if (empty($order['USER_ID'])) {
RCrmActions::eventLog(
'RetailCrmOrder::uploadOrders',
'Order::load',
'The user does not exist in order: ' . $order['ID']
);
continue;
}
self::createCustomerForOrder($api, $arCustomer, $arCustomerCorporate,$arParams, $order, $site); self::createCustomerForOrder($api, $arCustomer, $arCustomerCorporate,$arParams, $order, $site);
if (isset($order['RESPONSIBLE_ID']) && !empty($order['RESPONSIBLE_ID'])) { if (isset($order['RESPONSIBLE_ID']) && !empty($order['RESPONSIBLE_ID'])) {
@ -584,6 +594,16 @@ class RetailCrmOrder
$optionsContragentType = RetailcrmConfigProvider::getContragentTypes(); $optionsContragentType = RetailcrmConfigProvider::getContragentTypes();
$user = UserTable::getById($order['USER_ID'])->fetch(); $user = UserTable::getById($order['USER_ID'])->fetch();
if (!$user) {
RCrmActions::eventLog(
'RetailCrmOrder::createCustomerForOrder',
'UserTable::getById',
'Error find user: ' . $order['USER_ID'] . ' in order: ' . $order['ID']
);
return;
}
if ('Y' === RetailcrmConfigProvider::getCorporateClientStatus()) { if ('Y' === RetailcrmConfigProvider::getCorporateClientStatus()) {
if (true === RetailCrmCorporateClient::isCorpTookExternalId((string) $user['ID'], $api)) { if (true === RetailCrmCorporateClient::isCorpTookExternalId((string) $user['ID'], $api)) {
RetailCrmCorporateClient::setPrefixForExternalId((string) $user['ID'], $api); RetailCrmCorporateClient::setPrefixForExternalId((string) $user['ID'], $api);

View File

@ -1 +1 @@
- Исправление вывода значений в блоках маппинга (добавление фильтрации по активности поля) - Исправление генерации пароля у корпоративного клиента, проверка существования пользователя в заказе

View File

@ -1,6 +1,6 @@
<?php <?php
$arModuleVersion = [ $arModuleVersion = [
'VERSION' => '6.1.11', 'VERSION' => '6.1.12',
'VERSION_DATE' => '2022-12-13 12:30:00' 'VERSION_DATE' => '2022-12-28 17:30:00'
]; ];