diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9296fbb1..113add5f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 2020-07-14 v.5.4.0
+* Добавлена поддержка функционала смены клиента
+
## 2020-05-04 v.5.3.2
* Исправлена кодировка в настройках модуля
diff --git a/intaro.retailcrm/classes/general/AbstractBuilder.php b/intaro.retailcrm/classes/general/AbstractBuilder.php
new file mode 100644
index 00000000..7dc7a063
--- /dev/null
+++ b/intaro.retailcrm/classes/general/AbstractBuilder.php
@@ -0,0 +1,61 @@
+dataCrm[$key]) && !empty($this->dataCrm[$key]) ? $this->dataCrm[$key] : $default;
+ }
+
+ /**
+ * @param array $array
+ * @param string $key
+ * @param mixed $default
+ * @return mixed|null
+ */
+ public function getValueArray($array, $key, $default = NULL)
+ {
+ return isset($this->dataCrm[$array][$key]) && !empty($this->dataCrm[$array][$key]) ? $this->dataCrm[$array][$key] : $default;
+ }
+
+ /**
+ * @param array $array
+ * @param array $symbols
+ * @return array
+ */
+ public function arrayClear(array $array, array $symbols = array('', 0, null))
+ {
+ return array_diff($array, $symbols);
+ }
+
+ /**
+ * @param $data
+ * @return array
+ */
+ public function objectToArray($data)
+ {
+ return $this->arrayClear(json_decode(json_encode($data), true));
+ }
+
+ /**
+ *
+ * @param string|array|\SplFixedArray $str in utf-8
+ *
+ * @return array|bool|\SplFixedArray|string $str in SITE_CHARSET
+ * @global $APPLICATION
+ */
+ public function fromJSON($str)
+ {
+ global $APPLICATION;
+
+ return $APPLICATION->ConvertCharset($str, 'utf-8', SITE_CHARSET);
+ }
+}
diff --git a/intaro.retailcrm/classes/general/AddressBuilder.php b/intaro.retailcrm/classes/general/AddressBuilder.php
new file mode 100644
index 00000000..ebc1b269
--- /dev/null
+++ b/intaro.retailcrm/classes/general/AddressBuilder.php
@@ -0,0 +1,70 @@
+customerAddress = new CustomerAddress();
+ }
+
+ /**
+ * @param array $dataCrm
+ * @return $this|RetailcrmBuilderInterface
+ */
+ public function setDataCrm($dataCrm)
+ {
+ $this->dataCrm = $dataCrm;
+ return $this;
+ }
+
+ /**
+ * @param $data
+ * @return $this
+ */
+ public function setCustomerAddress($data)
+ {
+ $this->customerAddress = $data;
+ return $this;
+ }
+
+ /**
+ * @return CustomerAddress
+ */
+ public function getCustomerAddress()
+ {
+ return $this->customerAddress;
+ }
+
+ public function build()
+ {
+ $this->customerAddress->setText($this->getValue('text'))
+ ->setNotes($this->getValue('notes'))
+ ->setBuilding($this->getValue('building'))
+ ->setBlock($this->getValue('block'))
+ ->setCity($this->getValue('city'))
+ ->setFlat($this->getValue('flat'))
+ ->setHouse($this->getValue('house'))
+ ->setFloor($this->getValue('floor'))
+ ->setCountry($this->getValue('countryIso'))
+ ->setIndex($this->getValue('index'))
+ ->setIntercomCode($this->getValue('intercomCode'))
+ ->setMetro($this->getValue('metro'))
+ ->setRegion($this->getValue('region'))
+ ->setStreet($this->getValue('street'));
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/CorporateCustomerBuilder.php b/intaro.retailcrm/classes/general/CorporateCustomerBuilder.php
new file mode 100644
index 00000000..3176a01d
--- /dev/null
+++ b/intaro.retailcrm/classes/general/CorporateCustomerBuilder.php
@@ -0,0 +1,260 @@
+customer = new Customer();
+ $this->customerBuilder = new CustomerBuilder();
+ $this->customerAddress = new CustomerAddress();
+ $this->buyerProfile = new BuyerProfile();
+ $this->addressBuilder = new AddressBuilder();
+ }
+
+ /**
+ * @param Customer $customer
+ * @return $this
+ */
+ public function setCustomer($customer)
+ {
+ $this->customer = $customer;
+ return $this;
+ }
+
+ /**
+ * @return Customer
+ */
+ public function getCustomer()
+ {
+ return $this->customer;
+ }
+
+ /**
+ * @param CustomerBuilder $customerBuilder
+ * @return $this
+ */
+ public function setCustomerBuilder($customerBuilder)
+ {
+ $this->$customerBuilder = $customerBuilder;
+ return $this;
+ }
+
+ /**
+ * @return CustomerBuilder
+ */
+ public function getCustomerBuilder()
+ {
+ return $this->customerBuilder;
+ }
+
+ /**
+ * @param CustomerAddress $customerAddress
+ * @return $this
+ */
+ public function setCustomerAddress($customerAddress)
+ {
+ $this->customerAddress = $customerAddress;
+ return $this;
+ }
+
+ /**
+ * @return CustomerAddress
+ */
+ public function getCustomerAddress()
+ {
+ return $this->customerAddress;
+ }
+
+ /**
+ * @param array $dataCrm
+ * @return $this
+ */
+ public function setDataCrm($dataCrm)
+ {
+ $this->dataCrm = $dataCrm;
+ return $this;
+ }
+
+ /**
+ * @param int $registeredUserID
+ * @return $this
+ */
+ public function setRegisteredUserID($registeredUserID)
+ {
+ $this->registeredUserID = $registeredUserID;
+ return $this;
+ }
+
+ /**
+ * @return bool
+ */
+ public function getRegisterNewUser()
+ {
+ return $this->registerNewUser;
+ }
+
+ /**
+ * @return int
+ */
+ public function getRegisteredUserID()
+ {
+ return $this->registeredUserID;
+ }
+
+ /**
+ * @param int $data
+ * @return $this
+ */
+ public function setOrderCustomerExtId($data)
+ {
+ $this->orderCustomerExtId = $data;
+
+ return $this;
+ }
+
+ /**
+ * @return int
+ */
+ public function getOrderCustomerExtId()
+ {
+ return $this->orderCustomerExtId;
+ }
+
+ /**
+ * @param array $data
+ * @return $this
+ */
+ public function setCorporateContact($data)
+ {
+ $this->corporateContact = $data;
+
+ return $this;
+ }
+
+ /**
+ * @return array
+ */
+ public function getCorporateContact()
+ {
+ return $this->corporateContact;
+ }
+
+ /**
+ * @return BuyerProfile
+ */
+ public function getBuyerProfile()
+ {
+ return $this->buyerProfile;
+ }
+
+ /**
+ * @param array $contragentTypes
+ * @return $this
+ */
+ public function setContragentTypes($contragentTypes)
+ {
+ $this->contragentTypes = $contragentTypes;
+
+ return $this;
+ }
+
+ public function build()
+ {
+ if (isset($this->dataCrm['contact'])) {
+ $this->customerBuilder->setDataCrm($this->dataCrm['contact'])->build();
+ $this->corporateContact = $this->customerBuilder->getCustomer();
+ $this->customer = $this->customerBuilder->getCustomer();
+ } else {
+ $this->corporateContact = null;
+ $this->customer = null;
+ }
+
+ if (isset($this->dataCrm['company']['address'])) {
+ $this->buildAddress();
+ }
+
+ if (isset($this->dataCrm['company'])) {
+ $this->buildBuyerProfile();
+ }
+ }
+
+ public function buildBuyerProfile()
+ {
+ if (RetailCrmOrder::isOrderCorporate($this->dataCrm) && !empty($this->dataCrm['company'])) {
+ $this->buyerProfile->setName($this->dataCrm['company']['name'])
+ ->setUserId($this->dataCrm['contact']['externalId'])
+ ->setPersonTypeId($this->contragentTypes['legal-entity']);
+ }
+ }
+
+ public function buildAddress()
+ {
+ if (isset($this->dataCrm['company']['address'])) {
+ $this->addressBuilder->setDataCrm($this->dataCrm['company']['address'])->build();
+ $this->customerAddress = $this->addressBuilder->getCustomerAddress();
+ } else {
+ $this->customerAddress = null;
+ }
+ }
+
+ /**
+ * @param string $login
+ * @return $this
+ */
+ public function setLogin($login)
+ {
+ $this->customerBuilder->setLogin($login);
+
+ return $this;
+ }
+
+ /**
+ * @param string $email
+ * @return $this
+ */
+ public function setEmail($email)
+ {
+ $this->customerBuilder->setEmail($email);
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/CustomerBuilder.php b/intaro.retailcrm/classes/general/CustomerBuilder.php
new file mode 100644
index 00000000..1f3b5031
--- /dev/null
+++ b/intaro.retailcrm/classes/general/CustomerBuilder.php
@@ -0,0 +1,238 @@
+customer = new Customer();
+ $this->customerAddress = new CustomerAddress();
+ $this->addressBuilder = new AddressBuilder();
+ }
+
+ /**
+ * @param Customer $customer
+ * @return $this
+ */
+ public function setCustomer($customer)
+ {
+ $this->customer = $customer;
+ return $this;
+ }
+
+ /**
+ * @return Customer
+ */
+ public function getCustomer()
+ {
+ return $this->customer;
+ }
+
+ /**
+ * @param CustomerAddress $customerAddress
+ * @return $this
+ */
+ public function setCustomerAddress($customerAddress)
+ {
+ $this->customerAddress = $customerAddress;
+ return $this;
+ }
+
+ /**
+ * @return CustomerAddress
+ */
+ public function getCustomerAddress()
+ {
+ return $this->customerAddress;
+ }
+
+ /**
+ * @param array $dataCrm
+ * @return $this
+ */
+ public function setDataCrm($dataCrm)
+ {
+ $this->dataCrm = $dataCrm;
+ return $this;
+ }
+
+ /**
+ * @param array $user
+ * @return $this
+ */
+ public function setUser($user)
+ {
+ $this->user = $user;
+ return $this;
+ }
+
+ /**
+ * @param int $registeredUserID
+ * @return $this
+ */
+ public function setRegisteredUserID($registeredUserID)
+ {
+ $this->registeredUserID = $registeredUserID;
+ return $this;
+ }
+
+ /**
+ * @return int
+ */
+ public function getRegisteredUserID()
+ {
+ return $this->registeredUserID;
+ }
+
+ /**
+ * @return bool
+ */
+ public function getRegisterNewUser()
+ {
+ return $this->registerNewUser;
+ }
+
+ public function build()
+ {
+ if (!empty($this->dataCrm['firstName'])) {
+ $this->customer->setName($this->fromJSON($this->dataCrm['firstName']));
+ }
+
+ if (!empty($this->dataCrm['lastName'])) {
+ $this->customer->setLastName($this->fromJSON($this->dataCrm['lastName']));
+ }
+
+ if (!empty($this->dataCrm['patronymic'])) {
+ $this->customer->setSecondName($this->fromJSON($this->dataCrm['patronymic']));
+ }
+
+ if (isset($this->dataCrm['phones'])) {
+ foreach ($this->dataCrm['phones'] as $phone) {
+ if (isset($phone['old_number']) && in_array($phone['old_number'], $this->user)) {
+ $key = array_search($phone['old_number'], $this->user);
+
+ if (isset($phone['number'])) {
+ $this->user[$key] = $phone['number'];
+ } else {
+ $this->user[$key] = '';
+ }
+ }
+
+ if (isset($phone['number'])) {
+ if ((!isset($this->user['PERSONAL_PHONE']) || strlen($this->user['PERSONAL_PHONE']) == 0)
+ && $this->user['PERSONAL_MOBILE'] != $phone['number']
+ ) {
+ $this->customer->setPersonalPhone($phone['number']);
+ $this->user['PERSONAL_PHONE'] = $phone['number'];
+ continue;
+ }
+ if ((!isset($this->user['PERSONAL_MOBILE']) || strlen($this->user['PERSONAL_MOBILE']) == 0)
+ && $this->user['PERSONAL_PHONE'] != $phone['number']
+ ) {
+ $this->customer->setPersonalMobile($phone['number']);
+ $this->user['PERSONAL_MOBILE'] = $phone['number'];
+ continue;
+ }
+ }
+ }
+ }
+
+ if (!empty($this->dataCrm['address']['index'])) {
+ $this->customer->setPersonalZip($this->fromJSON($this->dataCrm['address']['index']));
+ }
+
+ if (!empty($this->dataCrm['address']['city'])) {
+ $this->customer->setPersonalCity($this->fromJSON($this->dataCrm['address']['city']));
+ }
+
+ if (!empty($this->dataCrm['birthday'])) {
+ $this->customer->setPersonalBirthday($this->fromJSON(
+ date("d.m.Y", strtotime($this->dataCrm['birthday']))
+ ));
+ }
+
+ if (!empty($this->dataCrm['email'])) {
+ $this->customer->setEmail($this->fromJSON($this->dataCrm['email']));
+ }
+
+ if (!empty($this->dataCrm['sex'])) {
+ $this->customer->setPersonalGender($this->fromJSON($this->dataCrm['sex']));
+ }
+
+ if (empty($this->dataCrm['externalId'])) {
+ $userPassword = uniqid("R");
+ $this->customer->setPassword($userPassword)
+ ->setConfirmPassword($userPassword);
+ }
+
+ if ((!isset($this->dataCrm['email']) || $this->dataCrm['email'] == '')
+ && (!isset($this->dataCrm['externalId']))
+ ) {
+ $login = uniqid('user_' . time()) . '@example.com';
+ $this->customer->setLogin($login)
+ ->setEmail($login);
+ }
+
+ if (isset($this->dataCrm['address'])) {
+ $this->buildAddress();
+ }
+ }
+
+ public function buildAddress()
+ {
+ if (isset($this->dataCrm['address'])) {
+ $this->addressBuilder->setDataCrm($this->dataCrm['address'])->build();
+ $this->customerAddress = $this->addressBuilder->getCustomerAddress();
+ } else {
+ $this->customerAddress = null;
+ }
+ }
+
+ /**
+ * @param string $login
+ * @return $this
+ */
+ public function setLogin($login)
+ {
+ $this->customer->setLogin($login);
+
+ return $this;
+ }
+
+ /**
+ * @param string $email
+ * @return $this
+ */
+ public function setEmail($email)
+ {
+ $this->customer->setEmail($email);
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/Model/BaseModel.php b/intaro.retailcrm/classes/general/Model/BaseModel.php
new file mode 100644
index 00000000..da0a0ce4
--- /dev/null
+++ b/intaro.retailcrm/classes/general/Model/BaseModel.php
@@ -0,0 +1,38 @@
+arrayClear(call_user_func('get_object_vars', $this));
+ }
+
+ /**
+ * @param array $array
+ * @param array $symbols
+ * @return array
+ */
+ public function arrayClear(array $array, array $symbols = array('', 0, null))
+ {
+ return array_diff($array, $symbols);
+ }
+
+ /**
+ * @param $array
+ * @return $this
+ */
+ public function getArrayToObject($array)
+ {
+ foreach ($array as $key => $value) {
+ $this->$key = $value;
+ }
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/Model/BuyerProfile.php b/intaro.retailcrm/classes/general/Model/BuyerProfile.php
new file mode 100644
index 00000000..9c01fb77
--- /dev/null
+++ b/intaro.retailcrm/classes/general/Model/BuyerProfile.php
@@ -0,0 +1,48 @@
+NAME = $NAME;
+
+ return $this;
+ }
+
+ /**
+ * @param int $USER_ID
+ * @return $this
+ */
+ public function setUserId($USER_ID)
+ {
+ $this->USER_ID = $USER_ID;
+
+ return $this;
+ }
+
+ /**
+ * @param int $PERSON_TYPE_ID
+ * @return $this
+ */
+ public function setPersonTypeId($PERSON_TYPE_ID)
+ {
+ $this->PERSON_TYPE_ID = $PERSON_TYPE_ID;
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/Model/Customer.php b/intaro.retailcrm/classes/general/Model/Customer.php
new file mode 100644
index 00000000..d569f77e
--- /dev/null
+++ b/intaro.retailcrm/classes/general/Model/Customer.php
@@ -0,0 +1,202 @@
+EMAIL = $EMAIL;
+
+ return $this;
+ }
+
+ /**
+ * @param string $LOGIN
+ * @return $this
+ */
+ public function setLogin($LOGIN)
+ {
+ $this->LOGIN = $LOGIN;
+
+ return $this;
+ }
+
+ /**
+ * @param string $ACTIVE
+ * @return $this
+ */
+ public function setActive($ACTIVE)
+ {
+ $this->ACTIVE = $ACTIVE;
+
+ return $this;
+ }
+
+ /**
+ * @param string $PASSWORD
+ * @return $this
+ */
+ public function setPassword($PASSWORD)
+ {
+ $this->PASSWORD = $PASSWORD;
+
+ return $this;
+ }
+
+ /**
+ * @param string $CONFIRM_PASSWORD
+ * @return $this
+ */
+ public function setConfirmPassword($CONFIRM_PASSWORD)
+ {
+ $this->CONFIRM_PASSWORD = $CONFIRM_PASSWORD;
+
+ return $this;
+ }
+
+ /**
+ * @param string $NAME
+ * @return $this
+ */
+ public function setName($NAME)
+ {
+ $this->NAME = $NAME;
+
+ return $this;
+ }
+
+ /**
+ * @param string $LAST_NAME
+ * @return $this
+ */
+ public function setLastName($LAST_NAME)
+ {
+ $this->LAST_NAME = $LAST_NAME;
+
+ return $this;
+ }
+
+ /**
+ * @param string $SECOND_NAME
+ * @return $this
+ */
+ public function setSecondName($SECOND_NAME)
+ {
+ $this->SECOND_NAME = $SECOND_NAME;
+
+ return $this;
+ }
+
+ /**
+ * @param string $PERSONAL_MOBILE
+ * @return $this
+ */
+ public function setPersonalMobile($PERSONAL_MOBILE)
+ {
+ $this->PERSONAL_MOBILE = $PERSONAL_MOBILE;
+
+ return $this;
+ }
+
+ /**
+ * @param string $PERSONAL_PHONE
+ * @return $this
+ */
+ public function setPersonalPhone($PERSONAL_PHONE)
+ {
+ $this->PERSONAL_PHONE = $PERSONAL_PHONE;
+
+ return $this;
+ }
+
+ /**
+ * @param string $PERSONAL_ZIP
+ * @return $this
+ */
+ public function setPersonalZip($PERSONAL_ZIP)
+ {
+ $this->PERSONAL_ZIP = $PERSONAL_ZIP;
+
+ return $this;
+ }
+
+ /**
+ * @param string $PERSONAL_CITY
+ * @return $this
+ */
+ public function setPersonalCity($PERSONAL_CITY)
+ {
+ $this->PERSONAL_CITY = $PERSONAL_CITY;
+
+ return $this;
+ }
+
+ /**
+ * @param string $PERSONAL_BIRTHDAY
+ * @return $this
+ */
+ public function setPersonalBirthday($PERSONAL_BIRTHDAY)
+ {
+ $this->PERSONAL_BIRTHDAY = $PERSONAL_BIRTHDAY;
+
+ return $this;
+ }
+
+ /**
+ * @param string $PERSONAL_GENDER
+ * @return $this
+ */
+ public function setPersonalGender($PERSONAL_GENDER)
+ {
+ $this->PERSONAL_GENDER = $PERSONAL_GENDER;
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/Model/CustomerAddress.php b/intaro.retailcrm/classes/general/Model/CustomerAddress.php
new file mode 100644
index 00000000..c229091d
--- /dev/null
+++ b/intaro.retailcrm/classes/general/Model/CustomerAddress.php
@@ -0,0 +1,202 @@
+index = $index;
+
+ return $this;
+ }
+
+ /**
+ * @param string $country
+ * @return $this
+ */
+ public function setCountry($country)
+ {
+ $this->country = $country;
+
+ return $this;
+ }
+
+ /**
+ * @param string $region
+ * @return $this
+ */
+ public function setRegion($region)
+ {
+ $this->region = $region;
+
+ return $this;
+ }
+
+ /**
+ * @param string $city
+ * @return $this
+ */
+ public function setCity($city)
+ {
+ $this->city = $city;
+
+ return $this;
+ }
+
+ /**
+ * @param string $street
+ * @return $this
+ */
+ public function setStreet($street)
+ {
+ $this->street = $street;
+
+ return $this;
+ }
+
+ /**
+ * @param string $building
+ * @return $this
+ */
+ public function setBuilding($building)
+ {
+ $this->building = $building;
+
+ return $this;
+ }
+
+ /**
+ * @param string $house
+ * @return $this
+ */
+ public function setHouse($house)
+ {
+ $this->house = $house;
+
+ return $this;
+ }
+
+ /**
+ * @param string $block
+ * @return $this
+ */
+ public function setBlock($block)
+ {
+ $this->block = $block;
+
+ return $this;
+ }
+
+ /**
+ * @param string $flat
+ * @return $this
+ */
+ public function setFlat($flat)
+ {
+ $this->flat = $flat;
+
+ return $this;
+ }
+
+ /**
+ * @param string $floor
+ * @return $this
+ */
+ public function setFloor($floor)
+ {
+ $this->floor = $floor;
+
+ return $this;
+ }
+
+ /**
+ * @param string $intercomCode
+ * @return $this
+ */
+ public function setIntercomCode($intercomCode)
+ {
+ $this->intercomCode = $intercomCode;
+
+ return $this;
+ }
+
+ /**
+ * @param string $metro
+ * @return $this
+ */
+ public function setMetro($metro)
+ {
+ $this->metro = $metro;
+
+ return $this;
+ }
+
+ /**
+ * @param string $notes
+ * @return $this
+ */
+ public function setNotes($notes)
+ {
+ $this->notes = $notes;
+
+ return $this;
+ }
+
+ /**
+ * @param string $text
+ * @return $this
+ */
+ public function setText($text)
+ {
+ $this->text = $text;
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/Model/CustomerContragent.php b/intaro.retailcrm/classes/general/Model/CustomerContragent.php
new file mode 100644
index 00000000..ff213d09
--- /dev/null
+++ b/intaro.retailcrm/classes/general/Model/CustomerContragent.php
@@ -0,0 +1,132 @@
+contragentType = $contragentType;
+
+ return $this;
+ }
+
+ /**
+ * @param string $legalName
+ * @return $this
+ */
+ public function setLegalName($legalName)
+ {
+ $this->legalName = $legalName;
+
+ return $this;
+ }
+
+ /**
+ * @param string $legalAddress
+ * @return $this
+ */
+ public function setLegalAddress($legalAddress)
+ {
+ $this->legalAddress = $legalAddress;
+
+ return $this;
+ }
+
+ /**
+ * @param string $certificateNumber
+ * @return $this
+ */
+ public function setCertificateNumber($certificateNumber)
+ {
+ $this->certificateNumber = $certificateNumber;
+
+ return $this;
+ }
+
+ /**
+ * @param string $certificateDate
+ * @return $this
+ */
+ public function setCertificateDate($certificateDate)
+ {
+ $this->certificateDate = $certificateDate;
+
+ return $this;
+ }
+
+ /**
+ * @param string $bank
+ * @return $this
+ */
+ public function setBank($bank)
+ {
+ $this->bank = $bank;
+
+ return $this;
+ }
+
+ /**
+ * @param string $bankAddress
+ * @return $this
+ */
+ public function setBankAddress($bankAddress)
+ {
+ $this->bankAddress = $bankAddress;
+
+ return $this;
+ }
+
+ /**
+ * @param string $corrAccount
+ * @return $this
+ */
+ public function setCorrAccount($corrAccount)
+ {
+ $this->corrAccount = $corrAccount;
+
+ return $this;
+ }
+
+ /**
+ * @param string $bankAccount
+ * @return $this
+ */
+ public function setBankAccount($bankAccount)
+ {
+ $this->bankAccount = $bankAccount;
+
+ return $this;
+ }
+}
diff --git a/intaro.retailcrm/classes/general/RCrmActions.php b/intaro.retailcrm/classes/general/RCrmActions.php
index ace42c0c..450b8d7f 100644
--- a/intaro.retailcrm/classes/general/RCrmActions.php
+++ b/intaro.retailcrm/classes/general/RCrmActions.php
@@ -454,6 +454,8 @@ class RCrmActions
case 'customersEdit':
case 'customersСorporateGet':
return self::proxy($api, $methodApi, $method, array($params, 'externalId', $site));
+ case 'customersСorporateGetById':
+ return self::proxy($api, 'customersСorporateGet', $method, array($params, 'id', $site));
case 'customersGetById':
return self::proxy($api, 'customersGet', $method, array($params, 'id', $site));
diff --git a/intaro.retailcrm/classes/general/RetailcrmBuilderInterface.php b/intaro.retailcrm/classes/general/RetailcrmBuilderInterface.php
new file mode 100644
index 00000000..9757dbb6
--- /dev/null
+++ b/intaro.retailcrm/classes/general/RetailcrmBuilderInterface.php
@@ -0,0 +1,20 @@
+certificateDate