Added contact data to citycom service order

This commit is contained in:
Frank Schubert
2026-02-11 14:05:18 +01:00
parent f791e02ded
commit 4b72e3a678
3 changed files with 29 additions and 2 deletions

View File

@@ -170,6 +170,11 @@ class SnoppCitycom extends Modules\ApiControllerModule
$data["up"] = $bb_up;
$data["down"] = $bb_down;
$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") {
$data["product_name"] = "Estmk Greenstream OAN $bb_down/$bb_up";

View File

@@ -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);

View File

@@ -49,6 +49,11 @@ foreach(PreordercampaignModel::search(["fulfillment" => "citycom_oan"]) as $camp
"up" => 100,
"product_name" => "Estmk Greenstream OAN Default",
"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);