citycom oan: Fixed setting billing_date on CC service create and update

This commit is contained in:
Frank Schubert
2026-02-12 14:45:27 +01:00
parent 3f67d28a53
commit ec30f47816
3 changed files with 13 additions and 8 deletions

View File

@@ -299,6 +299,8 @@ class Citycom_OanApiHelper {
$service_data = [];
//var_dump($service);exit;
// update service if nesseccary
if(array_key_exists("product_name", $data) && $data["product_name"] && $service->product->name != $data["product_name"]) {
$product_data["up"] = $data["up"];
@@ -314,7 +316,7 @@ class Citycom_OanApiHelper {
}
// update contact data
foreach(["company", "firstname", "lastname", "phone"] as $field) {
foreach(["company", "firstname", "lastname", "phone", "billing_date"] as $field) {
if(array_key_exists($field, $data) && $data[$field] && $service->$field != $data[$field]) {
$service_data[$field] = $data[$field];
}
@@ -322,8 +324,9 @@ class Citycom_OanApiHelper {
if(!count($service_data)) return true;
$result = $this->api->updateService($service->id, $service_data);
if($result) return true;
$this->log->warning(__METHOD__.": Update service ".$service->id." failed. Last error: {$this->api->lastError}");
return false;
}