diff --git a/application/VoiceCallHistory/VoiceCallHistoryController.php b/application/VoiceCallHistory/VoiceCallHistoryController.php index 56edcef91..5a1fc1414 100644 --- a/application/VoiceCallHistory/VoiceCallHistoryController.php +++ b/application/VoiceCallHistory/VoiceCallHistoryController.php @@ -95,69 +95,26 @@ class VoiceCallHistoryController extends mfBaseController { } public function addContractIds() { - // regex format - $ignore_numbers = [ - "^43664", - "^43677", - "^43699", - "^43660", - "^43676", - "^43650", - "^4331641220846$", - "^43623237705$", - "^4367761737195$", - "^43216720836$", - "^43623237705$", - "^43318528468150$", - "^4312532516$", - "^43720729927$", - "^4334528240030$", - "^4350144522120$", - "^4315460050680$", - "^491795058290$", - "^43346221888$", - "^43346244112609$", - "^43345271487$", - "^43318523364$", - "^4953118053397$", - "^433169010$", - "^433163130$", - "^43345276276$", - "^4371119$", - "^4331638513208$", - "^4350808808$", - "^4334562244$", - "^4331638579635$", - "^4334527015385$", - "^4331852888$", - "^436604721650$", - "^43316465611$", - "^43318255088$", - "^433452853656$", - "^4312661274381$", - "^4334528682432$", - "^38640616165", - "^43676848456202$", - "^43136157650", - "^43317244160", - "^4368181877218", - "^491744919930", - "^4924194559562", - ]; + $ign = new mfConfig("voicecallhistory.contractadd.ignore_numbers"); + $ignore_numbers = $ign->value(); + + if($ignore_numbers) $ignore_numbers = json_decode($ignore_numbers); + if(!is_array($ignore_numbers)) { + $ignore_numbers = []; + } $unknown_numbers = []; $in_order = []; $missing_contracts = []; $update_job_error = false; - $last_calls = VoiceCallHistoryModel::getVoiceCallHistoryAsEntity([[], 1, 0, ["key" => "create", "order" => "DESC"]]); + $last_calls = VoiceCallHistoryModel::getVoiceCallHistoryAsEntity([[]], 1, 0, ["key" => "create", "order" => "DESC"]); $last_call = $last_calls[0]; if($last_call->create < date("U") - 86400) { $update_job_error = $last_call->create; return false; } - - + // get calls without contract id foreach(VoiceCallHistoryModel::getVoiceCallHistoryAsEntity(["contract_id" => null, "billable" => "1", "duration" => ["from" => 1]]) as $call) { //var_dump($call);exit; diff --git a/db/migrations/20260203131918_system_change_value_text.php b/db/migrations/20260203131918_system_change_value_text.php new file mode 100644 index 000000000..af37e26a4 --- /dev/null +++ b/db/migrations/20260203131918_system_change_value_text.php @@ -0,0 +1,31 @@ +getEnvironment() == "thetool") { + $table = $this->table('System'); + $table->changeColumn("value", "text", ["null" => false, "length" => Phinx\Db\Adapter\MysqlAdapter::TEXT_MEDIUM]); + $table->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + + } + + if($this->getEnvironment() == "addressdb") { + + } + } +}