Added contact data to citycom service order
This commit is contained in:
@@ -170,6 +170,11 @@ class SnoppCitycom extends Modules\ApiControllerModule
|
|||||||
$data["up"] = $bb_up;
|
$data["up"] = $bb_up;
|
||||||
$data["down"] = $bb_down;
|
$data["down"] = $bb_down;
|
||||||
$data["product_name"] = false;
|
$data["product_name"] = false;
|
||||||
|
$data["company"] = $preorder->company;
|
||||||
|
$data["firstname"] = $preorder->firstname;
|
||||||
|
$data["lastname"] = $preorder->lastname;
|
||||||
|
$data["phone"] = $preorder->phone;
|
||||||
|
$data["mobile"] = $preorder->mobile;
|
||||||
|
|
||||||
if($preorder->campaign->fulfillment == "citycom_oan") {
|
if($preorder->campaign->fulfillment == "citycom_oan") {
|
||||||
$data["product_name"] = "Estmk Greenstream OAN $bb_down/$bb_up";
|
$data["product_name"] = "Estmk Greenstream OAN $bb_down/$bb_up";
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ class Citycom_OanApiHelper {
|
|||||||
$product_name = $data["product_name"];
|
$product_name = $data["product_name"];
|
||||||
$execution_date = $data["execution_date"];
|
$execution_date = $data["execution_date"];
|
||||||
$want_services = $data["services"];
|
$want_services = $data["services"];
|
||||||
|
$company = $data["company"];
|
||||||
|
$firstname = $data["firstname"];
|
||||||
|
$lastname = $data["lastname"];
|
||||||
|
$phone = $data["phone"];
|
||||||
|
$mobile = $data["mobile"];
|
||||||
|
|
||||||
if(!$execution_date) {
|
if(!$execution_date) {
|
||||||
$execution_date = date("Y-m-d");
|
$execution_date = date("Y-m-d");
|
||||||
@@ -189,6 +194,11 @@ class Citycom_OanApiHelper {
|
|||||||
"product" => $product_id,
|
"product" => $product_id,
|
||||||
"billing_date" => $execution_date,
|
"billing_date" => $execution_date,
|
||||||
"ctag" => $ctag,
|
"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";
|
//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
|
* Updates service values if nesseccary
|
||||||
*
|
*
|
||||||
* @param $service_ext_num
|
* @param string $service_ext_num
|
||||||
* @param $data
|
* @param array $data
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function updateService($service_ext_id, $data) {
|
public function updateService($service_ext_id, $data) {
|
||||||
@@ -301,6 +311,13 @@ class Citycom_OanApiHelper {
|
|||||||
$service_data["product"] = $product_id;
|
$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;
|
if(!count($service_data)) return true;
|
||||||
$result = $this->api->updateService($service->id, $service_data);
|
$result = $this->api->updateService($service->id, $service_data);
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ foreach(PreordercampaignModel::search(["fulfillment" => "citycom_oan"]) as $camp
|
|||||||
"up" => 100,
|
"up" => 100,
|
||||||
"product_name" => "Estmk Greenstream OAN Default",
|
"product_name" => "Estmk Greenstream OAN Default",
|
||||||
"execution_date" => false,
|
"execution_date" => false,
|
||||||
|
"company" => $preorder->company,
|
||||||
|
"firstname" => $preorder->firstname,
|
||||||
|
"lastname" => $preorder->lastname,
|
||||||
|
"phone" => $preorder->phone,
|
||||||
|
"mobile" => $preorder->mobile,
|
||||||
];
|
];
|
||||||
|
|
||||||
$services_to_order = array_merge(CITYCOM_OAN_API_SERVICES_FOR_RESERVATION, CITYCOM_OAN_API_SERVICES_FOR_ORDER);
|
$services_to_order = array_merge(CITYCOM_OAN_API_SERVICES_FOR_RESERVATION, CITYCOM_OAN_API_SERVICES_FOR_ORDER);
|
||||||
|
|||||||
Reference in New Issue
Block a user