AHA download now uses correct Rimo API key

This commit is contained in:
Frank Schubert
2025-04-14 15:08:12 +02:00
parent 255876e371
commit a5560e749d
5 changed files with 46 additions and 9 deletions

View File

@@ -37,12 +37,21 @@ class RimoWorkorder extends mfBaseModel {
public function getAha() {
if(!$this->id) return false;
if(!$this->adb_wohneinheit_id) return false;
$ah = Rimoapi::getWorkorderAhaReport($this->rimo_id);
$preorder = PreorderModel::getFirstActive(["adb_wohneinheit_id" => $this->adb_wohneinheit_id]);
$this->log->debug(__METHOD__.": Wohneinheit: ".$this->adb_wohneinheit_id);
$this->log->debug(__METHOD__.": Preorder: ".$preorder->id);
if(!$preorder) return false;
$api_creds = $preorder->getNetownerRimoApiCredentials();
$this->log->debug(__METHOD__.": Rimo Api Creds: ".print_r($api_creds, true));
if(!$api_creds) return false;
$apikey = $api_creds["prod"]["key"];
$ah = Rimoapi::getWorkorderAhaReport($apikey, $this->rimo_id);
return $ah;
}
public function getProperty($name) {