Commit 4ae6225f authored by Kulya's avatar Kulya 😊

Begin adding Client to Billz 4

parent 5e9295eb
...@@ -787,11 +787,23 @@ class AloVoiceRest ...@@ -787,11 +787,23 @@ 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:");
if(!empty($resCont["UF_CRM_1644411792448"])){ if(empty($resCont["UF_CRM_1644411792448"]) && !empty($resCont["PHONE"][0]["VALUE"])){
$arClientParams = [ "phone" => $resCont["PHONE"][0]["VALUE"] ];
if(!empty( $resCont["NAME"] )){
$arClientParams['firstName'] = $resCont["NAME"];
}
if(!empty( $resCont["SECOND_NAME"] )){
$arClientParams['lastName'] = $resCont["SECOND_NAME"];
}
if(!empty( $resCont["BIRTHDATE"] )){
$arClientParams['birthDate'] = $resCont["BIRTHDATE"];
}
$clientAddRes = BillzRest::createOrder($arClientParams);
ALVC::eLog($clientAddRes,"------ Billz :: Client Add RES:");
} }
} }
//
} }
private function get_bx_order_products($id=false) { private function get_bx_order_products($id=false) {
......
...@@ -47,11 +47,8 @@ require_once (__DIR__.'/keys.php'); ...@@ -47,11 +47,8 @@ require_once (__DIR__.'/keys.php');
"id": "1200" "id": "1200"
} }
*/ */
$client_params = [ "firstName" => (!empty($params["NAME"])) ? $params["NAME"] : "New Client"]; $result = static::callCurl("client.create",$params);
// if(!empty())
$result = static::callCurl("client.create",$client_params);
return $result; return $result;
} }
......
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