Example #1
0
 public static function InitDBValues($idtm_struktur, $idta_variante, $idta_perioden = '10001')
 {
     //Step One, find all relevant IDs
     $StartRecord = StrukturRecord::finder()->findByidtm_struktur($idtm_struktur);
     if (count($StartRecord) == 1) {
         $sql = "SELECT idta_struktur_type FROM tm_struktur WHERE struktur_lft BETWEEN " . $StartRecord->struktur_lft . " AND " . $StartRecord->struktur_rgt . " GROUP BY idta_struktur_type";
         //here I recieve the array of values containing the elements to be changed
         $GroupsToChange = StrukturRecord::finder()->findAllBySQL($sql);
         foreach ($GroupsToChange as $Group) {
             $checker = FeldfunktionRecord::finder()->count("idta_struktur_type = ?", $Group->idta_struktur_type);
             if ($checker > 0) {
                 $sqlElemente = "SELECT idtm_struktur,idta_struktur_type FROM tm_struktur WHERE (struktur_lft BETWEEN " . $StartRecord->struktur_lft . " AND " . $StartRecord->struktur_rgt . ") AND idta_struktur_type=" . $Group->idta_struktur_type;
                 $ElementsToChange = StrukturRecord::finder()->findAllBySQL($sqlElemente);
                 foreach ($ElementsToChange as $Element) {
                     echo $Element->idtm_struktur;
                     $ObjSaver = new PFBackCalculator();
                     $ObjSaver->setStartPeriod($idta_perioden);
                     $ObjSaver->setVariante($idta_variante);
                     $ObjSaver->setStartNode($Element->idtm_struktur);
                     $ObjSaver->build_DIMKEY($Element->idtm_struktur);
                     $ObjSaver->initTTWerte($Element->idtm_struktur, $Element->idta_struktur_type);
                     unset($ObjSaver);
                 }
                 empty($checker);
             }
         }
         unset($ElementsToChange);
     }
 }
 public function buildStrukturStrukturPullDown()
 {
     $this->SSedidta_feldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name"), "idta_struktur_type = " . $this->page->idta_struktur_type->Text);
     $this->SSedidta_feldfunktion->DataBind();
     $StrukRec = StrukturRecord::finder()->findByidtm_struktur($this->user->getStartNode($this->user->getUserId($this->user->Name), "tm_struktur"));
     $this->SSedidtm_struktur_to->DataSource = PFH::build_SQLPullDown(StrukturRecord::finder(), "tm_struktur INNER JOIN ta_feldfunktion ON tm_struktur.idta_struktur_type = ta_feldfunktion.idta_struktur_type", array("idtm_struktur", "struktur_name"), "ff_type=3 AND struktur_lft BETWEEN " . $StrukRec->struktur_lft . " AND " . $StrukRec->struktur_rgt);
     $this->SSedidtm_struktur_to->DataBind();
 }
 public function buildPivotBerichtPullDown()
 {
     $this->PBedidta_feldfunktion->DataSource = PFH::build_SQLPullDownAdvanced(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "idta_struktur_type", "ff_name"));
     $this->PBedidta_feldfunktion->dataBind();
     $this->PBedidta_variante->DataSource = PFH::build_SQLPullDown(VarianteRecord::finder(), "ta_variante", array("idta_variante", "var_descr"));
     $this->PBedidta_variante->dataBind();
     $data = array('SUM' => "SUM", "AVG" => "AVG", "MAX" => "MAX", "MIN" => "MIN");
     $this->PBedpivot_bericht_operator->DataSource = $data;
     $this->PBedpivot_bericht_operator->DataBind();
 }
 public function onPreInit($param)
 {
     //error_reporting(E_ALL ^ E_NOTICE);
     $request_user = $_GET['user'];
     $request_password = $_GET['pass'];
     $authManager = $this->Application->getModule('auth');
     if (!$authManager->login($request_user, $request_password)) {
         exit;
     }
     $this->getResponse()->appendHeader("Content-Type:" . $this->header);
     echo '<?xml version="1.0" ?><ta_feldfunktion>';
     $SQL = "SELECT idta_feldfunktion, ff_name, idta_struktur_type FROM ta_feldfunktion";
     $Results = FeldfunktionRecord::finder()->findAllBySQL($SQL);
     foreach ($Results as $Result) {
         echo "<row idta_feldfunktion='" . $Result->idta_feldfunktion . "'>";
         echo "<ff_name>" . $Result->ff_name . "</ff_name>";
         echo "<idta_struktur_type>" . $Result->idta_struktur_type . "</idta_struktur_type>";
         echo "</row>";
     }
     echo '</ta_feldfunktion>';
     exit;
 }
 public function SCRunSeasonsButtonClicked($sender, $param)
 {
     //Step One, find all relevant IDs
     $FieldstToChange = array();
     //inside this array, the fields that needed to be changed are listed
     $idta_variante = $this->Request['idta_variante'];
     $idta_struktur_type = FeldfunktionRecord::finder()->findByidta_feldfunktion($this->sai_idta_feldfunktion->Text)->idta_struktur_type;
     $idta_feldfunktion = $this->sai_idta_feldfunktion->Text;
     $FieldsToChange[] = $idta_feldfunktion;
     //this value needs always to be included
     $this->load_all_cats();
     $SQLINCondition = $this->subCategory_Inlist($this->subcats, $this->sai_idtm_struktur->Text);
     //the two must be replaced with the value from the usermanager
     $sql = "SELECT idtm_struktur FROM tm_struktur WHERE idtm_struktur IN (" . $SQLINCondition . ") AND idta_struktur_type = " . $idta_struktur_type;
     //here I recieve the array of values containing the elements to be changed
     $ElementsToChange = StrukturRecord::finder()->findAllBySQL($sql);
     //before the change can start, I need to identify the affected rows
     $FieldsToChangeBrutto = CollectorRecord::finder()->findAllBycol_idtafeldfunktion($idta_feldfunktion);
     foreach ($FieldsToChangeBrutto as $TmpField) {
         $FieldsToChange[] = $TmpField->idta_feldfunktion;
     }
     $SeasonToWrite = TTSaisonRecord::finder()->findAllByidta_saisonalisierung($this->sai_idta_saisonalisierung->Text);
     foreach ($ElementsToChange as $Element) {
         foreach ($FieldsToChange as $Field) {
             foreach ($SeasonToWrite as $Season) {
                 $year_idta_periode = PeriodenRecord::finder()->find('idta_perioden = ?', PeriodenRecord::finder()->findByPK($Season->idta_periode)->parent_idta_perioden)->per_intern;
                 $sqlYEAR = "SELECT w_wert FROM tt_werte WHERE w_jahr = " . $year_idta_periode . " AND w_monat = " . $year_idta_periode . " AND idtm_struktur = " . $Element->idtm_struktur . " AND w_id_variante = " . $idta_variante . " AND idta_feldfunktion = " . $Field;
                 $YEARValue = WerteRecord::finder()->findBySQL($sqlYEAR)->w_wert;
                 $newMonthValue = $YEARValue * $Season->sai_wert;
                 //$sqlMONTH = "SELECT w_wert FROM tt_werte WHERE w_jahr = ".$year_idta_periode." AND w_monat = ".PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern." AND idtm_struktur = ".$Element->idtm_struktur." AND w_id_variante = ".$idta_variante." AND idta_feldfunktion = ".$Field;
                 if (count(WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_idta_periode, PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern, $Element->idtm_struktur, $idta_variante, $Field))) {
                     $RecordToUpdate = WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_idta_periode, PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern, $Element->idtm_struktur, $idta_variante, $Field);
                     $RecordToUpdate->w_wert = $newMonthValue;
                     $RecordToUpdate->save();
                 }
             }
         }
     }
 }
 public function setFeldFunktion($idta_feldfunktion)
 {
     $this->FeldFunktion = $idta_feldfunktion;
     $this->StrukturType = FeldfunktionRecord::finder()->findByPK($this->FeldFunktion)->idta_struktur_type;
 }
 public function FCRunSeasonsButtonClicked($sender, $param)
 {
     //Step One, find all relevant IDs
     $FieldstToChange = array();
     //inside this array, the fields that needed to be changed are listed
     $FieldsToKeep = array();
     //inside this array, the fields that needed to be keept are listed
     $idta_variante = $this->Request['idta_variante'];
     $to_idta_variante = $this->for_idta_variante->Text;
     $this->load_ta_perioden($this->for_from_idta_periode->Text, $this->for_to_idta_periode->Text);
     $idta_struktur_type = FeldfunktionRecord::finder()->findByidta_feldfunktion($this->for_idta_feldfunktion->Text)->idta_struktur_type;
     $idta_feldfunktion = $this->for_idta_feldfunktion->Text;
     $FieldsToChange[] = $idta_feldfunktion;
     //this value needs always to be included
     $this->load_all_cats();
     $SQLINCondition = $this->subCategory_Inlist($this->subcats, $this->for_idtm_struktur->Text);
     //the two must be replaced with the value from the usermanager
     $sql = "SELECT idtm_struktur FROM tm_struktur WHERE idtm_struktur IN (" . $SQLINCondition . ") AND idta_struktur_type = " . $idta_struktur_type;
     //here I recieve the array of values containing the elements to be changed
     $ElementsToChange = StrukturRecord::finder()->findAllBySQL($sql);
     //before the change can start, I need to identify the affected rows
     $FieldsToChangeBrutto = CollectorRecord::finder()->findAllBycol_idtafeldfunktion($idta_feldfunktion);
     foreach ($FieldsToChangeBrutto as $TmpField) {
         $FieldsToChange[] = $TmpField->idta_feldfunktion;
     }
     $FieldsToKeepBrutto = FeldfunktionRecord::finder()->findAllByidta_struktur_type($idta_struktur_type);
     foreach ($FieldsToKeepBrutto as $MyTmpField) {
         if (!in_array($MyTmpField->idta_feldfunktion, $FieldsToChange)) {
             $FieldsToKeep[] = $MyTmpField->idta_feldfunktion;
         }
     }
     foreach ($ElementsToChange as $Element) {
         foreach ($this->Perioden as $key => $value) {
             foreach ($FieldsToChange as $Field) {
                 $year_idta_periode = $this->getYearByMonth($key);
                 $sqlYEAR = "SELECT w_wert FROM tt_werte WHERE w_jahr = " . $year_idta_periode . " AND w_monat = " . $key . " AND idtm_struktur = " . $Element->idtm_struktur . " AND w_id_variante = " . $idta_variante . " AND idta_feldfunktion = " . $Field;
                 $YEARValue = WerteRecord::finder()->findBySQL($sqlYEAR)->w_wert;
                 $newValue = $YEARValue * (1 + $this->for_for_faktor->Text / 100);
                 //$sqlMONTH = "SELECT w_wert FROM tt_werte WHERE w_jahr = ".$year_idta_periode." AND w_monat = ".PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern." AND idtm_struktur = ".$Element->idtm_struktur." AND w_id_variante = ".$idta_variante." AND idta_feldfunktion = ".$Field;
                 $year_to_idta_periode = $this->getYearByMonth($value);
                 if (count(WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_to_idta_periode, $value, $Element->idtm_struktur, $to_idta_variante, $Field))) {
                     $RecordToUpdate = WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_to_idta_periode, $value, $Element->idtm_struktur, $to_idta_variante, $Field);
                     if ($RecordToUpdate->w_wert != $newValue) {
                         $RecordToUpdate->w_wert = $newValue;
                         $RecordToUpdate->save();
                     }
                 } else {
                     $RecordToWrite = new WerteRecord();
                     $RecordToWrite->w_jahr = $year_to_idta_periode;
                     $RecordToWrite->w_monat = $value;
                     $RecordToWrite->idtm_struktur = $Element->idtm_struktur;
                     $RecordToWrite->w_id_variante = $to_idta_variante;
                     $RecordToWrite->w_wert = $newValue;
                     $RecordToWrite->idta_feldfunktion = $Field;
                     $RecordToWrite->w_dimkey = $this->build_DIMKEY($Element->idtm_struktur);
                     $RecordToWrite->save();
                 }
             }
             foreach ($FieldsToKeep as $Field) {
                 $year_idta_periode = $this->getYearByMonth($key);
                 $sqlYEAR = "SELECT w_wert FROM tt_werte WHERE w_jahr = " . $year_idta_periode . " AND w_monat = " . $key . " AND idtm_struktur = " . $Element->idtm_struktur . " AND w_id_variante = " . $idta_variante . " AND idta_feldfunktion = " . $Field;
                 $YEARValue = WerteRecord::finder()->findBySQL($sqlYEAR)->w_wert;
                 $newValue = $YEARValue;
                 //$sqlMONTH = "SELECT w_wert FROM tt_werte WHERE w_jahr = ".$year_idta_periode." AND w_monat = ".PeriodenRecord::finder()->findByPK($Season->idta_periode)->per_intern." AND idtm_struktur = ".$Element->idtm_struktur." AND w_id_variante = ".$idta_variante." AND idta_feldfunktion = ".$Field;
                 $year_to_idta_periode = $this->getYearByMonth($value);
                 if (count(WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_to_idta_periode, $value, $Element->idtm_struktur, $to_idta_variante, $Field))) {
                     $RecordToUpdate = WerteRecord::finder()->find('w_jahr = ? AND w_monat = ? AND idtm_struktur = ? AND w_id_variante = ? AND idta_feldfunktion = ?', $year_to_idta_periode, $value, $Element->idtm_struktur, $to_idta_variante, $Field);
                     $RecordToUpdate->w_wert = $newValue;
                     $RecordToUpdate->save();
                 } else {
                     $RecordToWrite = new WerteRecord();
                     $RecordToWrite->w_jahr = $year_to_idta_periode;
                     $RecordToWrite->w_monat = $value;
                     $RecordToWrite->idtm_struktur = $Element->idtm_struktur;
                     $RecordToWrite->w_id_variante = $to_idta_variante;
                     $RecordToWrite->w_wert = $newValue;
                     $RecordToWrite->idta_feldfunktion = $Field;
                     $RecordToWrite->w_dimkey = $this->build_DIMKEY($Element->idtm_struktur);
                     $RecordToWrite->save();
                 }
             }
         }
     }
 }
 public function buildStrukturBerichtZeilenPullDown()
 {
     $this->SBZedidta_feldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name"));
     $this->SBZedidta_feldfunktion->DataBind();
     $this->SBZedidtm_stammdaten->DataSource = PFH::build_SQLPullDown(StammdatenRecord::finder(), "tm_stammdaten", array("idtm_stammdaten", "stammdaten_name"));
     $this->SBZedidtm_stammdaten->DataBind();
     $data = array('0' => "Liste", "1" => "Dimension", "3" => "Berechnung", "4" => "Graph");
     $this->SBZedsbz_type->DataSource = $data;
     $this->SBZedsbz_type->DataBind();
 }
 private function check_collector($ffid, $field, $local_prefix, $month, $local_jahr, $local_id)
 {
     $myfieldfunk = '';
     $myfieldfunkrev = '';
     $tresult = CollectorRecord::finder()->findAllBySql("SELECT ta_collector.idta_feldfunktion,col_idtafeldfunktion,col_operator,ta_feldfunktion.ff_type AS ff_type FROM ta_collector INNER JOIN ta_feldfunktion ON ta_collector.idta_feldfunktion = ta_feldfunktion.idta_feldfunktion WHERE ta_collector.col_idtafeldfunktion = '" . $ffid . "'");
     foreach ($tresult as $trecord) {
         if (FeldfunktionRecord::finder()->findByPK($trecord->idta_feldfunktion)->ff_calcopening) {
             $this->calcOB = 1;
             $this->calcOBID = $trecord->idta_feldfunktion;
         }
         if ($trecord->ff_type == 6) {
             $this->calcPayables($this->piq_idta_struktur_type, $trecord->idta_feldfunktion, $local_id, $local_jahr, $local_prefix);
         } elseif ($trecord->ff_type == 4) {
             $this->calcOpeningBalance($this->piq_idta_struktur_type, $trecord->idta_feldfunktion, $local_id);
         } else {
             $this->run_collector($trecord->idta_feldfunktion, $field, $local_prefix, $month, $local_jahr, $local_id);
             $myfieldfunk = $trecord->idta_feldfunktion;
             if ($myfieldfunk != '') {
                 //AND $myfieldfunk!='3'){
                 if (FeldfunktionRecord::finder()->findByPK($myfieldfunk)->ff_type == 5) {
                     $mymonth = $this->getMaxPerIntern($local_jahr);
                     $previousField = "RLIQXXX" . $local_jahr . "XXX" . $mymonth . "XXX" . $this->piq_idta_struktur_type . "XXX" . $myfieldfunk . "XXX" . $local_id;
                     $valuefillin = $this->page->ACTPanel->FindControl($previousField)->Text;
                     $this->update_w_wert($local_jahr, $local_jahr, $this->piq_idta_struktur_type, $myfieldfunk, $local_id, $valuefillin);
                     $resultField = "RLIQXXX" . $local_jahr . "XXX" . $local_jahr . "XXX" . $this->piq_idta_struktur_type . "XXX" . $myfieldfunk . "XXX" . $local_id;
                     $this->page->ACTPanel->FindControl($resultField)->Text = number_format($valuefillin, $this->NumberOfDigits, '.', '');
                 } else {
                     if ($this->SinglePeriode == 0) {
                         $this->update_w_wert($local_jahr, $local_jahr, $this->piq_idta_struktur_type, $myfieldfunk, $local_id, $this->sum_up($local_jahr, $month, $myfieldfunk, $local_id));
                         //hier muss ich definieren, ob der wert in summe oben an kommt, oder nur der absolute wert
                         $resultField = "RLIQXXX" . $local_jahr . "XXX" . $local_jahr . "XXX" . $this->piq_idta_struktur_type . "XXX" . $myfieldfunk . "XXX" . $local_id;
                         $this->page->ACTPanel->FindControl($resultField)->Text = number_format($this->sum_up($local_jahr, $month, $myfieldfunk, $local_id), $this->NumberOfDigits, '.', '');
                     }
                 }
             }
         }
     }
 }
Example #10
0
 public function setFeldFunktion($idta_feldfunktion)
 {
     $this->FeldFunktion = $idta_feldfunktion;
     $FFRecord = FeldfunktionRecord::finder()->findByPK($this->FeldFunktion);
     if (count($FFRecord) == 1) {
         $this->StrukturType = $FFRecord->idta_struktur_type;
     } else {
         $this->StrukturType = 0;
     }
 }
 public function initPullDowns()
 {
     $this->from_idta_stammdaten_group->DataSource = PFH::build_SQLPullDown(StammdatenGroupRecord::finder(), "ta_stammdaten_group", array("idta_stammdaten_group", "stammdaten_group_name"));
     $this->from_idta_stammdaten_group->dataBind();
     $this->to_idta_stammdaten_group->DataSource = PFH::build_SQLPullDown(StammdatenGroupRecord::finder(), "ta_stammdaten_group", array("idta_stammdaten_group", "stammdaten_group_name"));
     $this->to_idta_stammdaten_group->dataBind();
     $this->from_idta_feldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name"));
     $this->from_idta_feldfunktion->dataBind();
     $this->to_idta_feldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name"));
     $this->to_idta_feldfunktion->dataBind();
     $PeriodPullDown = new PFPeriodPullDown();
     $PeriodPullDown->setStructureTable("ta_perioden");
     $PeriodPullDown->setRecordClass(PeriodenRecord::finder());
     $PeriodPullDown->setPKField("idta_perioden");
     $PeriodPullDown->setSQLCondition("per_intern > 9999");
     $PeriodPullDown->setField("per_extern");
     $PeriodPullDown->letsrun();
     $this->DWH_idta_perioden->DataSource = $PeriodPullDown->myTree;
     $this->DWH_idta_perioden->dataBind();
     $this->DWH_idta_variante->DataSource = PFH::build_SQLPullDown(VarianteRecord::finder(), "ta_variante", array("idta_variante", "var_descr"));
     $this->DWH_idta_variante->dataBind();
 }
 public function buildCollectorPullDown()
 {
     $this->COLedcol_idtafeldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name"), "idta_struktur_type = " . $this->page->idta_struktur_type->Text);
     $this->COLedcol_idtafeldfunktion->DataBind();
     $data = array('+' => "+", "-" => "-", "/" => "/", "*" => "*");
     $this->COLedcol_operator->DataSource = $data;
     $this->COLedcol_operator->DataBind();
 }
 public function buildAutoMappingPullDown()
 {
     $listSource = array();
     for ($i = 1; $i <= $this->NumberID->Text; $i++) {
         $listSource[$i] = "Level " . $i;
     }
     $this->SelectAMLevel->dataSource = $listSource;
     $this->SelectAMLevel->dataBind();
     $this->Selectidta_feldfunktion->DataSource = PFH::build_SQLPullDownAdvanced(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name", "idta_struktur_type"));
     $this->Selectidta_feldfunktion->dataBind();
 }
 public function buildFieldList($idta_stammdaten_group)
 {
     $Result = StammdatenGroupRecord::finder()->findBy_idta_stammdaten_group($idta_stammdaten_group);
     if (is_Object($Result)) {
         $this->RCTedidta_feldfunktion->DataSource = PFH::build_SQLPullDown(FeldfunktionRecord::finder(), "ta_feldfunktion", array("idta_feldfunktion", "ff_name"), "idta_struktur_type = '" . $Result->idta_struktur_type . "' AND ff_type = 1");
         $this->RCTedidta_feldfunktion->dataBind();
     }
 }
 public function runStructureCollector($idtm_struktur, $periode = '10001', $variante = '1')
 {
     //diese info benoetige ich, damit keine doppelten felder geladen werden
     $existingFieldfunktionen = array();
     $existingFieldfunktionen = $this->FunktionsFelder;
     $Records = StrukturStrukturRecord::finder()->findAllBySQL("SELECT idtm_struktur_to FROM tm_struktur_tm_struktur WHERE idtm_struktur_from = '" . $idtm_struktur . "' GROUP BY idtm_struktur_to");
     $counter = 0;
     foreach ($Records as $Record) {
         //leeren der bestehenden Funktionsfelder
         $this->FunktionsFelder = array();
         $counter++;
         $this->TTWERTE = array();
         $this->WerteListe = array();
         //hier leere ich das Array, sonst klappt das nicht
         $Company = $this->findFirstCompany($Record->idtm_struktur_to);
         $counter == 1 ? $this->setStartNode($Company) : '';
         $counter == 1 ? $this->setStartPeriod($periode) : '';
         //hier muss ich checken, ob aus einer struktur 2 werte auf den gleichen Punkt verweisen...
         foreach (StrukturStrukturRecord::finder()->findAllByidtm_struktur_to($Record->idtm_struktur_to) as $temp) {
             array_push($this->FunktionsFelder, $temp->idta_feldfunktion);
         }
         //here we run the SQL-Statement
         $this->buildStructureCollectorSQL($Record->idtm_struktur_to);
         $this->setStartNode($Record->idtm_struktur_to);
         //diese info benoetige ich, damit keine doppelten felder geladen werden
         $this->FunktionsFelder = $existingFieldfunktionen;
         $command = $this->DBConnection->createCommand($this->mySQL);
         $dataReader = $command->query();
         $this->WerteListe = $dataReader->readAll();
         //hier befuellen wir den ram record
         $this->TTWERTE = array();
         //DB: leeres array print_r($this->TTWERTE);
         $this->initTTWerte($Record->idtm_struktur_to, StrukturRecord::finder()->findByPK($Record->idtm_struktur_to)->idta_struktur_type);
         $Result = StrukturRecord::finder()->findByPK($Record->idtm_struktur_to);
         $SQL = "SELECT * FROM ta_feldfunktion WHERE idta_struktur_type = '" . $Result->idta_struktur_type . "' AND ff_type='3'";
         $FieldToChange = FeldfunktionRecord::finder()->findBySQL($SQL);
         foreach ($this->Perioden as $tmpPeriode) {
             if ($tmpPeriode[0] > 10000) {
                 $jahr = $tmpPeriode[0];
                 $monat = $tmpPeriode[0];
             } else {
                 $jahr = $this->getYearByMonth($tmpPeriode[0]);
                 $monat = $tmpPeriode[0];
             }
             //$this->valueChanged($jahr,$monat,$Result->idta_struktur_type,$FieldToChange->idta_feldfunktion,$Record->idtm_struktur_to,$this->WerteListe[0][$monat]);
             $this->update_w_wert($jahr, $monat, $FieldToChange->idta_feldfunktion, $Record->idtm_struktur_to, $this->WerteListe[0][$monat]);
         }
         $this->mySQL = '';
         //former saveValues()
         $this->valueChanged($jahr, $jahr, $Result->idta_struktur_type, $FieldToChange->idta_feldfunktion, $Record->idtm_struktur_to, $this->WerteListe[0][$jahr]);
         $this->check_collector($FieldToChange->idta_feldfunktion, $jahr, $jahr, $Record->idtm_struktur_to);
         $this->saveValues("NOSC");
     }
 }
 public function initPullDowns($sender, $param)
 {
     $this->idta_variante->DataSource = VarianteRecord::finder()->findAll();
     $this->idta_variante->dataBind();
     $this->idta_perioden->DataSource = PeriodenRecord::finder()->findAll();
     $this->idta_perioden->dataBind();
     $this->idta_feldfunktion->DataSource = FeldfunktionRecord::finder()->findAll();
     $this->idta_feldfunktion->dataBind();
     $this->cuf_numberformat->DataSource = array("0" => "Ganzzahl", "1" => "Prozent", "2" => "Zahl");
     $this->cuf_numberformat->dataBind();
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['idta_stammdaten_group'] = 'desc';
     $this->idtm_stammdaten->DataSource = StammdatenRecord::finder()->findAll($criteria);
     $this->idtm_stammdaten->dataBind();
 }