Added contact data to citycom service order
This commit is contained in:
@@ -89,6 +89,11 @@ class Citycom_OanApiHelper {
|
||||
$product_name = $data["product_name"];
|
||||
$execution_date = $data["execution_date"];
|
||||
$want_services = $data["services"];
|
||||
$company = $data["company"];
|
||||
$firstname = $data["firstname"];
|
||||
$lastname = $data["lastname"];
|
||||
$phone = $data["phone"];
|
||||
$mobile = $data["mobile"];
|
||||
|
||||
if(!$execution_date) {
|
||||
$execution_date = date("Y-m-d");
|
||||
@@ -189,6 +194,11 @@ class Citycom_OanApiHelper {
|
||||
"product" => $product_id,
|
||||
"billing_date" => $execution_date,
|
||||
"ctag" => $ctag,
|
||||
"company" => $company,
|
||||
"firstname" => $firstname,
|
||||
"lastname" => $lastname,
|
||||
"phone" => $phone,
|
||||
"mobile" => $mobile,
|
||||
];
|
||||
|
||||
//echo "Creating Service ".$stype->name." on sublocation $sublocation_id with product_id $product_id and ctag $ctag\n";
|
||||
@@ -260,8 +270,8 @@ class Citycom_OanApiHelper {
|
||||
/**
|
||||
* Updates service values if nesseccary
|
||||
*
|
||||
* @param $service_ext_num
|
||||
* @param $data
|
||||
* @param string $service_ext_num
|
||||
* @param array $data
|
||||
* @return bool
|
||||
*/
|
||||
public function updateService($service_ext_id, $data) {
|
||||
@@ -301,6 +311,13 @@ class Citycom_OanApiHelper {
|
||||
$service_data["product"] = $product_id;
|
||||
}
|
||||
|
||||
// update contact data
|
||||
foreach(["company", "firstname", "lastname", "phone"] as $field) {
|
||||
if(array_key_exists($field, $data) && $data[$field] && $service->$field != $data[$field]) {
|
||||
$service_data[$field] = $data[$field];
|
||||
}
|
||||
}
|
||||
|
||||
if(!count($service_data)) return true;
|
||||
$result = $this->api->updateService($service->id, $service_data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user