ref #87457 generate password corporate client and checking emptines customer in order
This commit is contained in:
parent
e046a1d6f1
commit
cfcfb75ecf
2 changed files with 20 additions and 3 deletions
|
@ -335,6 +335,7 @@ class RetailCrmHistory
|
|||
->setContragentTypes($contragentTypes)
|
||||
->setDataCrm($order)
|
||||
->build();
|
||||
$corporateCustomerBuilder->getCustomerBuilder()->buildPassword();
|
||||
|
||||
if (RetailCrmOrder::isOrderCorporate($order)) {
|
||||
// Fetch contact only if we think it's data is not fully present in order
|
||||
|
|
|
@ -495,7 +495,19 @@ class RetailCrmOrder
|
|||
continue;
|
||||
}
|
||||
|
||||
self::createCustomerForOrder($api, $arCustomer, $arCustomerCorporate,$arParams, $order, $site);
|
||||
$user = UserTable::getById($order['USER_ID'])->fetch();
|
||||
|
||||
if (!$user) {
|
||||
RCrmActions::eventLog(
|
||||
'RetailCrmOrder::uploadOrders',
|
||||
'UserTable::getById',
|
||||
'Error find user: ' . $order['USER_ID'] . ' in order: ' . $order['ID']
|
||||
);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
self::createCustomerForOrder($api, $arCustomer, $arCustomerCorporate,$arParams, $order, $site, $user);
|
||||
|
||||
if (isset($order['RESPONSIBLE_ID']) && !empty($order['RESPONSIBLE_ID'])) {
|
||||
$managerService = ManagerService::getInstance();
|
||||
|
@ -579,10 +591,14 @@ class RetailCrmOrder
|
|||
array &$arCustomerCorporate,
|
||||
array &$arParams,
|
||||
array $order,
|
||||
$site
|
||||
$site,
|
||||
array $user = null
|
||||
): void {
|
||||
$optionsContragentType = RetailcrmConfigProvider::getContragentTypes();
|
||||
$user = UserTable::getById($order['USER_ID'])->fetch();
|
||||
|
||||
if (empty($user)) {
|
||||
$user = UserTable::getById($order['USER_ID'])->fetch();
|
||||
}
|
||||
|
||||
if ('Y' === RetailcrmConfigProvider::getCorporateClientStatus()) {
|
||||
if (true === RetailCrmCorporateClient::isCorpTookExternalId((string) $user['ID'], $api)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue