citycom oan: Fixed setting billing_date on CC service create and update
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user