Commit 67da846b authored by Kulya's avatar Kulya 😊

Begin adding Client to Billz 8

parent ceca479e
...@@ -788,22 +788,25 @@ class AloVoiceRest ...@@ -788,22 +788,25 @@ class AloVoiceRest
$resCont = BxRest::call("crm.contact.get",[ "id" => $clientId ]); $resCont = BxRest::call("crm.contact.get",[ "id" => $clientId ]);
ALVC::eLog($resCont["result"],"------ Billz :: Client(contact) RES:"); ALVC::eLog($resCont["result"],"------ Billz :: Client(contact) RES:");
ALVC::eLog($resCont["PHONE"],"------ Billz :: Client PHONE:"); if(empty($resCont["result"])){
ALVC::eLog((empty($resCont["UF_CRM_1644411792448"])),"------ Billz :: Client(contact) CHECK:"); return false;
ALVC::eLog((!empty($resCont["PHONE"][0]["VALUE"])),"------ Billz :: Client(contact) CHECK 2:"); }
$contact = $resCont["result"];
if(empty($resCont["UF_CRM_1644411792448"]) && !empty($resCont["PHONE"][0]["VALUE"])){ if(empty($contact["UF_CRM_1644411792448"]) && !empty($contact["PHONE"][0]["VALUE"])){
$arClientParams = [ "phone" => $resCont["PHONE"][0]["VALUE"] ]; $arClientParams = [ "phone" => $contact["PHONE"][0]["VALUE"] ];
if(!empty( $resCont["NAME"] )){ if(!empty( $contact["NAME"] )){
$arClientParams['firstName'] = $resCont["NAME"]; $arClientParams['firstName'] = $contact["NAME"];
} }
if(!empty( $resCont["SECOND_NAME"] )){ if(!empty( $contact["SECOND_NAME"] )){
$arClientParams['lastName'] = $resCont["SECOND_NAME"]; $arClientParams['lastName'] = $contact["SECOND_NAME"];
} }
if(!empty( $resCont["BIRTHDATE"] )){ if(!empty( $contact["BIRTHDATE"] )){
$arClientParams['birthDate'] = $resCont["BIRTHDATE"]; $arClientParams['birthDate'] = $contact["BIRTHDATE"];
} }
ALVC::eLog($arClientParams,"------ Billz :: Client Add PARAMS:");
$clientAddRes = BillzRest::createOrder($arClientParams); $clientAddRes = BillzRest::createOrder($arClientParams);
ALVC::eLog($clientAddRes,"------ Billz :: Client Add RES:"); ALVC::eLog($clientAddRes,"------ Billz :: Client Add RES:");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment