Exemplo n.º 1
0
 function CreateNewRPU_AFS_TDGenRevBrgy($odID, $userID = "", $transactionCode = "", $copyOwner = true, $copyAFS = true, $copyTD = true)
 {
     $link = mysql_connect(MYSQLDBHOST, MYSQLDBUSER, MYSQLDBPWD);
     mysql_select_db(MYSQLDBNAME, $link);
     $sql = "select Person.firstName, Person.lastName from Person, Owner, OwnerPerson " . "where Person.personID = OwnerPerson.personID and OwnerPerson.ownerID = Owner.ownerID and Owner.odID = " . $odID;
     $rs = mysql_query($sql, $link);
     $prevowners = '';
     while ($row = mysql_fetch_assoc($rs)) {
         $prevowners .= $row['firstName'] . ' ' . $row['lastName'] . ', ';
     }
     $prevowners = substr($prevowners, 0, strlen($prevowners) - 2);
     $sql = "select AFS.totalAssessedValue from AFS where AFS.odID = " . $odID;
     $rs = mysql_query($sql, $link);
     $prevassdval = 0;
     if ($row = mysql_fetch_assoc($rs)) {
         $prevassdval = $row['totalAssessedValue'];
     }
     $od = new OD();
     $od->selectRecord($odID);
     unset($od->oldODArray);
     $od->setTransactionCode($transactionCode);
     $od->setOldODArray($odID);
     // create new OD
     $ownerID = $od->owner->getOwnerID();
     $newOdID = $od->insertRecord();
     $newOwnerID = $od->newOwnerID;
     $od->setDomDocument();
     // associate existing Owner to new OD
     $owner = new Owner();
     $owner->selectRecord($ownerID);
     if (count($owner->personArray)) {
         foreach ($owner->personArray as $personKey => $personValue) {
             if ($copyOwner) {
                 $owner->insertOwnerPerson($newOwnerID, $personValue->getPersonID());
             }
         }
     }
     if (count($owner->companyArray)) {
         foreach ($owner->companyArray as $companyKey => $companyValue) {
             if ($copyOwner) {
                 $owner->insertOwnerCompany($newOwnerID, $companyValue->getCompanyID());
             }
         }
     }
     // create new AFS and associate existing properties to new AFS
     $afs = new AFS();
     $afsID = $afs->checkAfsID($odID);
     $afs->selectRecord($afsID);
     $afs->setOdID($newOdID);
     $afs->effectivity = date("Y") + 1;
     // new arpNumber is blank
     //$afs->arpNumber = "";
     // retain PIN except for Consolidation and Subdivision
     //if($transactionCode=="SD" || $transactionCode=="CS"){
     $afs->propertyIndexNumber = "";
     //}
     $afs->setDomDocument();
     $newAFSID = $afs->insertRecord();
     $afs->arpNumber = '(' . $newAFSID . ')';
     $afs->updateRecord();
     if ($copyAFS) {
         if ($copyTD) {
             $td = new TD();
             $td->taxDeclarationNumber = $afs->arpNumber;
             $td->afsID = $newAFSID;
             $td->previousOwner = $prevowners;
             $td->previousAssessedValue = $prevassdval;
             $td->setDomDocument();
             $newTDID = $td->insertRecord();
         }
         if (count($afs->landArray)) {
             foreach ($afs->landArray as $landKey => $landValue) {
                 $landValue->setPropertyID("");
                 $landValue->setAfsID($newAFSID);
                 $landValue->propertyAdministrator->setPersonID("");
                 // set unitValue from SubClass
                 $landSubclasses = new LandSubclasses();
                 $landSubclasses->selectRecord(intVal($landValue->subClass));
                 $landValue->setUnitValue($landSubclasses->getValue());
                 // set assessmentLevel from ActualUse
                 $landActualUses = new LandActualUses();
                 $landActualUses->selectRecord(intVal($landValue->actualUse));
                 $landValue->setAssessmentLevel($landActualUses->getValue());
                 $landValue->calculateMarketValue();
                 $landValue->calculateValueAdjustment();
                 $landValue->calculateAdjustedMarketValue();
                 $landValue->calculateAssessedValue();
                 $landValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $landValue->appraisedByDate = "";
                 $landValue->recommendingApprovalDate = "";
                 $landValue->approvedByDate = "";
                 $newP = $landValue->insertRecord();
             }
         }
         if (count($afs->plantsTreesArray)) {
             foreach ($afs->plantsTreesArray as $plantsTreesKey => $plantsTreesValue) {
                 $plantsTreesValue->setPropertyID("");
                 $plantsTreesValue->setAfsID($newAFSID);
                 $plantsTreesValue->propertyAdministrator->setPersonID("");
                 // set unitPrice from ProductClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 $plantsTreesClasses->selectRecord(intVal($plantsTreesValue->productClass));
                 $plantsTreesValue->setUnitPrice($plantsTreesClasses->getValue());
                 // set assessmentLevel from ActualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 $plantsTreesActualUses->selectRecord(intVal($plantsTreesValue->actualUse));
                 $plantsTreesValue->setAssessmentLevel($plantsTreesActualUses->getValue());
                 $plantsTreesValue->calculateMarketValue();
                 $plantsTreesValue->calculateValueAdjustment();
                 $plantsTreesValue->calculateAdjustedMarketValue();
                 $plantsTreesValue->calculateAssessedValue();
                 $plantsTreesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $plantsTreesValue->appraisedByDate = "";
                 $plantsTreesValue->recommendingApprovalDate = "";
                 $plantsTreesValue->approvedByDate = "";
                 $newP = $plantsTreesValue->insertRecord();
             }
         }
         if (count($afs->improvementsBuildingsArray)) {
             foreach ($afs->improvementsBuildingsArray as $improvementsBuildingsKey => $improvementsBuildingsValue) {
                 $improvementsBuildingsValue->setPropertyID("");
                 $improvementsBuildingsValue->setAfsID($newAFSID);
                 $improvementsBuildingsValue->propertyAdministrator->setPersonID("");
                 // set unitValue from BuildingClassification
                 $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                 $improvementsBuildingsClasses->selectRecord(intVal($improvementsBuildingsValue->buildingClassification));
                 $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue());
                 // set assessmentLevel from ActualUse
                 $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                 $improvementsBuildingsActualUses->selectRecord(intVal($improvementsBuildingsValue->actualUse));
                 $improvementsBuildingsValue->setAssessmentLevel($improvementsBuildingsActualUses->getValue());
                 $improvementsBuildingsValue->calculateMarketValue();
                 $improvementsBuildingsValue->calculateAccumulatedDepreciation();
                 $improvementsBuildingsValue->calculatedDepreciatedMarketValue();
                 $improvementsBuildingsValue->calculateAdjustedMarketValue();
                 $improvementsBuildingsValue->calculateAssessedValue();
                 $improvementsBuildingsValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $improvementsBuildingsValue->appraisedByDate = "";
                 $improvementsBuildingsValue->recommendingApprovalDate = "";
                 $improvementsBuildingsValue->approvedByDate = "";
                 $newP = $improvementsBuildingsValue->insertRecord();
             }
         }
         if (count($afs->machineriesArray)) {
             foreach ($afs->machineriesArray as $machineriesKey => $machineriesValue) {
                 $machineriesValue->setPropertyID("");
                 $machineriesValue->setAfsID($newAFSID);
                 $machineriesValue->propertyAdministrator->setPersonID("");
                 // set assessmentLevel from ActualUse
                 $machineriesActualUses = new MachineriesActualUses();
                 $machineriesActualUses->selectRecord(intVal($machineriesValue->actualUse));
                 $machineriesValue->setAssessmentLevel($machineriesActualUses->getValue());
                 $machineriesValue->calculateMarketValue();
                 $machineriesValue->calculateDepreciatedMarketValue();
                 $machineriesValue->calculateAdjustedMarketValue();
                 $machineriesValue->calculateAssessedValue();
                 $machineriesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $machineriesValue->appraisedByDate = "";
                 $machineriesValue->recommendingApprovalDate = "";
                 $machineriesValue->approvedByDate = "";
                 $newP = $machineriesValue->insertRecord();
             }
         }
     }
     $sql = "update AFS set archive = 'true' where AFS.odID = " . $odID;
     mysql_query($sql, $link);
     $sql = "update OD set archive = 'true' where OD.odID = " . $odID;
     mysql_query($sql, $link);
     $sql = "update TD set archive = 'true' where TD.afsID = " . $afsID;
     mysql_query($sql, $link);
     mysql_close($link);
     return $newOdID;
     echo "OD - " . $odID . "->" . $newOdID . "<br>";
     echo "Owner - " . $ownerID . "->" . $newOwnerID . "<br>";
     echo "AFS - " . $afsID . "->" . $newAFSID . "<br>" . $newP;
 }
Exemplo n.º 2
0
 function Main()
 {
     //echo $this->formArray["formAction"];
     switch ($this->formArray["formAction"]) {
         case "save":
             $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object");
             if ($this->formArray["tdID"] != "") {
                 $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
                 if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $td = new TD();
                         $td->parseDomDocument($domDoc);
                         $td->setTdID($this->formArray["tdID"]);
                         $td->setAfsID($this->formArray["afsID"]);
                         $td->setPropertyID($this->formArray["propertyID"]);
                         $td->setPropertyType($this->formArray["propertyType"]);
                         $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]);
                         $td->setProvincialAssessor($this->formArray["provincialAssessorID"]);
                         $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]);
                         $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]);
                         $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]);
                         $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]);
                         $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]);
                         $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]);
                         $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]);
                         $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]);
                         $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]);
                         $td->setPreviousOwner($this->formArray["previousOwner"]);
                         $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                         $td->setCreatedBy($this->userID);
                         $td->setModifiedBy($this->userID);
                         $td->setDomDocument();
                         $doc = $td->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         //exit($xmlStr);
                         if (!($ret = $TDEncode->updateTD($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $td = new TD();
                 $td->parseDomDocument($domDoc);
                 //$td->setTdID($this->formArray["tdID"]);
                 $td->setAfsID($this->formArray["afsID"]);
                 $td->setPropertyID($this->formArray["propertyID"]);
                 $td->setPropertyType($this->formArray["propertyType"]);
                 $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]);
                 $td->setProvincialAssessor($this->formArray["provincialAssessorID"]);
                 $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]);
                 $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]);
                 $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]);
                 $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]);
                 $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]);
                 $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]);
                 $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]);
                 $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]);
                 $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]);
                 $td->setPreviousOwner($this->formArray["previousOwner"]);
                 $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                 $td->setCreatedBy($this->userID);
                 $td->setModifiedBy($this->userID);
                 $td->setDomDocument();
                 $doc = $td->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 //echo $xmlStr;
                 if (!($ret = $TDEncode->saveTD($xmlStr))) {
                     echo "Error saving";
                 }
             }
             $this->formArray["propertyID"] = $ret;
             header("location: TDClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit($ret);
             break;
         case "cancel":
             header("location: TDList.php");
             exit;
             break;
         default:
             if ($this->formArray["tdID"]) {
                 $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
                 if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) {
                     echo "xml failed";
                 } else {
                     //echo $xmlStr;
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                         $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                     } else {
                         $td = new TD();
                         $td->parseDomDocument($domDoc);
                         foreach ($td as $key => $value) {
                             switch ($key) {
                                 case "provincialAssessorDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["pa_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["pa_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["pa_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "cityMunicipalAssessorDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["cm_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["cm_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["cm_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 default:
                                     //echo $key."=>".$value."<br>";
                                     $this->formArray[$key] = $value;
                             }
                         }
                     }
                 }
             }
             $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock");
             $this->tpl->set_var("odIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("tdID" => $this->formArray["tdID"], "propertyType" => $this->formArray["propertyType"], "propertyID" => $this->formArray["propertyID"], "afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemplo n.º 3
0
 function Main()
 {
     //echo $this->formArray["formAction"];
     switch ($this->formArray["formAction"]) {
         case "save":
             $TDEncode = new SoapObject(NCCBIZ . "TDEncode.php", "urn:Object");
             if ($this->formArray["tdID"] != "") {
                 $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
                 if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $td = new TD();
                         $td->parseDomDocument($domDoc);
                         $td->setTdID($this->formArray["tdID"]);
                         $td->setAfsID($this->formArray["afsID"]);
                         $td->setPropertyID($this->formArray["propertyID"]);
                         $td->setPropertyType($this->formArray["propertyType"]);
                         $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]);
                         $td->setProvincialAssessor($this->formArray["provincialAssessorID"]);
                         $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]);
                         $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]);
                         $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]);
                         $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]);
                         $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]);
                         $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]);
                         $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]);
                         $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]);
                         $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]);
                         $td->setPreviousOwner($this->formArray["previousOwner"]);
                         $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                         $td->setMemoranda($this->formArray["memoranda"]);
                         $td->setCreatedBy($this->userID);
                         $td->setModifiedBy($this->userID);
                         $td->setDomDocument();
                         $doc = $td->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         //exit($xmlStr);
                         if (!($ret = $TDEncode->updateTD($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $td = new TD();
                 $td->parseDomDocument($domDoc);
                 //$td->setTdID($this->formArray["tdID"]);
                 $td->setAfsID($this->formArray["afsID"]);
                 $td->setPropertyID($this->formArray["propertyID"]);
                 $td->setPropertyType($this->formArray["propertyType"]);
                 $td->setTaxDeclarationNumber($this->formArray["taxDeclarationNumber"]);
                 $td->setProvincialAssessor($this->formArray["provincialAssessorID"]);
                 $td->setProvincialAssessorDate($this->formArray["provincialAssessorDate"]);
                 $td->setCityMunicipalAssessor($this->formArray["cityMunicipalAssessorID"]);
                 $td->setCityMunicipalAssessorDate($this->formArray["cityMunicipalAssessorDate"]);
                 $td->setCancelsTDNumber($this->formArray["cancelsTDNumber"]);
                 $td->setCanceledByTDNumber($this->formArray["canceledByTDNumber"]);
                 $td->setTaxBeginsWithTheYear($this->formArray["taxBeginsWithTheYear"]);
                 $td->setCeasesWithTheYear($this->formArray["ceasesWithTheYear"]);
                 $td->setEnteredInRPARForYear($this->formArray["enteredInRPARForYear"]);
                 $td->setEnteredInRPARForBy($this->formArray["enteredInRPARForByID"]);
                 $td->setPreviousOwner($this->formArray["previousOwner"]);
                 $td->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                 $td->setMemoranda($this->formArray["memoranda"]);
                 $td->setCreatedBy($this->userID);
                 $td->setModifiedBy($this->userID);
                 $td->setDomDocument();
                 $doc = $td->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 //echo $xmlStr;
                 if (!($ret = $TDEncode->saveTD($xmlStr))) {
                     echo "Error saving";
                 }
             }
             $this->formArray["propertyID"] = $ret;
             header("location: TDClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit($ret);
             break;
         case "cancel":
             header("location: TDList.php");
             exit;
             break;
         default:
             if ($this->formArray["tdID"]) {
                 $TDDetails = new SoapObject(NCCBIZ . "TDDetails.php", "urn:Object");
                 if (!($xmlStr = $TDDetails->getTD($this->formArray["tdID"]))) {
                     echo "xml failed";
                 } else {
                     //echo $xmlStr;
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                         $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                     } else {
                         $td = new TD();
                         $td->parseDomDocument($domDoc);
                         if ($td->getCancelsTDNumber() == "") {
                             $td = $this->updateTDCancelsTDNumber($td);
                         }
                         if ($td->getCanceledByTDNumber() == "") {
                             $td = $this->updateTDCanceledByTDNumber($td);
                         }
                         foreach ($td as $key => $value) {
                             switch ($key) {
                                 case "provincialAssessorDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["pa_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["pa_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["pa_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "cityMunicipalAssessorDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["cm_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["cm_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["cm_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "propertyType":
                                     // so it wont go to the default loop. so that propertyType can refresh from the GET input
                                     break;
                                 default:
                                     //echo $key."=>".$value."<br>";
                                     $this->formArray[$key] = $value;
                             }
                         }
                     }
                 }
             } else {
                 $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                 if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                     // xml failed
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         // domDoc empty
                     } else {
                         $afs = new AFS();
                         $afs->parseDomDocument($domDoc);
                         $this->formArray["taxDeclarationNumber"] = $afs->getARPNumber();
                         $this->formArray["odID"] = $afs->getOdID();
                         // default cancelsTDNumber and canceledByTDNumber
                         $cancelsTDNumberArray = $this->getCancelsTDNumberArray();
                         if (is_array($cancelsTDNumberArray)) {
                             $this->formArray["cancelsTDNumber"] = implode(", ", $cancelsTDNumberArray);
                         }
                         $canceledByTDNumberArray = $this->getCanceledByTDNumberArray();
                         if (is_array($canceledByTDNumberArray)) {
                             $this->formArray["canceledByTDNumber"] = implode(", ", $canceledByTDNumberArray);
                         }
                         // default memoranda from properties
                         $this->formArray["memoranda"] = "";
                         if (is_array($afs->landArray)) {
                             if (is_object($afs->landArray[0])) {
                                 if ($afs->landArray[0]->memoranda != "") {
                                     $this->formArray["memoranda"] .= "Land Memo:\n" . $afs->landArray[0]->memoranda;
                                 }
                             }
                         }
                         if (is_array($afs->plantsTreesArray)) {
                             if (is_object($afs->plantsTreesArray[0])) {
                                 if ($afs->plantsTreesArray[0]->memoranda != "") {
                                     $this->formArray["memoranda"] .= "\nPlants Trees Memo:\n" . $afs->plantsTreesArray[0]->memoranda;
                                 }
                             }
                         }
                         if (is_array($afs->improvementsBuildingsArray)) {
                             if (is_object($afs->improvementsBuildingsArray[0])) {
                                 if ($afs->improvementsBuildingsArray[0]->memoranda != "") {
                                     $this->formArray["memoranda"] .= "\nImprovements/Buildings Memo:\n" . $afs->improvementsBuildingsArray[0]->memoranda;
                                 }
                             }
                         }
                         if (is_array($afs->machineriesArray)) {
                             if (is_object($afs->machineriesArray[0])) {
                                 if ($afs->machineriesArray[0]->memoranda != "") {
                                     $this->formArray["memoranda"] .= "\nMachineries Memo:\n" . $afs->machineriesArray[0]->memoranda;
                                 }
                             }
                         }
                     }
                 }
             }
             $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock");
             $this->tpl->set_var("odIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("tdID" => $this->formArray["tdID"], "propertyType" => $this->formArray["propertyType"], "propertyID" => $this->formArray["propertyID"], "afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }