コード例 #1
0
ファイル: PrintLandFAAS.php プロジェクト: armic/erpts
 function displayPlantsTreesList($plantsTreesList)
 {
     $plantTotal = 0;
     if (count($plantsTreesList)) {
         $p = 0;
         $plantitems = '';
         $adjcount = $this->formArray["adjcount"];
         $adjfact = '';
         $percadj = 0;
         $markval = 0;
         $valuadj = 0;
         $adjmark = 0;
         $summcount = $this->formArray["summcount"];
         $summuse = '';
         $summadj = 0;
         $summlvl = 0;
         $summasv = 0;
         foreach ($plantsTreesList as $key => $plantsTrees) {
             if ($this->pl == 0) {
                 //$this->formArray["arpNumber"] = $plantsTrees->getArpNumber();
                 //$this->formArray["propertyIndexNumber"] = $plantsTrees->getPropertyIndexNumber();
                 $this->formArray["surveyNumber"] = $plantsTrees->getSurveyNumber();
                 //$this->formArray["taxability"] = $plantsTrees->getTaxability();
                 //$this->formArray["effectivity"] = $plantsTrees->getEffectivity();
                 $this->formArray["memoranda"] = $plantsTrees->getMemoranda();
                 if (is_a($plantsTrees->propertyAdministrator, Person)) {
                     $this->formArray["administrator"] = $plantsTrees->propertyAdministrator->getFullName();
                     if (is_a($plantsTrees->propertyAdministrator->addressArray[0], "address")) {
                         $address1 = $plantsTrees->propertyAdministrator->addressArray[0]->getNumber();
                         $address1 .= " " . $plantsTrees->propertyAdministrator->addressArray[0]->getStreet();
                         $address1 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getBarangay();
                         $address2 = $plantsTrees->propertyAdministrator->addressArray[0]->getDistrict();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getMunicipalityCity();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getProvince();
                         $this->formArray["adminAddress1"] = $address1;
                         $this->formArray["adminAddress2"] = $address2;
                     }
                     $this->formArray["adminTelno"] = $plantsTrees->propertyAdministrator->getTelephone();
                 }
                 if ($this->recommendingApproval == "") {
                     if (is_numeric($plantsTrees->recommendingApproval)) {
                         $recommendingApproval = new Person();
                         $recommendingApproval->selectRecord($plantsTrees->recommendingApproval);
                         $this->formArray["recommendingApproval"] = $recommendingApproval->getFullName();
                         $this->recommendingApproval = $recommendingApproval->getFullName();
                     } else {
                         $recommendingApproval = $land->recommendingApproval;
                         $this->formArray["recommendingApproval"] = $recommendingApproval;
                         $this->recommendingApproval = $recommendingApproval;
                     }
                 }
                 $this->formArray["dateRecommendingApproval"] = $plantsTrees->getRecommendingApprovalDate();
                 if ($this->approvedBy == "") {
                     if (is_numeric($plantsTrees->approvedBy)) {
                         $approvedBy = new Person();
                         $approvedBy->selectRecord($plantsTrees->approvedBy);
                         $this->formArray["approvedBy"] = $approvedBy->getFullName();
                         $this->approvedBy = $approvedBy->getFullName();
                     } else {
                         $approvedBy = $approvedBy->recommendingApproval;
                         $this->formArray["approvedBy"] = $approvedBy;
                         $this->approvedBy = $approvedBy;
                     }
                 }
                 $this->formArray["dateApprovedBy"] = $plantsTrees->getApprovedByDate();
             }
             if ($p < 14) {
                 $this->formArray["plantstart"] -= 17;
                 $offset = $this->formArray["plantstart"];
                 // productClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 if (is_numeric($plantsTrees->getProductClass())) {
                     $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                     $this->formArray["productClass" . ($p + 1)] = $plantsTreesClasses->getDescription();
                 } else {
                     $this->formArray["productClass" . ($p + 1)] = $plantsTrees->getProductClass();
                 }
                 $plantitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $this->formArray["productClass" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["areaPlanted" . ($p + 1)] = $plantsTrees->getAreaPlanted();
                 $plantitems .= '<textitem xpos="228" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["areaPlanted" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["totalNumber" . ($p + 1)] = $plantsTrees->getTotalNumber();
                 $plantitems .= '<textitem xpos="290" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["totalNumber" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["nonFruit" . ($p + 1)] = $plantsTrees->getNonFruitBearing();
                 $plantitems .= '<textitem xpos="342" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["nonFruit" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["fruit" . ($p + 1)] = $plantsTrees->getFruitBearing();
                 $plantitems .= '<textitem xpos="380" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["fruit" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["age" . ($p + 1)] = $plantsTrees->getAge();
                 $plantitems .= '<textitem xpos="426" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["age" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["unitPrice" . ($p + 1)] = $plantsTrees->getUnitPrice();
                 $plantitems .= '<textitem xpos="482" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . $this->formArray["unitPrice" . ($p + 1)] . '</textitem>' . "\r\n";
                 $this->formArray["plantMrktVal" . ($p + 1)] = $plantsTrees->getMarketValue();
                 $plantitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($plantsTrees->getMarketValue(), 2) . '</textitem>' . "\r\n";
                 $plantitems .= '<lineitem x1="50" y1="' . ($offset - 6) . '" x2="550" y2="' . ($offset - 6) . '">blurb</lineitem>';
                 $plantTotal = $plantTotal + toFloat($plantsTrees->getMarketValue());
             }
             if ($this->pl < 14) {
                 if ($percadj != (double) $plantsTrees->getPercentAdjustment()) {
                     if ($markval > 0) {
                         $adjcount++;
                         $this->formArray["adjstart"] -= 16;
                         $offset = $this->formArray["adjstart"];
                         $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . '   (P)' . '</textitem>' . "\r\n";
                         $adjitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $adjfact . '</textitem>' . "\r\n";
                         $adjitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($percadj, 2) . '</textitem>' . "\r\n";
                         $adjitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($valuadj, 2) . '</textitem>' . "\r\n";
                         $adjitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($adjmark, 2) . '</textitem>' . "\r\n";
                         $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
                     }
                     $percadj = (double) $plantsTrees->getPercentAdjustment();
                     $adjfact = $plantsTrees->getAdjustmentFactor();
                     $markval = 0;
                     $valuadj = 0;
                     $adjmark = 0;
                 }
                 $markval += (double) $plantsTrees->getMarketValue();
                 $valuadj += (double) $plantsTrees->getValueAdjustment();
                 $adjmark += (double) $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["valAdjFacMrktVal" . ($this->pl + 1)] = $plantsTrees->getMarketValue();
                 $this->formArray["adjFacTxt" . ($this->pl + 1)] = $plantsTrees->getAdjustmentFactor();
                 $this->formArray["adjFacInt" . ($this->pl + 1)] = "P";
                 $this->formArray["adjustment" . ($this->pl + 1)] = $plantsTrees->getPercentAdjustment();
                 $this->formArray["valueAdjustment" . ($this->pl + 1)] = $plantsTrees->getValueAdjustment();
                 $this->formArray["valAdjFacAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["valAdjFacTotal"] = $this->formArray["valAdjFacTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
             }
             if ($this->pl < 14) {
                 $this->formArray["kind" . ($this->pl + 1)] = $plantsTrees->getKind();
                 // actualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 //if(is_numeric($plantsTrees->getActualUse())){
                 $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                 $this->formArray["propertyActualUse" . ($this->p + 1)] = $plantsTreesActualUses->getDescription();
                 //}
                 //else{
                 //	$this->formArray["propertyActualUse".($this->p+1)] = $plantsTrees->getActualUse();
                 //}
                 $this->formArray["propertyAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["level" . ($this->pl + 1)] = $plantsTrees->getAssessmentLevel();
                 $this->formArray["assessedValue" . ($this->pl + 1)] = $plantsTrees->getAssessedValue();
                 $this->formArray["propertyAdjMrktValTotal"] = $this->formArray["propertyAdjMrktValTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
                 $this->formArray["propertyTotal"] = $this->formArray["propertyTotal"] + toFloat($plantsTrees->getAssessedValue());
                 if ($summuse != $plantsTreesActualUses->getDescription()) {
                     if ($summasv > 0) {
                         $summcount++;
                         $this->formArray["summstart"] -= 14;
                         $offset = $this->formArray["summstart"];
                         $summitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . 'IMPROVEMENTS' . '</textitem>' . "\r\n";
                         $summitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . htmlentities($summuse) . '</textitem>' . "\r\n";
                         $summitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summadj, 2) . '</textitem>' . "\r\n";
                         $summitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summlvl, 2) . '</textitem>' . "\r\n";
                         $summitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summasv, 2) . '</textitem>' . "\r\n";
                         $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
                     }
                     $summuse = $plantsTreesActualUses->getDescription();
                     $summlvl = (double) $plantsTrees->getAssessmentLevel();
                     $summadj = 0;
                     $summasv = 0;
                 }
                 $summadj += (double) $plantsTrees->getAdjustedMarketValue();
                 /*
                 					$fp=fopen("/home/site/log/landfaas.txt","a");
                 					fwrite($fp,$plantsTrees->getAssessedValue());
                 					fclose($fp);
                 */
                 $summasv += (double) str_replace(",", "", $plantsTrees->getAssessedValue());
             }
             $p++;
             $this->pl++;
         }
         if ($markval > 0) {
             $adjcount++;
             $this->formArray["adjstart"] -= 16;
             $offset = $this->formArray["adjstart"];
             $adjitems .= '<textitem xpos="147" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($markval, 2) . '   (P)' . '</textitem>' . "\r\n";
             $adjitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . $adjfact . '</textitem>' . "\r\n";
             $adjitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($percadj, 2) . '</textitem>' . "\r\n";
             $adjitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($valuadj, 2) . '</textitem>' . "\r\n";
             $adjitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($adjmark, 2) . '</textitem>' . "\r\n";
             $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
         }
         if ($summasv > 0) {
             $summcount++;
             $this->formArray["summstart"] -= 14;
             $offset = $this->formArray["summstart"];
             $summitems .= '<textitem xpos="55" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . 'IMPROVEMENTS' . '</textitem>' . "\r\n";
             $summitems .= '<textitem xpos="155" ypos="' . $offset . '" font="Helvetica" size="8" align="left">' . htmlentities($summuse) . '</textitem>' . "\r\n";
             $summitems .= '<textitem xpos="405" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summadj, 2) . '</textitem>' . "\r\n";
             $summitems .= '<textitem xpos="475" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summlvl, 2) . '</textitem>' . "\r\n";
             $summitems .= '<textitem xpos="545" ypos="' . $offset . '" font="Helvetica" size="8" align="right">' . number_format($summasv, 2) . '</textitem>' . "\r\n";
             $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
         }
         for ($pp = $p; $pp < 14; $pp++) {
             $this->formArray["plantstart"] -= 17;
             $offset = $this->formArray["plantstart"];
             $plantitems .= '<lineitem x1="50" y1="' . ($offset - 6) . '" x2="550" y2="' . ($offset - 6) . '">blurb</lineitem>';
         }
         for ($ll = $adjcount; $ll < 8; $ll++) {
             $this->formArray["adjstart"] -= 16;
             $offset = $this->formArray["adjstart"];
             $adjitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
         }
         for ($ll = $summcount; $ll < 8; $ll++) {
             $this->formArray["summstart"] -= 16;
             $offset = $this->formArray["summstart"];
             $summitems .= '<lineitem x1="50" y1="' . ($offset - 5) . '" x2="550" y2="' . ($offset - 5) . '">blurb</lineitem>';
         }
         $this->formArray["adjcount"] += $adjcount;
         $this->formArray["adjitems"] .= $adjitems;
         $this->formArray["summitems"] .= $summitems;
         $this->formArray["plantitems"] = $plantitems;
     }
     $this->formArray["plantTotal"] = $plantTotal;
 }
コード例 #2
0
ファイル: RPTOPAFSDetails.php プロジェクト: armic/erpts
 function displayPlantsTreesList($plantsTreesList)
 {
     $this->tpl->set_block("rptsTemplate", "PlantsTreesDBEmpty", "PlantsTreesDBEmptyBlock");
     $this->tpl->set_var("PlantsTreesDBEmptyBlock", "");
     $this->tpl->set_block("rptsTemplate", "defaultPlantsTreesList", "defaultPlantsTreesListBlock");
     $this->tpl->set_block("rptsTemplate", "togglePlantsTreesList", "togglePlantsTreesListBlock");
     if (count($plantsTreesList)) {
         //$this->tpl->set_block("rptsTemplate", "hidePlantsTreesList", "hidePlantsTreesListBlock");
         $this->tpl->set_block("rptsTemplate", "PlantsTreesList", "PlantsTreesListBlock");
         $i = 0;
         $totalMarketValue = 0;
         $totalAssessedValue = 0;
         foreach ($plantsTreesList as $key => $value) {
             $totalMarketValue += tofloat($value->getAdjustedMarketValue());
             $totalAssessedValue += tofloat($value->getAssessedValue());
             $this->displayDetails($value);
             foreach ($value as $lkey => $lvalue) {
                 if (is_numeric($lvalue)) {
                     switch ($lkey) {
                         case "productClass":
                             $plantsTreesClasses = new PlantsTreesClasses();
                             $plantsTreesClasses->selectRecord($lvalue);
                             $this->tpl->set_var("productClass", $plantsTreesClasses->getDescription());
                             break;
                         case "actualUse":
                             $plantsTreesActualUses = new PlantsTreesActualUses();
                             $plantsTreesActualUses->selectRecord($lvalue);
                             $this->tpl->set_var("actualUse", $plantsTreesActualUses->getDescription());
                             break;
                     }
                 }
             }
             $this->tpl->set_var("ctr", $i);
             $this->tpl->parse("defaultPlantsTreesListBlock", "defaultPlantsTreesList", true);
             $this->tpl->parse("togglePlantsTreesListBlock", "togglePlantsTreesList", true);
             //$this->tpl->parse("hidePlantsTreesListBlock", "hidePlantsTreesList", true);
             $this->setPlantsTreesListBlockPerms();
             $this->tpl->parse("PlantsTreesListBlock", "PlantsTreesList", true);
             $i++;
         }
         $this->formArray["totalMarketValue"] += $totalMarketValue;
         $this->formArray["totalAssessedValue"] += $totalAssessedValue;
         $this->formArray["plantTotalMarketValue"] = $totalMarketValue;
         $this->formArray["plantTotalAssessedValue"] = $totalAssessedValue;
         $this->tpl->set_var("plantsTreesCtr", $i);
     } else {
         $this->tpl->set_var("defaultPlantsTreesListBlock", "");
         $this->tpl->set_var("togglePlantsTreesListBlock", "");
     }
 }
コード例 #3
0
ファイル: PrintTDsumm.php プロジェクト: armic/erpts
 function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList)
 {
     $totalMarketValue = 0;
     $totalAssessedValue = 0;
     $totalArea = 0;
     // RC 20091008
     $nLandTotalAssessedValue = 0;
     $nLandTotalAdjustedMarketValue = 0;
     $nLandTotalArea = 0;
     $nPlantsTotalAssessedValue = 0;
     $nPlantsTotalAdjustedMarketValue = 0;
     $nBuildingsTotalAssessedValue = 0;
     $nBuildingsTotalAdjustedMarketValue = 0;
     $nBuildingsTotalArea = 0;
     // RC 20091008
     $nMachineriesTotalAssessedValue = 0;
     $nMachineriesTotalAdjustedMarketValue = 0;
     $swornLandTotal = 0;
     $swornImprovementTotal = 0;
     $swornOverallTotal = 0;
     $i = 1;
     $flag = 0;
     $counter = 0;
     $summlvl = 0;
     $summuse = "";
     $summcla = "";
     //RC 20091001  for summary total by Use & level
     if (count($landList)) {
         $this->formArray["kindIsLand"] = "X";
         // RC 20091006
         foreach ($landList as $key => $land) {
             if ($i < 5) {
                 // classification
                 $landClasses = new LandClasses();
                 if (is_numeric($land->getClassification())) {
                     $landClasses->selectRecord($land->getClassification());
                     $landClassesDescription = $landClasses->getDescription();
                     $landClassesCode = $landClasses->getCode();
                 } else {
                     $landClassesDescription = $land->getClassification();
                     $landClassesCode = $land->getClassification();
                 }
                 // subClass
                 $landSubclasses = new LandSubclasses();
                 if (is_numeric($land->getSubClass())) {
                     $landSubclasses->selectRecord($land->getSubClass());
                     $landSubclassesDescription = $landSubclasses->getDescription();
                     $landSubclassesCode = $landSubclasses->getCode();
                 } else {
                     $landSubclassesDescription = $land->getSubClass();
                     $landSubclassesCode = $land->getSubClass();
                 }
                 // actualUse
                 $landActualUses = new LandActualUses();
                 if (is_numeric($land->getActualUse())) {
                     $landActualUses->selectRecord($land->getActualUse());
                     $landActualUsesDescription = $landActualUses->getDescription();
                     $landActualUsesCode = $landActualUses->getCode();
                 } else {
                     $landActualUsesDescription = $land->getActualUse();
                     $landActualUsesCode = $land->getActualUse();
                 }
                 // add pre new
                 if ($landActualUsesCode == "RE" || $landActualUsesCode == "COM" || $landActualUsesCode == "IND" || $landActualUsesCode == "MI" || $landActualUsesCode == "TI" || $landActualUsesCode == "SP") {
                     $tempname = $landActualUsesDescription;
                     $counter += 1;
                 }
                 // end of2 add
                 $totalMarketValue += toFloat($land->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($land->getAssessedValue());
                 $swornLandTotal += toFloat($land->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($land->getAdjustedMarketValue());
                 // display the summary of lands value
                 if ($counter > 0) {
                     $this->formArray["propertyActualUse" . $i] = $tempname;
                 } else {
                     $this->formArray["propertyActualUse" . $i] = "Agricultural";
                 }
                 //RC 20091001 To properly report summary by Actual Use and Level
                 $thislvl = $land->getAssessmentLevel();
                 $thisuse = $landActualUsesDescription;
                 if ($summuse == '') {
                     //RC first record
                     $summlvl = $thislvl;
                     $summuse = $thisuse;
                     $summcla = $landClassesDescription;
                     $nLandTotalArea = 0;
                     $nLandTotalAssessedValue = 0;
                     $nLandTotalAdjustedMarketValue = 0;
                 }
                 if ($summlvl != $thislvl || $summuse != $thisuse) {
                     //RC print if new assessment level or new actual use
                     $this->formArray["propertyKind" . $i] = "Land";
                     $this->formArray["classification" . $i] = $summcla;
                     $this->formArray["propertyActualUse" . $i] = $summuse;
                     $this->formArray["findingsTotalArea" . $i] = $nLandTotalArea;
                     $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue;
                     $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%";
                     $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue;
                     $i++;
                     $nLandTotalAssessedValue = 0;
                     $nLandTotalAdjustedMarketValue = 0;
                     $nLandTotalArea = 0;
                     $summlvl = $thislvl;
                     $summuse = $thisuse;
                     $summcla = $landClassesDescription;
                 }
                 $nLandTotalAssessedValue += toFloat($land->getAssessedValue());
                 $nLandTotalAdjustedMarketValue += toFloat($land->getAdjustedMarketValue());
                 $nLandTotalArea += toFloat($land->getArea());
             }
         }
         $this->formArray["propertyKind" . $i] = "Land";
         $this->formArray["classification" . $i] = $summcla;
         $this->formArray["propertyActualUse" . $i] = $summuse;
         $this->formArray["findingsTotalArea" . $i] = $nLandTotalArea;
         $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%";
         $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue;
         $i++;
         // end of summary of lands
     }
     if (count($plantsTreesList)) {
         $this->formArray["kindIsOthers"] = "X";
         // RC 20091006
         foreach ($plantsTreesList as $key => $plantsTrees) {
             if ($i < 5) {
                 // productClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 if (is_numeric($plantsTrees->getProductClass())) {
                     $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                     $plantsTreesClassesDescription = $plantsTreesClasses->getDescription();
                     $plantsTreesClassesCode = $plantsTreesClasses->getCode();
                 } else {
                     $plantsTreesClassesDescription = $plantsTrees->getProductClass();
                     $plantsTreesClassesCode = $plantsTrees->getProductClass();
                 }
                 // actualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 if (is_numeric($plantsTrees->getActualUse())) {
                     $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                     $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription();
                     $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode();
                 } else {
                     $plantsTreesActualUsesDescription = $plantsTrees->getActualUse();
                     $plantsTreesActualUsesCode = $plantsTrees->getActualUse();
                 }
                 //$this->formArray["propertyKind".($i+1)] = "PlantsTrees";
                 //$this->formArray["propertyActualUse".($i+1)] =$plantsTreesActualUsesDescription;
                 //$this->formArray["propertyMarketValue".($i+1)] =$plantsTrees->getAdjustedMarketValue();
                 //$this->formArray["propertyAssessmentLevel".($i+1)] = $plantsTrees->getAssessmentLevel();
                 //$this->formArray["propertyAssessedValue".($i+1)] = $plantsTrees->getAssessedValue();
                 $totalMarketValue += toFloat($plantsTrees->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($plantsTrees->getAssessedValue());
                 $nPlantsTotalAssessedValue += toFloat($plantsTrees->getAssessedValue());
                 $nPlantsTotalAdjustedMarketValue += toFloat($plantsTrees->getAdjustedMarketValue());
                 $swornLandTotal += toFloat($plantsTrees->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($plantsTrees->getAdjustedMarketValue());
                 //$i++;
             }
         }
         $this->formArray["propertyKind" . $i] = "PlantTrees";
         //inserted May 31, 2008
         $this->formArray["classification" . $i] = $plantsTreesClassesDescription;
         $this->formArray["propertyActualUse" . $i] = $plantsTreesActualUsesDescription;
         $this->formArray["propertyMarketValue" . $i] = $nPlantsTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $plantsTrees->getAssessmentLevel();
         $this->formArray["propertyAssessedValue" . $i] = $nPlantsTotalAssessedValue;
         $i++;
         // additional new line for total of LAND AND PLANT TREES
         //		$nSwornLandTotal =$nPlantsTotalAdjustedMarketValue + $nLandTotalAdjustedMarketValue;
         //		$this->formArray["swornLandTotal"] =$nSwornLandTotal; //number_format($nSwornLandTotal,2);
         // END
     }
     if (count($improvementsBuildingsList)) {
         $this->formArray["kindIsBuilding"] = "X";
         // RC 20091006
         //			$this->formArray["numberOfStoreys"] = $improvementsBuildings->getNumberOfStoreys();
         $nBuildingTotalArea = 0;
         $nBuildingTotalAssessedValue = 0;
         $nBuildingTotalAdjustedMarketValue = 0;
         foreach ($improvementsBuildingsList as $key => $improvementsBuildings) {
             if ($i < 5) {
                 // buildingClassification
                 $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                 if (is_numeric($improvementsBuildings->getBuildingClassification())) {
                     $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification());
                     $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription();
                     $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode();
                 } else {
                     $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification();
                     $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification();
                 }
                 // actualUse
                 $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                 if (is_numeric($improvementsBuildings->getActualUse())) {
                     $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse());
                     $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription();
                     $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode();
                 } else {
                     $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse();
                     $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse();
                 }
                 $totalMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue());
                 $totalArea += $improvementsBuildings->getTotalBuildingArea();
                 // RC 20091008
                 $thislvl = $improvementsBuildings->getAssessmentLevel();
                 $thisuse = $improvementsBuildingsActualUsesDescription;
                 if ($summuse == '') {
                     //RC first record
                     $summlvl = $thislvl;
                     $summuse = $thisuse;
                     $summcla = $improvementsBuildingsClassesDescription;
                 }
                 if ($summlvl != $thislvl || $summuse != $thisuse) {
                     //RC print if new assessment level or new actual use
                     $this->formArray["propertyKind" . $i] = "Land";
                     $this->formArray["classification" . $i] = $summcla;
                     $this->formArray["propertyActualUse" . $i] = $summuse;
                     $this->formArray["findingsTotalArea" . $i] = $nBuildingTotalArea;
                     $this->formArray["propertyMarketValue" . $i] = $nBuildingTotalAdjustedMarketValue;
                     $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%";
                     $this->formArray["propertyAssessedValue" . $i] = $nBuildingTotalAssessedValue;
                     $i++;
                     $nBuildingTotalAssessedValue = 0;
                     $nBuildingTotalAdjustedMarketValue = 0;
                     $nBuildingTotalArea = 0;
                     $summlvl = $thislvl;
                     $summuse = $thisuse;
                     $summcla = $improvementsBuildingsClassesDescription;
                 }
                 $nBuildingTotalAssessedValue += toFloat($improvementsBuildings->getAssessedValue());
                 $nBuildingTotalAdjustedMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue());
                 $nBuildingTotalArea += toFloat($improvementsBuildings->getTotalBuildingArea());
                 $swornImprovementTotal += toFloat($improvementsBuildings->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($improvementsBuildings->getAdjustedMarketValue());
             }
         }
         $this->formArray["propertyKind" . $i] = "ImprovementsBuildings";
         $this->formArray["classification" . $i] = $improvementsBuildingsClassesDescription;
         $this->formArray["propertyActualUse" . $i] = $improvementsBuildingsActualUsesDescription;
         $this->formArray["findingsTotalArea" . $i] = $nBuildingTotalArea;
         $this->formArray["propertyMarketValue" . $i] = $nBuildingTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $improvementsBuildings->getAssessmentLevel() . "%";
         $this->formArray["propertyAssessedValue" . $i] = $nBuildingTotalAssessedValue;
         $i++;
         $this->formArray["findingsTotalArea"] = $totalArea;
         //RC 20091008
     }
     if (count($machineriesList)) {
         $this->formArray["kindIsMachinery"] = "X";
         // RC 20091006
         foreach ($machineriesList as $key => $machineries) {
             if ($i < 5) {
                 // kind
                 $machineriesClasses = new MachineriesClasses();
                 if (is_numeric($machineries->getKind())) {
                     $machineriesClasses->selectRecord($machineries->getKind());
                     $machineriesClassesDescription = $machineriesClasses->getDescription();
                     $machineriesClassesCode = $machineriesClasses->getCode();
                 } else {
                     $machineriesClassesDescription = $machineries->getKind();
                     $machineriesClassesCode = $machineries->getActualUse();
                 }
                 // actualUse
                 $machineriesActualUses = new MachineriesActualUses();
                 if (is_numeric($machineries->getActualUse())) {
                     $machineriesActualUses->selectRecord($machineries->getActualUse());
                     $machineriesActualUsesDescription = $machineriesActualUses->getDescription();
                     $machineriesActualUsesCode = $machineriesActualUses->getCode();
                 } else {
                     $machineriesActualUsesDescription = $machineries->getActualUse();
                     $machineriesActualUsesCode = $machineries->getActualUse();
                 }
                 $totalMarketValue += toFloat($machineries->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($machineries->getAssessedValue());
                 $nMachineriesTotalAssessedValue += toFloat($machineries->getAssessedValue());
                 $nMachineriesTotalAdjustedMarketValue += toFloat($machineries->getAdjustedMarketValue());
                 $swornImprovementTotal += toFloat($machineries->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($machineries->getAdjustedMarketValue());
                 //			$i++;
             }
         }
         $this->formArray["propertyKind" . $i] = "Machineries";
         $this->formArray["classification" . $i] = $machineriesClassesDescription;
         $this->formArray["propertyActualUse" . $i] = $machineriesActualUsesDescription;
         $this->formArray["propertyMarketValue" . $i] = $nMachineriesTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $machineries->getAssessmentLevel();
         $this->formArray["propertyAssessedValue" . $i] = $nMachineriesTotalAssessedValue;
         $i++;
     }
     // add pre hehe for sworn statement total and machineries
     $this->formArray["swornLandTotal"] = $swornLandTotal;
     $this->formArray["swornImprovementTotal"] = $swornImprovementTotal;
     $this->formArray["swornOverallTotal"] = $swornOverallTotal;
     //	$nSwornImprovementTotal =$nMachineriesTotalAdjustedMarketValue + $nBuildingsTotalAdjustedMarketValue;
     //	$this->formArray["swornImprovementTotal"] =$nSwornImprovementTotal;
     //	$nSwornOverallTotal =$nSwornImprovementTotal + $nSwornLandTotal;
     //	$this->formArray["swornOverallTotal"] =$nSwornOverallTotal;
     // end
     $this->formArray["totalMarketValue"] = $totalMarketValue;
     $this->formArray["totalAssessedValue"] = $totalAssessedValue;
     $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue);
 }
コード例 #4
0
ファイル: PrintTDsumm.php プロジェクト: armic/erpts
 function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList)
 {
     $totalMarketValue = 0;
     $totalAssessedValue = 0;
     $nLandTotalAssessedValue = 0;
     $nLandTotalAdjustedMarketValue = 0;
     $nPlantsTotalAssessedValue = 0;
     $nPlantsTotalAdjustedMarketValue = 0;
     $nBuildingsTotalAssessedValue = 0;
     $nBuildingsTotalAdjustedMarketValue = 0;
     $nMachineriesTotalAssessedValue = 0;
     $nMachineriesTotalAdjustedMarketValue = 0;
     $swornLandTotal = 0;
     $swornImprovementTotal = 0;
     $swornOverallTotal = 0;
     $i = 1;
     $flag = 0;
     $counter = 0;
     if (count($landList)) {
         foreach ($landList as $key => $land) {
             if ($i < 5) {
                 // classification
                 $landClasses = new LandClasses();
                 if (is_numeric($land->getClassification())) {
                     $landClasses->selectRecord($land->getClassification());
                     $landClassesDescription = $landClasses->getDescription();
                     $landClassesCode = $landClasses->getCode();
                 } else {
                     $landClassesDescription = $land->getClassification();
                     $landClassesCode = $land->getClassification();
                 }
                 // subClass
                 $landSubclasses = new LandSubclasses();
                 if (is_numeric($land->getSubClass())) {
                     $landSubclasses->selectRecord($land->getSubClass());
                     $landSubclassesDescription = $landSubclasses->getDescription();
                     $landSubclassesCode = $landSubclasses->getCode();
                 } else {
                     $landSubclassesDescription = $land->getSubClass();
                     $landSubclassesCode = $land->getSubClass();
                 }
                 // actualUse
                 $landActualUses = new LandActualUses();
                 if (is_numeric($land->getActualUse())) {
                     $landActualUses->selectRecord($land->getActualUse());
                     $landActualUsesDescription = $landActualUses->getDescription();
                     $landActualUsesCode = $landActualUses->getCode();
                 } else {
                     $landActualUsesDescription = $land->getActualUse();
                     $landActualUsesCode = $land->getActualUse();
                 }
                 // add pre new hehe
                 if ($landActualUsesCode == "RES" || $landActualUsesCode == "COM" || $landActualUsesCode == "IND" || $landActualUsesCode == "MI" || $landActualUsesCode == "TI" || $landActualUsesCode == "SP") {
                     $tempname = $landActualUsesDescription;
                     $counter += 1;
                 }
                 // end of add hehe
                 $totalMarketValue += toFloat($land->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($land->getAssessedValue());
                 $nLandTotalAssessedValue += toFloat($land->getAssessedValue());
                 $nLandTotalAdjustedMarketValue += toFloat($land->getAdjustedMarketValue());
                 $swornLandTotal += toFloat($land->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($land->getAdjustedMarketValue());
                 //			$this->formArray["propertyKind".($i)] = "Land";
                 //			$this->formArray["propertyActualUse".($i)] = $landActualUsesDescription;
                 //			$this->formArray["propertyMarketValue".($i)] = $land->getAdjustedMarketValue();
                 //			$this->formArray["propertyAssessmentLevel".($i)] = $land->getAssessmentLevel();
                 //			$this->formArray["propertyAssessedValue".($i)] = $land->getAssessedValue();
                 //				 $totalMarketValue+=toFloat($land->getAdjustedMarketValue());
                 //				 $totalAssessedValue+=toFloat($land->getAssessedValue());
                 //$i++;
             }
         }
         //}
         // display the summary of lands value
         if ($counter > 0) {
             $this->formArray["propertyActualUse" . $i] = $tempname;
         } else {
             $this->formArray["propertyActualUse" . $i] = "Agricultural";
         }
         $this->formArray["propertyKind" . $i] = "Land";
         //		$this->formArray["propertyActualUse".($i)] = "Agricultural";
         $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $land->getAssessmentLevel();
         $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue;
         $i++;
         // end of summary of lands
     }
     if (count($plantsTreesList)) {
         foreach ($plantsTreesList as $key => $plantsTrees) {
             if ($i < 5) {
                 // productClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 if (is_numeric($plantsTrees->getProductClass())) {
                     $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                     $plantsTreesClassesDescription = $plantsTreesClasses->getDescription();
                     $plantsTreesClassesCode = $plantsTreesClasses->getCode();
                 } else {
                     $plantsTreesClassesDescription = $plantsTrees->getProductClass();
                     $plantsTreesClassesCode = $plantsTrees->getProductClass();
                 }
                 // actualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 if (is_numeric($plantsTrees->getActualUse())) {
                     $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                     $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription();
                     $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode();
                 } else {
                     $plantsTreesActualUsesDescription = $plantsTrees->getActualUse();
                     $plantsTreesActualUsesCode = $plantsTrees->getActualUse();
                 }
                 //$this->formArray["propertyKind".($i+1)] = "PlantsTrees";
                 //$this->formArray["propertyActualUse".($i+1)] =$plantsTreesActualUsesDescription;
                 //$this->formArray["propertyMarketValue".($i+1)] =$plantsTrees->getAdjustedMarketValue();
                 //$this->formArray["propertyAssessmentLevel".($i+1)] = $plantsTrees->getAssessmentLevel();
                 //$this->formArray["propertyAssessedValue".($i+1)] = $plantsTrees->getAssessedValue();
                 $totalMarketValue += toFloat($plantsTrees->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($plantsTrees->getAssessedValue());
                 $nPlantsTotalAssessedValue += toFloat($plantsTrees->getAssessedValue());
                 $nPlantsTotalAdjustedMarketValue += toFloat($plantsTrees->getAdjustedMarketValue());
                 $swornLandTotal += toFloat($plantsTrees->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($plantsTrees->getAdjustedMarketValue());
                 //$i++;
             }
         }
         $this->formArray["propertyKind" . $i] = "PlantTrees";
         $this->formArray["propertyActualUse" . $i] = $plantsTreesActualUsesDescription;
         $this->formArray["propertyMarketValue" . $i] = $nPlantsTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $plantsTrees->getAssessmentLevel();
         $this->formArray["propertyAssessedValue" . $i] = $nPlantsTotalAssessedValue;
         $i++;
         // additional new line for total of LAND AND PLANT TREES
         //		$nSwornLandTotal =$nPlantsTotalAdjustedMarketValue + $nLandTotalAdjustedMarketValue;
         //		$this->formArray["swornLandTotal"] =$nSwornLandTotal; //number_format($nSwornLandTotal,2);
         // END
     }
     if (count($improvementsBuildingsList)) {
         foreach ($improvementsBuildingsList as $key => $improvementsBuildings) {
             if ($i < 5) {
                 // buildingClassification
                 $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                 if (is_numeric($improvementsBuildings->getBuildingClassification())) {
                     $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification());
                     $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription();
                     $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode();
                 } else {
                     $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification();
                     $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification();
                 }
                 // actualUse
                 $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                 if (is_numeric($improvementsBuildings->getActualUse())) {
                     $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse());
                     $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription();
                     $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode();
                 } else {
                     $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse();
                     $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse();
                 }
                 //$this->formArray["propertyKind".($i+1)] = "ImprovementsBuildings";
                 //$this->formArray["propertyActualUse".($i+1)] = $improvementsBuildingsActualUsesDescription;
                 //$this->formArray["propertyMarketValue".($i+1)] = $improvementsBuildings->getAdjustedMarketValue();
                 //$this->formArray["propertyAssessmentLevel".($i+1)] = $improvementsBuildings->getAssessmentLevel();
                 //$this->formArray["propertyAssessedValue".($i+1)] = $improvementsBuildings->getAssessedValue();
                 $totalMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue());
                 $nBuildingsTotalAssessedValue += toFloat($improvementsBuildings->getAssessedValue());
                 $nBuildingsTotalAdjustedMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue());
                 $swornImprovementTotal += toFloat($improvementsBuildings->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($improvementsBuildings->getAdjustedMarketValue());
                 // $i++;
             }
         }
         $this->formArray["propertyKind" . $i] = "ImprovementsBuildings";
         $this->formArray["propertyActualUse" . $i] = $improvementsBuildingsActualUsesDescription;
         $this->formArray["propertyMarketValue" . $i] = $nBuildingsTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $improvementsBuildings->getAssessmentLevel();
         $this->formArray["propertyAssessedValue" . $i] = $nBuildingsTotalAssessedValue;
         $i++;
     }
     if (count($machineriesList)) {
         foreach ($machineriesList as $key => $machineries) {
             if ($i < 5) {
                 // kind
                 $machineriesClasses = new MachineriesClasses();
                 if (is_numeric($machineries->getKind())) {
                     $machineriesClasses->selectRecord($machineries->getKind());
                     $machineriesClassesDescription = $machineriesClasses->getDescription();
                     $machineriesClassesCode = $machineriesClasses->getCode();
                 } else {
                     $machineriesClassesDescription = $machineries->getKind();
                     $machineriesClassesCode = $machineries->getActualUse();
                 }
                 // actualUse
                 $machineriesActualUses = new MachineriesActualUses();
                 if (is_numeric($machineries->getActualUse())) {
                     $machineriesActualUses->selectRecord($machineries->getActualUse());
                     $machineriesActualUsesDescription = $machineriesActualUses->getDescription();
                     $machineriesActualUsesCode = $machineriesActualUses->getCode();
                 } else {
                     $machineriesActualUsesDescription = $machineries->getActualUse();
                     $machineriesActualUsesCode = $machineries->getActualUse();
                 }
                 //$this->formArray["propertyKind".($i+1)] = "Machineries";
                 //$this->formArray["propertyActualUse".($i+1)] = $machineriesActualUsesDescription;
                 //$this->formArray["propertyMarketValue".($i+1)] = $machineries->getAdjustedMarketValue();
                 //$this->formArray["propertyAssessmentLevel".($i+1)] = $machineries->getAssessmentLevel();
                 //$this->formArray["propertyAssessedValue".($i+1)] = $machineries->getAssessedValue();
                 $totalMarketValue += toFloat($machineries->getAdjustedMarketValue());
                 $totalAssessedValue += toFloat($machineries->getAssessedValue());
                 $nMachineriesTotalAssessedValue += toFloat($machineries->getAssessedValue());
                 $nMachineriesTotalAdjustedMarketValue += toFloat($machineries->getAdjustedMarketValue());
                 $swornImprovementTotal += toFloat($machineries->getAdjustedMarketValue());
                 $swornOverallTotal += toFloat($machineries->getAdjustedMarketValue());
                 //			$i++;
             }
         }
         $this->formArray["propertyKind" . $i] = "Machineries";
         $this->formArray["propertyActualUse" . $i] = $machineriesActualUsesDescription;
         $this->formArray["propertyMarketValue" . $i] = $nMachineriesTotalAdjustedMarketValue;
         $this->formArray["propertyAssessmentLevel" . $i] = $machineries->getAssessmentLevel();
         $this->formArray["propertyAssessedValue" . $i] = $nMachineriesTotalAssessedValue;
         $i++;
     }
     // add pre hehe for sworn statement total and machineries
     $this->formArray["swornLandTotal"] = $swornLandTotal;
     $this->formArray["swornImprovementTotal"] = $swornImprovementTotal;
     $this->formArray["swornOverallTotal"] = $swornOverallTotal;
     //	$nSwornImprovementTotal =$nMachineriesTotalAdjustedMarketValue + $nBuildingsTotalAdjustedMarketValue;
     //	$this->formArray["swornImprovementTotal"] =$nSwornImprovementTotal;
     $grandTotalArea = $findingsTotalArea + $bfindingsFloorArea;
     //	$this->formArray["swornOverallTotal"] =$nSwornOverallTotal;
     // end
     $this->formArray["totalMarketValue"] = $totalMarketValue;
     $this->formArray["totalAssessedValue"] = $totalAssessedValue;
     $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue);
 }
コード例 #5
0
ファイル: PrintLandFAAS.php プロジェクト: armic/erpts
 function displayPlantsTreesList($plantsTreesList)
 {
     $plantTotal = 0;
     if (count($plantsTreesList)) {
         $p = 0;
         foreach ($plantsTreesList as $key => $plantsTrees) {
             if ($this->pl == 0) {
                 //$this->formArray["arpNumber"] = $plantsTrees->getArpNumber();
                 //$this->formArray["propertyIndexNumber"] = $plantsTrees->getPropertyIndexNumber();
                 $this->formArray["surveyNumber"] = $plantsTrees->getSurveyNumber();
                 $this->formArray["taxability"] = $plantsTrees->getTaxability();
                 $this->formArray["effectivity"] = $plantsTrees->getEffectivity();
                 $this->formArray["memoranda"] = $plantsTrees->getMemoranda();
                 if (is_a($plantsTrees->propertyAdministrator, Person)) {
                     $this->formArray["administrator"] = $plantsTrees->propertyAdministrator->getFullName();
                     if (is_a($plantsTrees->propertyAdministrator->addressArray[0], "address")) {
                         $address1 = $plantsTrees->propertyAdministrator->addressArray[0]->getNumber();
                         $address1 .= " " . $plantsTrees->propertyAdministrator->addressArray[0]->getStreet();
                         $address1 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getBarangay();
                         $address2 = $plantsTrees->propertyAdministrator->addressArray[0]->getDistrict();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getMunicipalityCity();
                         $address2 .= ", " . $plantsTrees->propertyAdministrator->addressArray[0]->getProvince();
                         $this->formArray["adminAddress1"] = $address1;
                         $this->formArray["adminAddress2"] = $address2;
                     }
                     $this->formArray["adminTelno"] = $plantsTrees->propertyAdministrator->getTelephone();
                 }
                 if ($this->recommendingApproval == "") {
                     if (is_numeric($plantsTrees->recommendingApproval)) {
                         $recommendingApproval = new Person();
                         $recommendingApproval->selectRecord($plantsTrees->recommendingApproval);
                         $this->formArray["recommendingApproval"] = $recommendingApproval->getFullName();
                         $this->recommendingApproval = $recommendingApproval->getFullName();
                     } else {
                         $recommendingApproval = $land->recommendingApproval;
                         $this->formArray["recommendingApproval"] = $recommendingApproval;
                         $this->recommendingApproval = $recommendingApproval;
                     }
                 }
                 $this->formArray["dateRecommendingApproval"] = $plantsTrees->getRecommendingApprovalDate();
                 if ($this->approvedBy == "") {
                     if (is_numeric($plantsTrees->approvedBy)) {
                         $approvedBy = new Person();
                         $approvedBy->selectRecord($plantsTrees->approvedBy);
                         $this->formArray["approvedBy"] = $approvedBy->getFullName();
                         $this->approvedBy = $approvedBy->getFullName();
                     } else {
                         $approvedBy = $approvedBy->recommendingApproval;
                         $this->formArray["approvedBy"] = $approvedBy;
                         $this->approvedBy = $approvedBy;
                     }
                 }
                 $this->formArray["dateApprovedBy"] = $plantsTrees->getApprovedByDate();
             }
             if ($p < 9) {
                 // productClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 if (is_numeric($plantsTrees->getProductClass())) {
                     $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                     $this->formArray["productClass" . ($p + 1)] = $plantsTreesClasses->getDescription();
                 } else {
                     $this->formArray["productClass" . ($p + 1)] = $plantsTrees->getProductClass();
                 }
                 $this->formArray["areaPlanted" . ($p + 1)] = $plantsTrees->getAreaPlanted();
                 $this->formArray["totalNumber" . ($p + 1)] = $plantsTrees->getTotalNumber();
                 $this->formArray["nonFruit" . ($p + 1)] = $plantsTrees->getNonFruitBearing();
                 $this->formArray["fruit" . ($p + 1)] = $plantsTrees->getFruitBearing();
                 $this->formArray["age" . ($p + 1)] = $plantsTrees->getAge();
                 $this->formArray["unitPrice" . ($p + 1)] = $plantsTrees->getUnitPrice();
                 $this->formArray["plantMrktVal" . ($p + 1)] = $plantsTrees->getMarketValue();
                 $plantTotal = $plantTotal + toFloat($plantsTrees->getMarketValue());
             }
             if ($this->pl < 6) {
                 $this->formArray["valAdjFacMrktVal" . ($this->pl + 1)] = $plantsTrees->getMarketValue();
                 $this->formArray["adjFacTxt" . ($this->pl + 1)] = $plantsTrees->getAdjustmentFactor();
                 $this->formArray["adjFacInt" . ($this->pl + 1)] = "P";
                 $this->formArray["adjustment" . ($this->pl + 1)] = $plantsTrees->getPercentAdjustment();
                 $this->formArray["valueAdjustment" . ($this->pl + 1)] = $plantsTrees->getValueAdjustment();
                 $this->formArray["valAdjFacAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["valAdjFacTotal"] = $this->formArray["valAdjFacTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
             }
             if ($this->pl < 5) {
                 $this->formArray["kind" . ($this->pl + 1)] = $plantsTrees->getKind();
                 // actualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 if (is_numeric($plantsTrees->getActualUse())) {
                     $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                     $this->formArray["propertyActualUse" . ($this->p + 1)] = $plantsTreesActualUses->getDescription();
                 } else {
                     $this->formArray["propertyActualUse" . ($this->p + 1)] = $plantsTrees->getActualUse();
                 }
                 $this->formArray["propertyAdjMrktVal" . ($this->pl + 1)] = $plantsTrees->getAdjustedMarketValue();
                 $this->formArray["level" . ($this->pl + 1)] = $plantsTrees->getAssessmentLevel();
                 $this->formArray["assessedValue" . ($this->pl + 1)] = $plantsTrees->getAssessedValue();
                 $this->formArray["propertyAdjMrktValTotal"] = $this->formArray["propertyAdjMrktValTotal"] + toFloat($plantsTrees->getAdjustedMarketValue());
                 $this->formArray["propertyTotal"] = $this->formArray["propertyTotal"] + toFloat($plantsTrees->getAssessedValue());
             }
             $p++;
             $this->pl++;
         }
     }
     $this->formArray["plantTotal"] = $plantTotal;
 }
コード例 #6
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $this->tpl->set_var("MessageBlock", "");
             $PlantsTreesActualUsesDetails = new SoapObject(NCCBIZ . "PlantsTreesActualUsesDetails.php", "urn:Object");
             if (!($xmlStr = $PlantsTreesActualUsesDetails->getPlantsTreesActualUsesDetails($this->formArray["plantsTreesActualUsesID"]))) {
                 $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 {
                     $plantsTreesActualUses = new PlantsTreesActualUses();
                     $plantsTreesActualUses->parseDomDocument($domDoc);
                     $this->formArray["plantsTreesActualUsesID"] = $plantsTreesActualUses->getPlantsTreesActualUsesID();
                     $this->formArray["code"] = $plantsTreesActualUses->getCode();
                     $this->formArray["reportCode"] = $plantsTreesActualUses->getReportCode();
                     $this->formArray["description"] = $plantsTreesActualUses->getDescription();
                     $this->formArray["value"] = $plantsTreesActualUses->getValue();
                     $this->formArray["status"] = $plantsTreesActualUses->getStatus();
                 }
             }
             break;
         case "save":
             if ($this->codeAlreadyExists() == true) {
                 $this->message = "Error. Cannot Save. Code already exists.";
                 $this->tpl->set_var("message", $this->message);
                 $this->tpl->parse("MessageBlock", "Message", true);
                 break;
             } else {
                 $this->tpl->set_var("MessageBlock", "");
             }
             $PlantsTreesActualUsesEncode = new SoapObject(NCCBIZ . "PlantsTreesActualUsesEncode.php", "urn:Object");
             if ($this->formArray["plantsTreesActualUsesID"] != "") {
                 $PlantsTreesActualUsesDetails = new SoapObject(NCCBIZ . "PlantsTreesActualUsesDetails.php", "urn:Object");
                 if (!($xmlStr = $PlantsTreesActualUsesDetails->getPlantsTreesActualUsesDetails($this->formArray["plantsTreesActualUsesID"]))) {
                     exit("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 {
                         $plantsTreesActualUses = new PlantsTreesActualUses();
                         $plantsTreesActualUses->parseDomDocument($domDoc);
                         $plantsTreesActualUses->setPlantsTreesActualUsesID($this->formArray["plantsTreesActualUsesID"]);
                         $plantsTreesActualUses->setCode($this->formArray["code"]);
                         $plantsTreesActualUses->setReportCode($this->formArray["reportCode"]);
                         $plantsTreesActualUses->setDescription($this->formArray["description"]);
                         $plantsTreesActualUses->setValue($this->formArray["value"]);
                         $plantsTreesActualUses->setStatus($this->formArray["status"]);
                         $plantsTreesActualUses->setDomDocument();
                         $doc = $plantsTreesActualUses->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $PlantsTreesActualUsesEncode->updatePlantsTreesActualUses($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 $plantsTreesActualUses->setPlantsTreesActualUsesID($this->formArray["plantsTreesActualUsesID"]);
                 $plantsTreesActualUses->setCode($this->formArray["code"]);
                 $plantsTreesActualUses->setReportCode($this->formArray["reportCode"]);
                 $plantsTreesActualUses->setDescription($this->formArray["description"]);
                 $plantsTreesActualUses->setValue($this->formArray["value"]);
                 $plantsTreesActualUses->setStatus($this->formArray["status"]);
                 $plantsTreesActualUses->setDomDocument();
                 $doc = $plantsTreesActualUses->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $PlantsTreesActualUsesEncode->savePlantsTreesActualUses($xmlStr))) {
                     exit("error save");
                 }
             }
             $this->formArray["plantsTreesActualUsesID"] = $ret;
             header("location: PlantsTreesActualUsesClose.php" . $this->sess->url("") . $this->sess->add_query(array("plantsTreesActualUsesID" => $ret)));
             //header("location: PlantsTreesActualUsesEncode.php");
             exit;
             break;
         case "cancel":
             header("location: PlantsTreesActualUsesClose.php" . $this->sess->url("") . $this->sess->add_query(array("plantsTreesActualUsesID" => $ret)));
             //header("location: PlantsTreesActualUsesList.php");
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "PlantsTreesActualUsesID", "PlantsTreesActualUsesIDBlock");
             $this->tpl->set_var("PlantsTreesActualUsesIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
             $this->tpl->set_var("MessageBlock", "");
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #7
0
ファイル: PrintTD.php プロジェクト: armic/erpts
 function displayPlantsTreesList($plantsTreesList)
 {
     if (count($plantsTreesList)) {
         $items = '';
         $offset = 410;
         $fp = fopen("/home/site/log/tdplants.log", "w+");
         $mv = 0;
         $al = 0;
         $av = 0;
         foreach ($plantsTreesList as $pkey => $plantsTrees) {
             // productClass
             $plantsTreesClasses = new PlantsTreesClasses();
             if (is_numeric($plantsTrees->getProductClass())) {
                 $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                 $plantsTreesClassesDescription = $plantsTreesClasses->getDescription();
                 $plantsTreesClassesCode = $plantsTreesClasses->getCode();
             } else {
                 $plantsTreesClassesDescription = $plantsTrees->getProductClass();
                 $plantsTreesClassesCode = $plantsTrees->getProductClass();
             }
             $plantAU = new PlantsTreesActualUses();
             if (is_numeric($plantsTrees->getActualUse())) {
                 $plantAU->selectRecord($plantsTrees->getActualUse());
                 $plantActualUse = htmlentities($plantAU->getDescription());
             } else {
                 $plantActualUse = $plantsTrees->getActualUse();
             }
             /*
             //just in case actualUse needs to be drawn from plantsTrees
             
             // actualUse
             $plantsTreesClasses = new PlantsTreesActualUses;
             if(is_numeric($plantsTrees->getActualUse())){
             	$plantsTreesClassess->selectRecord($plantsTrees->getActualUse());
             	$plantsTreesClassesDescription = $plantsTreesActualUses->getDescription();
             	$plantsTreesClassesCode = $plantsTreesActualUses->getCode();
             }
             else{
             	$plantsTreesClassesDescription = $plantsTrees->getActualUse();
             	$plantsTreesClassesCode = $plantsTrees->getActualUse();
             }
             */
             //				if($this->formArray["p"] <= 10){
             $lvl = number_format($plantsTrees->getAssessmentLevel(), 2);
             if ($al != $lvl) {
                 if ($av > 0) {
                     $this->formArray["ypos"] -= 13;
                     $offset = $this->formArray["ypos"];
                     $plantitems .= "<textitem xpos=\"25\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"left\">" . "Plants/Trees" . "</textitem>";
                     $plantitems .= "<textitem xpos=\"115\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"9\" align=\"left\">" . $ld . "</textitem>";
                     $plantitems .= "<textitem xpos=\"337\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($mv, 2) . "</textitem>";
                     $plantitems .= "<textitem xpos=\"430\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($al, 2) . "</textitem>";
                     $plantitems .= "<textitem xpos=\"558\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($av, 2) . "</textitem>";
                     $offsetx = $offset - 3;
                     $plantitems .= "<lineitem x1=\"25\" y1=\"" . $offsetx . "\" x2=\"105\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                     $plantitems .= "<lineitem x1=\"115\" y1=\"" . $offsetx . "\" x2=\"228\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                     $plantitems .= "<lineitem x1=\"244\" y1=\"" . $offsetx . "\" x2=\"337\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                     $plantitems .= "<lineitem x1=\"358\" y1=\"" . $offsetx . "\" x2=\"445\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                     $plantitems .= "<lineitem x1=\"457\" y1=\"" . $offsetx . "\" x2=\"558\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                 }
                 $av = 0;
                 $mv = 0;
                 $al = $lvl;
             }
             $ld = $plantActualUse;
             $mv += $plantsTrees->getAdjustedMarketValue();
             $av += un_number_format($plantsTrees->getAssessedValue());
             $p = $this->formArray["p"];
             $this->formArray["totalMarketValue"] += $plantsTrees->getMarketValue();
             $this->formArray["totalAssessedValue"] += un_number_format($plantsTrees->getAssessedValue());
             $this->formArray["p"]++;
             //				}
         }
         if ($av > 0) {
             $this->formArray["ypos"] -= 13;
             $offset = $this->formArray["ypos"];
             $plantitems .= "<textitem xpos=\"25\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"left\">" . "Plants/Trees" . "</textitem>";
             $plantitems .= "<textitem xpos=\"115\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"9\" align=\"left\">" . $ld . "</textitem>";
             $plantitems .= "<textitem xpos=\"337\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($mv, 2) . "</textitem>";
             $plantitems .= "<textitem xpos=\"430\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($al, 2) . "</textitem>";
             $plantitems .= "<textitem xpos=\"558\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($av, 2) . "</textitem>";
             $offsetx = $offset - 3;
             $plantitems .= "<lineitem x1=\"25\" y1=\"" . $offsetx . "\" x2=\"105\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"115\" y1=\"" . $offsetx . "\" x2=\"228\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"244\" y1=\"" . $offsetx . "\" x2=\"337\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"358\" y1=\"" . $offsetx . "\" x2=\"445\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"457\" y1=\"" . $offsetx . "\" x2=\"558\" y2=\"" . $offsetx . "\">blurb</lineitem>";
         }
         $this->formArray["plantitems"] = $plantitems;
     }
 }
コード例 #8
0
 function Main()
 {
     $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
     $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
     // start batch loop
     $rptopIDArray = $this->formArray["rptopIDArray"];
     foreach ($rptopIDArray as $key => $rptopID) {
         $this->formArray["rptopID"] = $rptopID;
         $this->pageNumber++;
         if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) {
             exit("xml failed");
         } else {
             //echo($xmlStr);
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 exit("error xmlDoc");
             } else {
                 $rptop = new RPTOP();
                 $rptop->parseDomDocument($domDoc);
                 //print_r($rptop);
                 foreach ($rptop as $key => $value) {
                     switch ($key) {
                         case "owner":
                             //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object");
                             if (is_a($value, "Owner")) {
                                 $this->formArray["ownerID"] = $rptop->owner->getOwnerID();
                                 $xmlStr = $rptop->owner->domDocument->dump_mem(true);
                                 if (!$xmlStr) {
                                     // xml failed
                                 } else {
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         // error domdoc
                                     } else {
                                         $this->displayOwnerList($domDoc);
                                     }
                                 }
                             }
                             break;
                         case "cityAssessor":
                             if (is_numeric($value)) {
                                 $cityAssessor = new Person();
                                 $cityAssessor->selectRecord($value);
                                 $this->formArray["municipalAssessor"] = $cityAssessor->getName();
                             } else {
                                 $cityAssessor = $value;
                                 $this->formArray["municipalAssessor"] = $cityAssessor;
                             }
                             break;
                         case "cityTreasurer":
                             if (is_numeric($value)) {
                                 $cityTreasurer = new Person();
                                 $cityTreasurer->selectRecord($value);
                                 $this->formArray["municipalTreasurer"] = $cityTreasurer->getName();
                             } else {
                                 $cityTreasurer = $value;
                                 $this->formArray["municipalTreasurer"] = $cityTreasurer;
                             }
                             break;
                         case "tdArray":
                             $tdCtr = 1;
                             $tdPageNumber = 1;
                             // RC 20091012 Modified to handle multiple page RPTOPS
                             $totalBasic = 0;
                             $totalSef = 0;
                             $totalTaxes = 0;
                             if (count($value)) {
                                 $tdTotalPages = intval((count($value) - 1) / 6) + 1;
                                 //RC 20091012 Calculate 1 to 6 = 1.
                                 foreach ($value as $tkey => $tvalue) {
                                     if ($tdCtr > 6) {
                                         // RC 20091012 Deal with multiple page RPTOP (i.e. more than 6 TDs)
                                         $this->formArray["tdPageNumber"] = $tdPageNumber;
                                         $this->formArray["tdTotalPages"] = $tdTotalPages;
                                         $this->formArray["totalOnLastPage"] = "Please Refer to Totals on Last Page...";
                                         $this->setForm();
                                         // generate page of output
                                         $this->clearDetails();
                                         // clear the values from Form
                                         $this->pageNumber++;
                                         //increment PDF Page Number
                                         $tdPageNumber++;
                                         $tdCtr = 1;
                                         //reset count for lines on new page of RPTOP
                                         $this->formArray["totalOnLastPage"] = "";
                                     }
                                     $this->formArray["arpNumber" . $tdCtr] = $tvalue->getTaxDeclarationNumber();
                                     // word wrap arpNumber
                                     if (strlen($this->formArray["arpNumber" . $tdCtr]) > 13) {
                                         $this->formArray["arpNumber" . $tdCtr . "a"] = substr($this->formArray["arpNumber" . $tdCtr], 0, 12);
                                         $this->formArray["arpNumber" . $tdCtr . "b"] = substr($this->formArray["arpNumber" . $tdCtr], 12);
                                         $this->formArray["arpNumber" . $tdCtr] = "";
                                     }
                                     $this->formArray["afsID"] = $tvalue->getAfsID();
                                     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                                     if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) {
                                         // xml failed
                                     } else {
                                         if (!($domDoc = domxml_open_mem($xmlStr))) {
                                             // error domDoc
                                         } else {
                                             $afs = new AFS();
                                             $afs->parseDomDocument($domDoc);
                                             $this->formArray["odID"] = $afs->getOdID();
                                             $od = new OD();
                                             $od->selectRecord($this->formArray["odID"]);
                                             $locationNumber = $od->locationAddress->getNumber();
                                             $locationStreet = $od->locationAddress->getStreet();
                                             $locationBarangay = $od->locationAddress->getBarangay();
                                             $locationDistrict = $od->locationAddress->getDistrict();
                                             $locationMunicipalityCity = $od->locationAddress->getMunicipalityCity();
                                             $locationProvince = $od->locationAddress->getProvince();
                                             $this->formArray["location" . $tdCtr] = $locationNumber . " " . $locationStreet . " " . $locationBarangay;
                                             // word wrap location
                                             if (strlen($this->formArray["location" . $tdCtr]) > 26) {
                                                 $this->formArray["location" . $tdCtr . "a"] = $locationNumber . " " . $locationStreet;
                                                 $this->formArray["location" . $tdCtr . "b"] = $locationBarangay;
                                                 $this->formArray["location" . $tdCtr] = "";
                                             }
                                             $this->formArray["province"] = $locationProvince;
                                             $this->formArray["municipalityCity"] = strtoupper($locationMunicipalityCity);
                                             $this->formArray["area" . $tdCtr] = $od->getLandArea();
                                             $this->formArray["lotNo" . $tdCtr] = $od->getLotNumber();
                                             $this->formArray["pin" . $tdCtr] = $afs->getPropertyIndexNumber();
                                             // word wrap pin
                                             if (strlen($this->formArray["pin" . $tdCtr]) > 25) {
                                                 $this->formArray["pin" . $tdCtr . "a"] = substr($this->formArray["pin" . $tdCtr], 0, 25);
                                                 $this->formArray["pin" . $tdCtr . "b"] = substr($this->formArray["pin" . $tdCtr], 25);
                                                 $this->formArray["pin" . $tdCtr] = "";
                                             }
                                             $landList = $afs->getLandArray();
                                             $plantsTreesList = $afs->getPlantsTreesArray();
                                             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
                                             $machineriesList = $afs->getMachineriesArray();
                                             $kind = "";
                                             $actualUse = "";
                                             if (count($landList)) {
                                                 $kind = "Land";
                                                 $land = $landList[0];
                                                 $actualUse = $land->getActualUse();
                                                 $landActualUses = new LandActualUses();
                                                 $landActualUses->selectRecord($actualUse);
                                                 $actualUse = $landActualUses->getDescription();
                                                 $actualUseReportCode = $landActualUses->getReportCode();
                                             } else {
                                                 if (count($plantsTreesList)) {
                                                     $kind = "Land";
                                                     $plantsTrees = $plantsTreesList[0];
                                                     $actualUse = $plantsTrees->getActualUse();
                                                     $plantsTreesActualUses = new PlantsTreesActualUses();
                                                     $plantsTreesActualUses->selectRecord($actualUse);
                                                     $actualUse = $plantsTreesActualUses->getDescription();
                                                     $actualUseReportCode = $plantsTreesActualUses->getReportCode();
                                                 } else {
                                                     if (count($improvementsBuildingsList)) {
                                                         $kind = "Improvements/Buildings";
                                                         $improvementsBuildings = $improvementsBuildingsList[0];
                                                         $actualUse = $improvementsBuildings->getActualUse();
                                                         $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                                         $actualUse = $improvementsBuildingsActualUses->getDescription();
                                                         $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode();
                                                     } else {
                                                         if (count($machineriesList)) {
                                                             $kind = "Machineries";
                                                             $machineries = $machineriesList[0];
                                                             $actualUse = $machineries->getActualUse();
                                                             $machineriesActualUses = new MachineriesActualUses();
                                                             $machineriesActualUses->selectRecord($actualUse);
                                                             $actualUse = $machineriesActualUses->getDescription();
                                                             $actualUseReportCode = $machineriesActualUses->getReportCode();
                                                         }
                                                     }
                                                 }
                                             }
                                             eval(REPORT_CODE_LIST);
                                             foreach ($reportCodeList as $key => $reportCode) {
                                                 if ($reportCode["code"] == $actualUseReportCode) {
                                                     $reportCodeDescription = $reportCode["description"];
                                                     break;
                                                 }
                                             }
                                             $this->formArray["classification" . $tdCtr] = $reportCodeDescription;
                                             $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue();
                                             $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue();
                                             $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue();
                                             $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue();
                                             $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue();
                                             $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue();
                                             $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue();
                                             $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue();
                                             $this->formArray["marketValue" . $tdCtr] += $afs->getTotalMarketValue();
                                             $this->formArray["assessedValue" . $tdCtr] += $afs->getTotalAssessedValue();
                                             //RC											$this->formArray["totalMarketValue"] += $this->formArray["marketValue"];
                                             //RC											$this->formArray["totalAssessedValue"] += $this->formArray["assessedValue"];
                                             // grab Due from tdID
                                             $this->formArray["totalTaxDue"] = 0.0;
                                             $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object");
                                             if (!($xmlStr = $DueDetails->getDueFromTdID($tvalue->getTdID()))) {
                                                 $this->formArray["basic" . $tdCtr] = "";
                                                 $this->formArray["sef" . $tdCtr] = "";
                                                 $this->formArray["totalTax" . $tdCtr] = "";
                                                 $this->formArray["totalBasic"] += 0;
                                                 $this->formArray["totalSef"] += 0;
                                                 $this->formArray["totalTaxes"] += 0;
                                             } else {
                                                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                                                     $this->formArray["basic" . $tdCtr] = "";
                                                     $this->formArray["sef" . $tdCtr] = "";
                                                     $this->formArray["totalTax" . $tdCtr] = "";
                                                     $this->formArray["totalBasic"] += 0;
                                                     $this->formArray["totalSef"] += 0;
                                                     $this->formArray["totalTaxes"] += 0;
                                                 } else {
                                                     $due = new Due();
                                                     $due->parseDomDocument($domDoc);
                                                     $this->formArray["basic" . $tdCtr] = $due->getBasicTax();
                                                     $this->formArray["sef" . $tdCtr] = $due->getSEFTax();
                                                     $this->formArray["totalTax" . $tdCtr] = $due->getTaxDue();
                                                     /* RC 20091012 revised to not print total until last page of RPTOP 
                                                     			$this->formArray["totalBasic"] += $due->getBasicTax();
                                                     			$this->formArray["totalSef"] += $due->getSEFTax();
                                                     			$this->formArray["totalTaxes"] += $due->getTaxDue();  */
                                                     $totalBasic += $due->getBasicTax();
                                                     $totalSef += $due->getSEFTax();
                                                     $totalTaxes += $due->getTaxDue();
                                                 }
                                             }
                                         }
                                     }
                                     $tdCtr++;
                                 }
                             }
                             break;
                         default:
                             $this->formArray[$key] = $value;
                     }
                 }
                 $this->formArray["tdPageNumber"] = $tdPageNumber;
                 $this->formArray["tdTotalPages"] = $tdTotalPages;
                 $this->formArray["totalBasic"] += $totalBasic;
                 // RC 20091012 set values for last page of RPTOP
                 $this->formArray["totalSef"] += $totalSef;
                 $this->formArray["totalTaxes"] += $totalTaxes;
                 $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"];
                 $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"];
                 unset($rptop);
             }
         }
         $this->setForm();
         // send XML to file
         $this->clearForm();
         // clear the XML form values
     }
     // end batch loop
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $testpdf = new PDFWriter();
     $testpdf->setOutputXML($this->tpl->get("templatePage"), "test");
     $testpdf->writePDF("RPTOPBatch.pdf");
     // popup the IE Save to File thingee...
     exit;
 }
コード例 #9
0
 function displayPlantsTreesList($plantsTreesList)
 {
     if (count($plantsTreesList)) {
         $plantsTrees = $plantsTreesList[0];
         $this->tpl->set_var("plantsTrees[propertyID]", $this->htmlProperty("propertyID", $plantsTrees->getPropertyID()));
         $this->tpl->set_var("plantsTrees[surveyNumber]", $this->htmlProperty("surveyNumber", $plantsTrees->getSurveyNumber));
         $this->tpl->set_var("plantsTrees[kind]", $this->htmlProperty("kind", $plantsTrees->getKind()));
         foreach ($plantsTrees as $lkey => $pvalue) {
             if (is_numeric($pvalue)) {
                 switch ($pkey) {
                     case "productClass":
                         $plantsTreesClasses = new PlantsTreesClasses();
                         $plantsTreesClasses->selectRecord($pvalue);
                         $this->tpl->set_var("plantsTrees[productClass]", $plantsTreesClasses->getDescription());
                         break;
                     case "actualUse":
                         $plantsTreesActualUses = new PlantsTreesActualUses();
                         $plantsTreesActualUses->selectRecord($pvalue);
                         $this->tpl->set_var("plantsTrees[actualUse]", $plantsTreesActualUses->getDescription());
                         break;
                 }
             }
         }
         $this->tpl->set_var("plantsTrees[areaPlanted]", $this->htmlProperty("areaPlanted", $plantsTrees->getAreaPlanted()));
         $this->tpl->set_var("plantsTrees[number]", $this->htmlProperty("number", $plantsTrees->getTotalNumber()));
     }
 }
コード例 #10
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "view":
             $ODList = new SoapObject(NCCBIZ . "ODList.php", "urn:Object");
             $condition = "";
             if ($this->formArray["filterByLocation"] == "true") {
                 if ($condition == "") {
                     $condition = " WHERE ";
                 }
                 $condition .= $this->filterLocationAddress();
             } else {
                 $this->tpl->set_block("rptsTemplate", "FilterLocationDetails", "FilterLocationDetailsBlock");
                 $this->tpl->set_var("FilterLocationDetailsBlock", "");
             }
             if ($this->formArray["filterByDate"] == "true") {
                 if ($condition == "") {
                     $condition = " WHERE ";
                 } else {
                     $condition .= " AND ";
                 }
                 $condition .= $this->filterDate();
             } else {
                 $this->tpl->set_block("rptsTemplate", "FilterDateDetails", "FilterDateDetailsBlock");
                 $this->tpl->set_var("FilterDateDetailsBlock", "");
             }
             $condition .= $this->filterArchives();
             $odRecords = new ODRecords();
             if ($this->formArray["filterByClassification"] == "true") {
                 $odIDArray = $this->filterByClassification($condition);
                 if (is_array($odIDArray)) {
                     $count = count($odIDArray);
                     $numOfPages = ceil($count / PAGE_BY);
                     $pLowerLimit = ($this->formArray["page"] - 1) * PAGE_BY;
                     $pUpperLimit = $pLowerLimit + PAGE_BY;
                     $this->tpl->set_var("currentPage", $this->formArray["page"]);
                     $this->tpl->set_var("numOfPages", $numOfPages);
                     $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock");
                     for ($p = 1; $p <= $numOfPages; $p++) {
                         $this->tpl->set_var("page", $p);
                         $this->initSelected("page", $p);
                         $this->tpl->parse("PageListOneBlock", "PageListOne", true);
                     }
                     for ($p = $pLowerLimit; $p < $pUpperLimit; $p++) {
                         if ($p < count($odIDArray)) {
                             $od = new OD();
                             $od->selectRecord($odIDArray[$p]);
                             $odRecords->arrayList[] = $od;
                         }
                     }
                 } else {
                     $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock");
                     $this->tpl->set_var("PageNavigationOneBlock", "");
                 }
             } else {
                 if (!($count = $odRecords->countRecords($condition))) {
                     $this->tpl->set_block("rptsTemplate", "PageNavigationOne", "PageNavigationOneBlock");
                     $this->tpl->set_var("PageNavigationOneBlock", "");
                 } else {
                     $numOfPages = ceil($count / PAGE_BY);
                     $this->tpl->set_var("currentPage", $this->formArray["page"]);
                     $this->tpl->set_var("numOfPages", $numOfPages);
                     $this->tpl->set_block("rptsTemplate", "PageListOne", "PageListOneBlock");
                     for ($p = 1; $p <= $numOfPages; $p++) {
                         $this->tpl->set_var("page", $p);
                         $this->initSelected("page", $p);
                         $this->tpl->parse("PageListOneBlock", "PageListOne", true);
                     }
                 }
                 $condition .= " LIMIT 0, 10";
                 $odRecords->selectRecords($condition);
             }
             if (!is_array($odRecords->getArrayList())) {
                 $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                 $this->tpl->set_var("message", "properties not found");
                 $this->tpl->parse("NotFoundBlock", "NotFound", true);
                 $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
                 $this->tpl->set_var("ReportBlock", "");
             } else {
                 $list = $odRecords->getArrayList();
                 $count = 0;
                 if (count($list)) {
                     $this->tpl->set_block("rptsTemplate", "ReportList", "ReportListBlock");
                     $noneFound = true;
                     foreach ($list as $key => $value) {
                         $afs = $this->getAFSDetails($value->getOdID());
                         if (is_object($afs)) {
                             $landList = $afs->getLandArray();
                             $plantsTreesList = $afs->getPlantsTreesArray();
                             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
                             $machineriesList = $afs->getMachineriesArray();
                             $kind = "";
                             $class = "";
                             $remarks = "";
                             $actualUse = "";
                             $actualUseReportCode = "";
                             if (is_array($landList)) {
                                 $kind = "Land";
                                 $land = $landList[0];
                                 $actualUse = $land->getActualUse();
                                 $landActualUses = new LandActualUses();
                                 $landActualUses->selectRecord($actualUse);
                                 $actualUse = $landActualUses->getDescription();
                                 $actualUseReportCode = $landActualUses->getReportCode();
                                 $remarks = $land->getMemoranda();
                             } else {
                                 if (is_array($plantsTreesList)) {
                                     $kind = "Land";
                                     $plantsTrees = $plantsTreesList[0];
                                     $actualUse = $plantsTrees->getActualUse();
                                     $plantsTreesActualUses = new PlantsTreesActualUses();
                                     $plantsTreesActualUses->selectRecord($actualUse);
                                     $actualUse = $plantsTreesActualUses->getDescription();
                                     $actualUseReportCode = $plantsTreesActualUses->getReportCode();
                                     $remarks = $plantsTrees->getMemoranda();
                                 } else {
                                     if (is_array($improvementsBuildingsList)) {
                                         $kind = "Improvements/Buildings";
                                         $improvementsBuildings = $improvementsBuildingsList[0];
                                         $actualUse = $improvementsBuildings->getActualUse();
                                         $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                         $actualUse = $improvementsBuildingsActualUses->getDescription();
                                         $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode();
                                         $remarks = $improvementsBuildings->getMemoranda();
                                     } else {
                                         if (is_array($machineriesList)) {
                                             $kind = "Machineries";
                                             $machineries = $machineriesList[0];
                                             $actualUse = $machineries->getActualUse();
                                             $machineriesActualUses = new MachineriesActualUses();
                                             $machineriesActualUses->selectRecord($actualUse);
                                             $actualUse = $machineriesActualUses->getDescription();
                                             $actualUseReportCode = $machineriesActualUses->getReportCode();
                                             $remarks = $machineries->getMemoranda();
                                         }
                                     }
                                 }
                             }
                             $this->tpl->set_var("kind", $kind);
                             $this->tpl->set_var("actualUse", $actualUse);
                             $this->tpl->set_var("actualUseReportCode", $actualUseReportCode);
                             $this->tpl->set_var("remarks", $remarks);
                             $this->tpl->set_var("taxability", $afs->getTaxability());
                             $this->formArray["odID"] = $value->getOdID();
                             $this->formArray["afsID"] = $afs->getAfsID();
                             $td = new TD();
                             if ($td->selectRecord("", $this->formArray["afsID"])) {
                                 $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber());
                             } else {
                                 $this->tpl->set_var("taxDeclarationNumber", "");
                             }
                             $this->tpl->set_var("area", $value->getLandArea());
                             $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber());
                             $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue()));
                             $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ','));
                             $oValue = $value->owner;
                             if (count($oValue->personArray)) {
                                 $firstOwner = $oValue->personArray[0]->getLastName();
                                 $firstOwner .= ", ";
                                 $firstOwner .= $oValue->personArray[0]->getFirstName();
                                 $firstOwner .= " ";
                                 $firstOwner .= substr($oValue->personArray[0]->getMiddleName(), 0, 1) . ".";
                                 $pAddress = $oValue->personArray[0]->addressArray ? $oValue->personArray[0]->addressArray[0]->getFullAddress() : "no address";
                                 $firstOwnerAddress = $pAddress;
                                 $firstOwnerTelephone = $oValue->personArray[0]->getTelephone();
                                 $this->tpl->set_var("firstOwner", $firstOwner);
                                 $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress);
                             }
                             if (count($oValue->companyArray)) {
                                 if ($firstOwner == "") {
                                     $firstOwner = $oValue->companyArray[0]->getCompanyName();
                                     $cAddress = $oValue->companyArray[0]->addressArray ? $oValue->companyArray[0]->addressArray[0]->getFullAddress() : "no \taddress";
                                     $firstOwnerAddress = $cAddress;
                                     $firstOwnerTelephone = $oValue->companyArray[0]->getTelephone();
                                     $this->tpl->set_var("firstOwner", $firstOwner);
                                     $this->tpl->set_var("firstOwnerAddress", $firstOwnerAddress);
                                 }
                             }
                             if ($firstOwner != "") {
                                 $this->tpl->set_var("none", "");
                                 if (count($oValue->personArray) + count($oValue->companyArray) > 1) {
                                     $this->tpl->set_var("andOthers", "(and others)");
                                 } else {
                                     $this->tpl->set_var("andOthers", "");
                                 }
                             } else {
                                 $this->tpl->set_var("none", "none");
                                 $this->tpl->set_var("firstOwner", "");
                                 $this->tpl->set_var("andOthers", "");
                                 $this->tpl->set_var("firstOwnerAddress", "");
                                 $this->tpl->set_var("firstOwnerTelephone", "");
                             }
                             if (is_array($oValue->personArray)) {
                                 foreach ($oValue->personArray as $person) {
                                     $ownerNamesArray[] = $person->getFullName();
                                 }
                             }
                             if (is_array($oValue->companyArray)) {
                                 foreach ($oValue->companyArray as $company) {
                                     $ownerNamesArray[] = $company->getCompanyName();
                                 }
                             }
                             if (is_array($ownerNamesArray)) {
                                 $this->tpl->set_var("ownerNames", implode(",<br>", $ownerNamesArray));
                             } else {
                                 $this->tpl->set_var("ownerNames", "");
                             }
                             unset($ownerNamesArray);
                             $locationAddress = $value->locationAddress->getFullAddress();
                             $this->tpl->set_var("location", $locationAddress);
                             $this->tpl->set_var("transactionCode", $value->getTransactionCode());
                             $this->tpl->set_var("assessorsLotNo", $value->getLotNumber());
                             $this->tpl->set_var("dateCreated", date('F j, Y, g:i a', $value->getDateCreated()));
                             if ($this->formArray["filterByClassification"] == "true") {
                                 $count++;
                                 if ($this->checkActualUseReportCode($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList)) {
                                     $noneFound = false;
                                     $this->tpl->parse("ReportListBlock", "ReportList", true);
                                 }
                             } else {
                                 $noneFound = false;
                                 $this->tpl->set_block("rptsTemplate", "FilterClassificationDetails", "FilterClassificationDetailsBlock");
                                 $this->tpl->set_var("FilterClassificationDetailsBlock", "");
                                 $this->tpl->parse("ReportListBlock", "ReportList", true);
                             }
                         }
                     }
                     if ($noneFound == true) {
                         $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                         $this->tpl->parse("NotFoundBlock", "NotFound", true);
                         $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
                         $this->tpl->set_var("ReportBlock", "");
                     } else {
                         $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
                         $this->tpl->set_var("NotFoundBlock", "");
                     }
                 }
             }
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "NotFound", "NotFoundBlock");
             $this->tpl->set_var("message", "select a location to view report");
             $this->tpl->parse("NotFoundBlock", "NotFound", true);
             $this->tpl->set_block("rptsTemplate", "Report", "ReportBlock");
             $this->tpl->set_var("ReportBlock", "");
             break;
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->set_var("rpts_Session", $this->sess->id);
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
コード例 #11
0
ファイル: PrintTDx.php プロジェクト: armic/erpts
 function displayPlantsTreesList($plantsTreesList)
 {
     if (count($plantsTreesList)) {
         // NCC Modification checked and implemented by K2 : November 21, 2005
         // details:
         //	added lines 286 to 292 with line 288 commented out
         $items = '';
         $offset = 410;
         //$fp = fopen("/home/site/log/tdplants.log","w+");
         $mv = 0;
         $al = 0;
         $av = 0;
         foreach ($plantsTreesList as $pkey => $plantsTrees) {
             // productClass
             $plantsTreesClasses = new PlantsTreesClasses();
             if (is_numeric($plantsTrees->getProductClass())) {
                 $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                 $plantsTreesClassesDescription = $plantsTreesClasses->getDescription();
                 $plantsTreesClassesCode = $plantsTreesClasses->getCode();
             } else {
                 $plantsTreesClassesDescription = $plantsTrees->getProductClass();
                 $plantsTreesClassesCode = $plantsTrees->getProductClass();
             }
             // NCC Modification checked and implemented by K2 : November 21, 2005
             // details:
             //	added lines 310 to 317
             $plantAU = new PlantsTreesActualUses();
             if (is_numeric($plantsTrees->getActualUse())) {
                 $plantAU->selectRecord($plantsTrees->getActualUse());
                 $plantActualUse = htmlentities($plantAU->getDescription());
             } else {
                 $plantActualUse = $plantsTrees->getActualUse();
             }
             /* just in case actualUse needs to be drawn from plantsTrees
             
             				// actualUse
             				$plantsTreesActualUses = new PlantsTreesActualUses;
             				if(is_numeric($plantsTrees->getActualUse())){
             					$plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
             					$plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription();
             					$plantsTreesActualUsesCode = $plantsTreesActualUses->getCode();
             				}
             				else{
             					$plantsTreesActualUsesDescription = $plantsTrees->getActualUse();
             					$plantsTreesActualUsesCode = $plantsTrees->getActualUse();
             				}
             				*/
             // NCC Modification checked and implemented by K2 : November 21, 2005
             // details:
             //		- changed `if($this->formArray["p"] <= 3)` to `if(...<=10)` in line xx
             //		- added lines 341 to 368
             //		- added lines 394 to 412
             if ($this->formArray["p"] <= 10) {
                 $lvl = number_format($plantsTrees->getAssessmentLevel(), 2);
                 if ($al != $lvl) {
                     if ($av > 0) {
                         $this->formArray["ypos"] -= 13;
                         $offset = $this->formArray["ypos"];
                         $plantitems .= "<textitem xpos=\"25\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"left\">" . "Plants/Trees" . "</textitem>";
                         $plantitems .= "<textitem xpos=\"115\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"9\" align=\"left\">" . $ld . "</textitem>";
                         $plantitems .= "<textitem xpos=\"337\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($mv, 2) . "</textitem>";
                         // danny : changed $al to $lvl and added '%' suffix in xml
                         $plantitems .= "<textitem xpos=\"430\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . $lvl . "%</textitem>";
                         $plantitems .= "<textitem xpos=\"558\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($av, 2) . "</textitem>";
                         $offsetx = $offset - 3;
                         $plantitems .= "<lineitem x1=\"25\" y1=\"" . $offsetx . "\" x2=\"105\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                         $plantitems .= "<lineitem x1=\"115\" y1=\"" . $offsetx . "\" x2=\"228\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                         $plantitems .= "<lineitem x1=\"244\" y1=\"" . $offsetx . "\" x2=\"337\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                         $plantitems .= "<lineitem x1=\"358\" y1=\"" . $offsetx . "\" x2=\"445\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                         $plantitems .= "<lineitem x1=\"457\" y1=\"" . $offsetx . "\" x2=\"558\" y2=\"" . $offsetx . "\">blurb</lineitem>";
                     }
                     $av = 0;
                     $mv = 0;
                     // danny = changed `$al = $lvl` back to 0 .. don't understand why $al's need to be compared.
                     $al = 0;
                 }
                 $ld = $plantActualUse;
                 $mv += $plantsTrees->getAdjustedMarketValue();
                 $av += un_number_format($plantsTrees->getAssessedValue());
                 $p = $this->formArray["p"];
                 $this->formArray["kind" . $p] = $plantsTrees->getKind();
                 $this->formArray["classification" . $p] = $plantsTreesClassesDescription;
                 $this->formArray["marketValue" . $p] = un_number_format($plantsTrees->getMarketValue());
                 $this->formArray["assessmentLevel" . $p] = un_number_format($plantsTrees->getAssessmentLevel());
                 $this->formArray["assessedValue" . $p] = un_number_format($plantsTrees->getAssessedValue());
             } else {
                 if ($this->formArray["p"] > 10) {
                     $this->formArray["othersCount"]++;
                     $this->formArray["othersMV"] += toFloat($plantsTrees->getMarketValue());
                     $this->formArray["othersAV"] += toFloat($plantsTrees->getAssessedValue());
                     $this->formArray["kindOthers"] = "Plus " . $this->formArray["othersCount"] . " other(s): P" . formatCurrency($this->formArray["othersMV"]) . " (MV), P" . formatCurrency($this->formArray["othersAV"]) . " (AV)";
                     /*
                     if($this->formArray["kindOthers"]!="") $this->formArray["kindOthers"] .= "; ";
                     if($this->formArray["kindOthers"]==""){
                     	$this->formArray["kindOthers"] = "Others: ";
                     }
                     $this->formArray["kindOthers"] .= $plantsTrees->getKind();
                     $this->formArray["kindOthers"] .= " MV=P".formatCurrency($plantsTrees->getMarketValue());
                     $this->formArray["kindOthers"] .= " AV=P".formatCurrency($plantsTrees->getAssessedValue());
                     */
                 }
             }
             $this->formArray["totalMarketValue"] += toFloat($plantsTrees->getMarketValue());
             $this->formArray["totalAssessedValue"] += toFloat($plantsTrees->getAssessedValue());
             $this->formArray["p"]++;
         }
         if ($av > 0) {
             $this->formArray["ypos"] -= 13;
             $offset = $this->formArray["ypos"];
             $plantitems .= "<textitem xpos=\"25\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"left\">" . "Plants/Trees" . "</textitem>";
             $plantitems .= "<textitem xpos=\"115\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"9\" align=\"left\">" . $ld . "</textitem>";
             $plantitems .= "<textitem xpos=\"337\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($mv, 2) . "</textitem>";
             // danny : changed $al to $lvl and added '%' suffix in xml
             $plantitems .= "<textitem xpos=\"430\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . $lvl . "%</textitem>";
             $plantitems .= "<textitem xpos=\"558\" ypos=\"" . $offset . "\" font=\"Helvetica\" size=\"10\" align=\"right\">" . number_format($av, 2) . "</textitem>";
             $offsetx = $offset - 3;
             $plantitems .= "<lineitem x1=\"25\" y1=\"" . $offsetx . "\" x2=\"105\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"115\" y1=\"" . $offsetx . "\" x2=\"228\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"244\" y1=\"" . $offsetx . "\" x2=\"337\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"358\" y1=\"" . $offsetx . "\" x2=\"445\" y2=\"" . $offsetx . "\">blurb</lineitem>";
             $plantitems .= "<lineitem x1=\"457\" y1=\"" . $offsetx . "\" x2=\"558\" y2=\"" . $offsetx . "\">blurb</lineitem>";
         }
         $this->formArray["plantitems"] = $plantitems;
     }
 }
コード例 #12
0
ファイル: PrintTD.standard.php プロジェクト: armic/erpts
 function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList)
 {
     $totalMarketValue = 0;
     $totalAssessedValue = 0;
     $i = 0;
     if (count($landList)) {
         foreach ($landList as $key => $land) {
             if ($i < 4) {
                 // classification
                 $landClasses = new LandClasses();
                 if (is_numeric($land->getClassification())) {
                     $landClasses->selectRecord($land->getClassification());
                     $landClassesDescription = $landClasses->getDescription();
                     $landClassesCode = $landClasses->getCode();
                 } else {
                     $landClassesDescription = $land->getClassification();
                     $landClassesCode = $land->getClassification();
                 }
                 // subClass
                 $landSubclasses = new LandSubclasses();
                 if (is_numeric($land->getSubClass())) {
                     $landSubclasses->selectRecord($land->getSubClass());
                     $landSubclassesDescription = $landSubclasses->getDescription();
                     $landSubclassesCode = $landSubclasses->getCode();
                 } else {
                     $landSubclassesDescription = $land->getSubClass();
                     $landSubclassesCode = $land->getSubClass();
                 }
                 // actualUse
                 $landActualUses = new LandActualUses();
                 if (is_numeric($land->getActualUse())) {
                     $landActualUses->selectRecord($land->getActualUse());
                     $landActualUsesDescription = $landActualUses->getDescription();
                     $landActualUsesCode = $landActualUses->getCode();
                 } else {
                     $landActualUsesDescription = $land->getActualUse();
                     $landActualUsesCode = $land->getActualUse();
                 }
                 $this->formArray["propertyKind" . ($i + 1)] = "Land";
                 $this->formArray["propertyActualUse" . ($i + 1)] = $landActualUsesDescription;
                 $this->formArray["propertyMarketValue" . ($i + 1)] = $land->getMarketValue();
                 $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $land->getAssessmentLevel();
                 $this->formArray["propertyAssessedValue" . ($i + 1)] = $land->getAssessedValue();
                 $totalMarketValue += toFloat($land->getMarketValue());
                 $totalAssessedValue += toFloat($land->getAssessedValue());
                 $i++;
             }
         }
     }
     if (count($plantsTreesList)) {
         foreach ($plantsTreesList as $key => $plantsTrees) {
             if ($i < 4) {
                 // productClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 if (is_numeric($plantsTrees->getProductClass())) {
                     $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                     $plantsTreesClassesDescription = $plantsTreesClasses->getDescription();
                     $plantsTreesClassesCode = $plantsTreesClasses->getCode();
                 } else {
                     $plantsTreesClassesDescription = $plantsTrees->getProductClass();
                     $plantsTreesClassesCode = $plantsTrees->getProductClass();
                 }
                 // actualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 if (is_numeric($plantsTrees->getActualUse())) {
                     $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                     $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription();
                     $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode();
                 } else {
                     $plantsTreesActualUsesDescription = $plantsTrees->getActualUse();
                     $plantsTreesActualUsesCode = $plantsTrees->getActualUse();
                 }
                 $this->formArray["propertyKind" . ($i + 1)] = "PlantsTrees";
                 $this->formArray["propertyActualUse" . ($i + 1)] = $plantsTreesActualUsesDescription;
                 $this->formArray["propertyMarketValue" . ($i + 1)] = $plantsTrees->getMarketValue();
                 $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $plantsTrees->getAssessmentLevel();
                 $this->formArray["propertyAssessedValue" . ($i + 1)] = $plantsTrees->getAssessedValue();
                 $totalMarketValue += toFloat($plantsTrees->getMarketValue());
                 $totalAssessedValue += toFloat($plantsTrees->getAssessedValue());
                 $i++;
             }
         }
     }
     if (count($improvementsBuildingsList)) {
         foreach ($improvementsBuildingsList as $key => $improvementsBuildings) {
             if ($i < 4) {
                 // buildingClassification
                 $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                 if (is_numeric($improvementsBuildings->getBuildingClassification())) {
                     $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification());
                     $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription();
                     $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode();
                 } else {
                     $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification();
                     $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification();
                 }
                 // actualUse
                 $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                 if (is_numeric($improvementsBuildings->getActualUse())) {
                     $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse());
                     $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription();
                     $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode();
                 } else {
                     $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse();
                     $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse();
                 }
                 $this->formArray["propertyKind" . ($i + 1)] = "ImprovementsBuildings";
                 $this->formArray["propertyActualUse" . ($i + 1)] = $improvementsBuildingsActualUsesDescription;
                 $this->formArray["propertyMarketValue" . ($i + 1)] = $improvementsBuildings->getMarketValue();
                 $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $improvementsBuildings->getAssessmentLevel();
                 $this->formArray["propertyAssessedValue" . ($i + 1)] = $improvementsBuildings->getAssessedValue();
                 $totalMarketValue += toFloat($improvementsBuildings->getMarketValue());
                 $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue());
                 $i++;
             }
         }
     }
     if (count($machineriesList)) {
         foreach ($machineriesList as $key => $machineries) {
             if ($i < 4) {
                 // kind
                 $machineriesClasses = new MachineriesClasses();
                 if (is_numeric($machineries->getKind())) {
                     $machineriesClasses->selectRecord($machineries->getKind());
                     $machineriesClassesDescription = $machineriesClasses->getDescription();
                     $machineriesClassesCode = $machineriesClasses->getCode();
                 } else {
                     $machineriesClassesDescription = $machineries->getKind();
                     $machineriesClassesCode = $machineries->getActualUse();
                 }
                 // actualUse
                 $machineriesActualUses = new MachineriesActualUses();
                 if (is_numeric($machineries->getActualUse())) {
                     $machineriesActualUses->selectRecord($machineries->getActualUse());
                     $machineriesActualUsesDescription = $machineriesActualUses->getDescription();
                     $machineriesActualUsesCode = $machineriesActualUses->getCode();
                 } else {
                     $machineriesActualUsesDescription = $machineries->getActualUse();
                     $machineriesActualUsesCode = $machineries->getActualUse();
                 }
                 $this->formArray["propertyKind" . ($i + 1)] = "Machineries";
                 $this->formArray["propertyActualUse" . ($i + 1)] = $machineriesActualUsesDescription;
                 $this->formArray["propertyMarketValue" . ($i + 1)] = $machineries->getMarketValue();
                 $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $machineries->getAssessmentLevel();
                 $this->formArray["propertyAssessedValue" . ($i + 1)] = $machineries->getAssessedValue();
                 $totalMarketValue += toFloat($machineries->getMarketValue());
                 $totalAssessedValue += toFloat($machineries->getAssessedValue());
                 $i++;
             }
         }
     }
     $this->formArray["totalMarketValue"] = $totalMarketValue;
     $this->formArray["totalAssessedValue"] = $totalAssessedValue;
     $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue);
 }
コード例 #13
0
ファイル: PrintRPTOPDetailsPDF.php プロジェクト: armic/erpts
 function Main()
 {
     $this->displayLGUName();
     $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
     if (!($xmlStr = $RPTOPDetails->getRPTOP($this->formArray["rptopID"]))) {
         exit("xml failed");
     } else {
         //echo($xmlStr);
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             exit("error xmlDoc");
         } else {
             $rptop = new RPTOP();
             $rptop->parseDomDocument($domDoc);
             //print_r($rptop);
             foreach ($rptop as $key => $value) {
                 switch ($key) {
                     case "owner":
                         //$RPTOPEncode = new SoapObject(NCCBIZ."RPTOPEncode.php", "urn:Object");
                         if (is_a($value, "Owner")) {
                             $this->formArray["ownerID"] = $rptop->owner->getOwnerID();
                             $xmlStr = $rptop->owner->domDocument->dump_mem(true);
                             if (!$xmlStr) {
                                 // xml failed
                             } else {
                                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                                     // error domdoc
                                 } else {
                                     $this->displayOwnerList($domDoc);
                                 }
                             }
                         }
                         break;
                     case "cityAssessor":
                         if (is_numeric($value)) {
                             $cityAssessor = new Person();
                             $cityAssessor->selectRecord($value);
                             $this->formArray["municipalAssessor"] = $cityAssessor->getName();
                         } else {
                             $cityAssessor = $value;
                             $this->formArray["municipalAssessor"] = $cityAssessor;
                         }
                         break;
                     case "cityTreasurer":
                         if (is_numeric($value)) {
                             $cityTreasurer = new Person();
                             $cityTreasurer->selectRecord($value);
                             $this->formArray["municipalTreasurer"] = $cityTreasurer->getName();
                         } else {
                             $cityTreasurer = $value;
                             $this->formArray["municipalTreasurer"] = $cityTreasurer;
                         }
                         break;
                     case "tdArray":
                         $tdCtr = 1;
                         $tdContinuousCtr = 1;
                         if (count($value)) {
                             $this->tdPagingArray["tdCount"] = count($value);
                             $this->tdPagingArray["tdPageRecordsCounter"] = 1;
                             $this->tdPagingArray["tdTotalPages"] = ceil($this->tdPagingArray["tdCount"] / $this->tdPagingArray["tdPageBy"]);
                             $this->tdPagingArray["tdPageNumber"] = 1;
                             $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
                             $this->tpl->set_block("Page", "FirstPageText", "FirstPageTextBlock");
                             $this->tpl->set_block("Page", "ContinuedFromPreviousPageText", "ContinuedFromPreviousPageTextBlock");
                             $this->tpl->set_block("Page", "ContinuedNextPageText", "ContinuedNextPageTextBlock");
                             $this->tpl->set_block("Page", "Totals", "TotalsBlock");
                             foreach ($value as $tkey => $tvalue) {
                                 $this->formArray["arpNumber" . $tdCtr] = $tvalue->getTaxDeclarationNumber();
                                 // word wrap arpNumber
                                 if (strlen($this->formArray["arpNumber" . $tdCtr]) > 13) {
                                     $this->formArray["arpNumber" . $tdCtr . "a"] = substr($this->formArray["arpNumber" . $tdCtr], 0, 12);
                                     $this->formArray["arpNumber" . $tdCtr . "b"] = substr($this->formArray["arpNumber" . $tdCtr], 12);
                                     $this->formArray["arpNumber" . $tdCtr] = "";
                                 }
                                 $this->formArray["afsID"] = $tvalue->getAfsID();
                                 $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                                 if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) {
                                     // xml failed
                                 } else {
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         // error domDoc
                                     } else {
                                         $afs = new AFS();
                                         $afs->parseDomDocument($domDoc);
                                         $this->formArray["odID"] = $afs->getOdID();
                                         $od = new OD();
                                         $od->selectRecord($this->formArray["odID"]);
                                         $locationNumber = $od->locationAddress->getNumber();
                                         $locationStreet = $od->locationAddress->getStreet();
                                         $locationBarangay = $od->locationAddress->getBarangay();
                                         $locationDistrict = $od->locationAddress->getDistrict();
                                         $locationMunicipalityCity = $od->locationAddress->getMunicipalityCity();
                                         $locationProvince = $od->locationAddress->getProvince();
                                         $this->formArray["location" . $tdCtr] = $locationNumber . " " . $locationStreet . " " . $locationBarangay;
                                         // word wrap location
                                         if (strlen($this->formArray["location" . $tdCtr]) > 26) {
                                             $this->formArray["location" . $tdCtr . "a"] = $locationNumber . " " . $locationStreet;
                                             $this->formArray["location" . $tdCtr . "b"] = $locationBarangay;
                                             $this->formArray["location" . $tdCtr] = "";
                                         }
                                         $this->formArray["province"] = $locationProvince;
                                         $this->formArray["municipalityCity"] = strtoupper($locationMunicipalityCity);
                                         $this->formArray["area" . $tdCtr] = $od->getLandArea();
                                         $this->formArray["lotNo" . $tdCtr] = $od->getLotNumber();
                                         $this->formArray["pin" . $tdCtr] = $afs->getPropertyIndexNumber();
                                         // word wrap pin
                                         if (strlen($this->formArray["pin" . $tdCtr]) > 13) {
                                             $this->formArray["pin" . $tdCtr . "a"] = substr($this->formArray["pin" . $tdCtr], 0, 12);
                                             $this->formArray["pin" . $tdCtr . "b"] = substr($this->formArray["pin" . $tdCtr], 12);
                                             $this->formArray["pin" . $tdCtr] = "";
                                         }
                                         $landList = $afs->getLandArray();
                                         $plantsTreesList = $afs->getPlantsTreesArray();
                                         $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
                                         $machineriesList = $afs->getMachineriesArray();
                                         $kind = "";
                                         $actualUse = "";
                                         if (count($landList)) {
                                             $kind = "Land";
                                             $land = $landList[0];
                                             $actualUse = $land->getActualUse();
                                             $landActualUses = new LandActualUses();
                                             $landActualUses->selectRecord($actualUse);
                                             $actualUse = $landActualUses->getDescription();
                                             $actualUseReportCode = $landActualUses->getReportCode();
                                         } else {
                                             if (count($plantsTreesList)) {
                                                 $kind = "Land";
                                                 $plantsTrees = $plantsTreesList[0];
                                                 $actualUse = $plantsTrees->getActualUse();
                                                 $plantsTreesActualUses = new PlantsTreesActualUses();
                                                 $plantsTreesActualUses->selectRecord($actualUse);
                                                 $actualUse = $plantsTreesActualUses->getDescription();
                                                 $actualUseReportCode = $plantsTreesActualUses->getReportCode();
                                             } else {
                                                 if (count($improvementsBuildingsList)) {
                                                     $kind = "Improvements/Buildings";
                                                     $improvementsBuildings = $improvementsBuildingsList[0];
                                                     $actualUse = $improvementsBuildings->getActualUse();
                                                     $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                                                     $improvementsBuildingsActualUses->selectRecord($actualUse);
                                                     $actualUse = $improvementsBuildingsActualUses->getDescription();
                                                     $actualUseReportCode = $improvementsBuildingsActualUses->getReportCode();
                                                 } else {
                                                     if (count($machineriesList)) {
                                                         $kind = "Machineries";
                                                         $machineries = $machineriesList[0];
                                                         $actualUse = $machineries->getActualUse();
                                                         $machineriesActualUses = new MachineriesActualUses();
                                                         $machineriesActualUses->selectRecord($actualUse);
                                                         $actualUse = $machineriesActualUses->getDescription();
                                                         $actualUseReportCode = $machineriesActualUses->getReportCode();
                                                     }
                                                 }
                                             }
                                         }
                                         eval(REPORT_CODE_LIST);
                                         foreach ($reportCodeList as $key => $reportCode) {
                                             if ($reportCode["code"] == $actualUseReportCode) {
                                                 $reportCodeDescription = $reportCode["description"];
                                                 break;
                                             }
                                         }
                                         $this->formArray["classification" . $tdCtr] = $reportCodeDescription;
                                         $this->formArray["landTotalMarketValue"] += $afs->getLandTotalMarketValue();
                                         $this->formArray["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue();
                                         $this->formArray["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue();
                                         $this->formArray["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue();
                                         $this->formArray["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue();
                                         $this->formArray["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue();
                                         $this->formArray["machTotalMarketValue"] += $afs->getMachTotalMarketValue();
                                         $this->formArray["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue();
                                         $this->formArray["marketValue" . $tdCtr] += $afs->getTotalMarketValue();
                                         $this->formArray["assessedValue" . $tdCtr] += $afs->getTotalAssessedValue();
                                         $this->formArray["totalMarketValue"] += $this->formArray["marketValue"];
                                         $this->formArray["totalAssessedValue"] += $this->formArray["assessedValue"];
                                         // grab Due from tdID
                                         $this->formArray["totalTaxDue"] = 0.0;
                                         $DueDetails = new SoapObject(NCCBIZ . "DueDetails.php", "urn:Object");
                                         if (!($xmlStr = $DueDetails->getDueFromTdID($tvalue->getTdID()))) {
                                             $this->formArray["basic" . $tdCtr] = "";
                                             $this->formArray["sef" . $tdCtr] = "";
                                             $this->formArray["totalTax" . $tdCtr] = "";
                                             $this->formArray["totalBasic"] += 0;
                                             $this->formArray["totalSef"] += 0;
                                             $this->formArray["totalTaxes"] += 0;
                                         } else {
                                             if (!($domDoc = domxml_open_mem($xmlStr))) {
                                                 $this->formArray["basic" . $tdCtr] = "";
                                                 $this->formArray["sef" . $tdCtr] = "";
                                                 $this->formArray["totalTax" . $tdCtr] = "";
                                                 $this->formArray["totalBasic"] += 0;
                                                 $this->formArray["totalSef"] += 0;
                                                 $this->formArray["totalTaxes"] += 0;
                                             } else {
                                                 $due = new Due();
                                                 $due->parseDomDocument($domDoc);
                                                 $this->formArray["basic" . $tdCtr] = $due->getBasicTax();
                                                 $this->formArray["sef" . $tdCtr] = $due->getSEFTax();
                                                 $this->formArray["totalTax" . $tdCtr] = $due->getTaxDue();
                                                 //WRONG CODE -------------------------------------------------->
                                                 //$this->formArray["totalBasic"] += $due->getBasicTax();
                                                 //$this->formArray["totalSef"] += $due->getSEFTax();
                                                 //$this->formArray["totalTaxes"] += $due->getTaxDue();
                                                 //------------------------------------------------------------->
                                             }
                                         }
                                     }
                                 }
                                 $this->formArray["totalMarketValue"] = $this->formArray["landTotalMarketValue"] + $this->formArray["plantTotalMarketValue"] + $this->formArray["bldgTotalMarketValue"] + $this->formArray["machTotalMarketValue"];
                                 $this->formArray["totalAssessedValue"] = $this->formArray["landTotalAssessedValue"] + $this->formArray["plantTotalAssessedValue"] + $this->formArray["bldgTotalAssessedValue"] + $this->formArray["machTotalAssessedValue"];
                                 //NEW CODE - Argao----Added on 03152008-------------------------------------------->
                                 //Computes Grand Totals on Basic, SEF and Total-----By CHT
                                 $this->formArray["totalBasic"] = $this->formArray["totalAssessedValue"] * 0.01;
                                 $this->formArray["totalSef"] = $this->formArray["totalAssessedValue"] * 0.01;
                                 $this->formArray["totalTaxes"] = $this->formArray["totalBasic"] + $this->formArray["totalSef"];
                                 //--------------------------------------------------------------------------------->
                                 if ($this->tdPagingArray["tdPageRecordsCounter"] == $this->tdPagingArray["tdPageBy"]) {
                                     // if 6
                                     $this->setForm();
                                     $this->resetTDPageRecords();
                                     $this->tpl->set_var("tdPageNumber", $this->tdPagingArray["tdPageNumber"]);
                                     $this->tpl->set_var("tdTotalPages", $this->tdPagingArray["tdTotalPages"]);
                                     if ($this->tdPagingArray["tdPageNumber"] > 1) {
                                         $this->tpl->set_var("FirstPageTextBlock", "");
                                         $this->tpl->parse("ContinuedFromPreviousPageTextBlock", "ContinuedFromPreviousPageText", true);
                                     } else {
                                         if ($this->tdPagingArray["tdPageNumber"] == 1) {
                                             $this->tpl->parse("FirstPageTextBlock", "FirstPageText", true);
                                             $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", "");
                                         }
                                     }
                                     if ($this->tdPagingArray["tdTotalPages"] > 1 && $this->tdPagingArray["tdPageNumber"] < $this->tdPagingArray["tdTotalPages"]) {
                                         $this->tpl->parse("ContinuedNextPageTextBlock", "ContinuedNextPageText", true);
                                     } else {
                                         if ($this->tdPagingArray["tdTotalPages"] == 1) {
                                             $this->tpl->set_var("ContinuedNextPageTextBlock", "");
                                         }
                                     }
                                     if ($this->tdPagingArray["tdTotalPages"] == $this->tdPagingArray["tdPageNumber"]) {
                                         $this->tpl->parse("TotalsBlock", "Totals", true);
                                     } else {
                                         $this->tpl->set_var("TotalsBlock", "");
                                     }
                                     $this->tpl->parse("PageBlock", "Page", true);
                                     $this->tpl->set_var("FirstPageTextBlock", "");
                                     $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", "");
                                     $this->tpl->set_var("ContinuedNextPageTextBlock", "");
                                     $this->tpl->set_var("TotalsBlock", "");
                                     $this->tdPagingArray["tdPageNumber"]++;
                                     $this->formArray["pageNumber"]++;
                                     // reset counter
                                     $this->tdPagingArray["tdPageRecordsCounter"] = 0;
                                     $tdCtr = 0;
                                 } else {
                                     if ($tdContinuousCtr == $this->tdPagingArray["tdCount"]) {
                                         // if this is the last record, and count is still not 6
                                         $this->setForm();
                                         $this->resetTDPageRecords();
                                         $this->tpl->set_var("tdPageNumber", $this->tdPagingArray["tdPageNumber"]);
                                         $this->tpl->set_var("tdTotalPages", $this->tdPagingArray["tdTotalPages"]);
                                         if ($this->tdPagingArray["tdPageNumber"] > 1) {
                                             $this->tpl->set_var("FirstPageTextBlock", "");
                                             $this->tpl->parse("ContinuedFromPreviousPageTextBlock", "ContinuedFromPreviousPageText", true);
                                         } else {
                                             if ($this->tdPagingArray["tdPageNumber"] == 1) {
                                                 $this->tpl->parse("FirstPageTextBlock", "FirstPageText", true);
                                                 $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", "");
                                             }
                                         }
                                         if ($this->tdPagingArray["tdTotalPages"] > 1 && $this->tdPagingArray["tdPageNumber"] < $this->tdPagingArray["tdTotalPages"]) {
                                             $this->tpl->parse("ContinuedNextPageTextBlock", "ContinuedNextPageText", true);
                                         } else {
                                             if ($this->tdPagingArray["tdTotalPages"] == 1) {
                                                 $this->tpl->set_var("ContinuedNextPageTextBlock", "");
                                             }
                                         }
                                         if ($this->tdPagingArray["tdTotalPages"] == $this->tdPagingArray["tdPageNumber"]) {
                                             $this->tpl->parse("TotalsBlock", "Totals", true);
                                         } else {
                                             $this->tpl->set_var("TotalsBlock", "");
                                         }
                                         $this->tpl->parse("PageBlock", "Page", true);
                                         $this->tpl->set_var("FirstPageTextBlock", "");
                                         $this->tpl->set_var("ContinuedFromPreviousPageTextBlock", "");
                                         $this->tpl->set_var("ContinuedNextPageTextBlock", "");
                                         $this->tpl->set_var("TotalsBlock", "");
                                         $this->tdPagingArray["tdPageNumber"]++;
                                         $this->formArray["pageNumber"]++;
                                     }
                                 }
                                 $tdCtr++;
                                 $tdContinuousCtr++;
                                 $this->tdPagingArray["tdPageRecordsCounter"]++;
                             }
                         }
                         break;
                     default:
                         $this->formArray[$key] = $value;
                 }
             }
             unset($rptop);
         }
     }
     $this->tpl->set_block("rptsTemplate", "Totals", "TotalsBlock");
     $this->tpl->set_var("TotalsBlock", "");
     //$this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     //		print_r($this->tpl->get("templatePage"));
     //		exit;
     $testpdf = new PDFWriter();
     $testpdf->setOutputXML($this->tpl->get("templatePage"), "test");
     if (isset($this->formArray["print"])) {
         $testpdf->writePDF($name);
         //,$this->formArray["print"]);
     } else {
         $testpdf->writePDF($name);
     }
     //header("location: ".$testpdf->pdfPath);
 }
コード例 #14
0
ファイル: PrintTD.php プロジェクト: armic/erpts
 function displayPlantsTreesList($plantsTreesList)
 {
     if (count($plantsTreesList)) {
         foreach ($plantsTreesList as $pkey => $plantsTrees) {
             // productClass
             $plantsTreesClasses = new PlantsTreesClasses();
             if (is_numeric($plantsTrees->getProductClass())) {
                 $plantsTreesClasses->selectRecord($plantsTrees->getProductClass());
                 $plantsTreesClassesDescription = $plantsTreesClasses->getDescription();
                 $plantsTreesClassesCode = $plantsTreesClasses->getCode();
             } else {
                 $plantsTreesClassesDescription = $plantsTrees->getProductClass();
                 $plantsTreesClassesCode = $plantsTrees->getProductClass();
             }
             // just in case actualUse needs to be drawn from plantsTrees
             // actualUse
             $plantsTreesActualUses = new PlantsTreesActualUses();
             if (is_numeric($plantsTrees->getActualUse())) {
                 $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse());
                 $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription();
                 $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode();
             } else {
                 $plantsTreesActualUsesDescription = $plantsTrees->getActualUse();
                 $plantsTreesActualUsesCode = $plantsTrees->getActualUse();
             }
             if ($this->formArray["p"] <= 24) {
                 $p = $this->formArray["p"];
                 $this->formArray["kind" . $p] = $plantsTrees->getKind();
                 $this->formArray["classification" . $p] = $plantsTreesClassesDescription;
                 $this->formArray["landActualUses" . $p] = $plantsTreesActualUsesDescription;
                 $this->formArray["propertyMarketValue" . $p] = un_number_format($plantsTrees->getAdjustedMarketValue());
                 $this->formArray["assessmentLevel" . $p] = un_number_format($plantsTrees->getAssessmentLevel());
                 $this->formArray["assessedValue" . $p] = un_number_format($plantsTrees->getAssessedValue());
                 $this->formArray["totalMarketValue"] += un_number_format($this->formArray["propertyMarketValue" . $p]);
                 $this->formArray["totalAssessedValue"] += un_number_format($this->formArray["assessedValue" . $p]);
                 $this->formArray["p"]++;
             }
         }
     }
 }