예제 #1
0
 function TestPDFWriter()
 {
     session_cache_limiter("nocache");
     $testpdf = new PDFWriter();
     $testpdf->setOutputXML("C:/Sites/rpts/nccweb/rptreceipt.xml");
     $testpdf->writePDF("rptr.pdf");
 }
예제 #2
0
 function Main()
 {
     $db = new DB_RPTS();
     //$this->formArray['month']= 10; 		//ex Month january
     //$this->formArray['year']= 2003; 		//ex Month january
     /*$sql = "SELECT  DISTINCT payments.dueID FROM payments INNER  JOIN dues ON payments.dueID = dues.dueID
     		WHERE MONTH( dues.dueDate )  =  '01'"; 		
     		*/
     $sql = "SELECT sum( amount ) as amount , YEAR(dues.dueDate) as yearDue, sum( payments.penalty ) as penalty , sum( discount ) as discount, \r\n\t\t\tcollectionDate FROM collections INNER JOIN collectionPayments ON collections.collectionID = collectionPayments.collectionID INNER JOIN payments \r\n\t\t\tON collectionPayments.paymentID = payments.paymentID INNER JOIN dues ON payments.dueID = dues.dueID where \r\n\t\t\tMONTH(collectionDate) = '" . $this->formArray['month'] . "' AND YEAR(collectionDate) = '" . $this->formArray['year'] . "'  GROUP BY ( collectionDate ) order by collectionDate desc;";
     $ypos = 460;
     $this->tpl->set_block("rptsTemplate", "ROW", "rBlk");
     $db->query($sql);
     if (count($db->num_rows()) > 0) {
         for ($i = 0; $db->next_record(); $i++) {
             if ($db->f("yearDue") == date("Y")) {
                 $this->tpl->set_var(currentYear, $db->f("amount"));
                 $this->tpl->set_var(prevYear, "0.00");
             } else {
                 $this->tpl->set_var(prevYear, $db->f("amount"));
                 $this->tpl->set_var(currentYear, "0.00");
             }
             $this->tpl->set_var($db->Record);
             $this->tpl->set_var(ypos, $ypos);
             $ypos = $ypos - 10;
             $this->tpl->parse("rBlk", "ROW", true);
         }
     }
     $this->tpl->parse("report", "rptsTemplate");
     $this->tpl->finish("report");
     //		$this->tpl->p("report");
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get('report'), "string");
     $rptrpdf->writePDF("collectionReport2.pdf");
 }
예제 #3
0
파일: samplePDF.php 프로젝트: armic/erpts
 function SamplePDF()
 {
     session_cache_limiter("nocache");
     $xmlFile = getcwd() . "/samplePDF.xml";
     $pdfFile = "samplePDF.pdf";
     $testpdf = new PDFWriter();
     $testpdf->setOutputXML($xmlFile);
     $testpdf->writePDF($pdfFile, false);
 }
예제 #4
0
 function Main()
 {
     $db = new DB_RPTS();
     $startDate = array();
     $endDate = array();
     $db->query("SELECT DISTINCT YEAR(dues.dueDate) as dueYear FROM dues");
     for ($i = 0; $db->next_record(); $i++) {
         $startDate[$i][0] = $db->f("dueYear") . "-01-01";
         $endDate[$i][0] = $db->f("dueYear") . "-03-31";
         $startDate[$i][1] = $db->f("dueYear") . "-04-01";
         $endDate[$i][1] = $db->f("dueYear") . "-06-30";
         $startDate[$i][2] = $db->f("dueYear") . "-07-01";
         $endDate[$i][2] = $db->f("dueYear") . "-09-30";
         $startDate[$i][3] = $db->f("dueYear") . "-10-01";
         $endDate[$i][3] = $db->f("dueYear") . "-12-31";
     }
     $ypos = 625;
     $this->tpl->set_block("rptsTemplate", "ROW", "rBlk");
     for ($i = 0; $i < count($startDate); $i++) {
         for ($j = 0; $j < count($startDate[$i]); $j++) {
             $sql = "SELECT sum( basic )  AS basic, sum( sef )  AS sef, sum( penalty )  AS penalty, sum( paidBasic )  AS paidBasic, \r\n\t\t\t\tsum(paidSEF) as paidSEF,sum( paidPenalty )  AS paidPenalty FROM dues WHERE dues.dueDate between '" . $startDate[$i][$j] . "' AND '" . $endDate[$i][$j] . "' GROUP  BY (dues.dueDate) ";
             $db->query($sql);
             if ($db->next_record()) {
                 $this->tpl->set_var($db->Record);
                 list($year[$i][$j], $month[$i][$j], $day[$i][$j]) = explode("-", $startDate[$i][$j]);
                 if ($month[$i][$j] == '01') {
                     $quarter = $year[$i][$j] . " Quarter 1 ";
                 } elseif ($month[$i][$j] == '04') {
                     $quarter = $year[$i][$j] . " Quarter 2 ";
                 } elseif ($month[$i][$j] == '07') {
                     $quarter = $year[$i][$j] . " Quarter 3 ";
                 } elseif ($month[$i][$j] == '10') {
                     $quarter = $year[$i][$j] . " Quarter 3 ";
                 }
             }
             $this->tpl->set_var(quarter, $quarter);
             $this->tpl->set_var(ypos, $ypos);
             $ypos = $ypos - 4;
         }
         $this->tpl->parse("rBlk", "ROW", true);
     }
     $this->tpl->parse('report', 'rptsTemplate');
     $this->tpl->finish('report');
     //	$this->tpl->p('report');
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get('report'), "string");
     $rptrpdf->writePDF("collectionReport2.pdf");
 }
예제 #5
0
 function Main()
 {
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     exit;
 }
예제 #6
0
 function TestPDFWriter()
 {
     session_cache_limiter("nocache");
     $filename = getcwd() . "/officialrptr.xml";
     if (isset($_GET['xmlfile'])) {
         $filename = getcwd() . "/" . $_GET['xmlfile'];
     }
     if (isset($_GET['name'])) {
         $name = $_GET['name'];
     } else {
         $name = "rpts.pdf";
     }
     $testpdf = new PDFWriter();
     $testpdf->setOutputXML($filename);
     if (isset($_GET['print'])) {
         $testpdf->writePDF($name, $_GET['print']);
     } else {
         $testpdf->writePDF($name);
     }
 }
예제 #7
0
 function showReceipt($preprinted)
 {
     //session_cache_limiter("nocache");
     if ($preprinted) {
         $this->tpl->set_file(array('step3' => 'PayRPTOP3.htm', 'receipt' => 'or.xml'));
     } else {
         $this->tpl->set_file(array('receipt1' => 'PayRPTOP3.htm', 'receipt' => 'or.xml'));
     }
     # get all the details from the page
     //if(isset($_POST['tdID']))
     $this->setDetails();
     //        $this->tpl->set_var('ownerAddress',strip_tags($this->tpl->get("ownerAddress")));
     $this->tpl->parse('OUT', 'receipt');
     $this->tpl->finish('OUT');
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get('OUT'), "string");
     $rptrpdf->writePDF("or.pdf");
     //$str = $this->tpl->get('OUT');
     //echo $str;
     // echo to browser
     // $this->tpl->p('OUT');
     //header("location: ".$testpdf->pdfPath);
 }
예제 #8
0
 function Main()
 {
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         exit("afs not found");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             exit("error xmlDoc");
         } else {
             $afs = new AFS();
             $afs->parseDomDocument($domDoc);
             $this->formArray["arpNumber"] = $afs->arpNumber;
             $this->formArray["propertyIndexNumber"] = $afs->propertyIndexNumber;
             $this->formArray["taxability"] = $afs->taxability;
             $this->formArray["effectivity"] = $afs->effectivity;
             $this->displayODAFS($this->formArray["afsID"]);
             $this->displayTD($this->formArray["afsID"]);
             $landList = $afs->getLandArray();
             if (count($landList)) {
                 $this->displayLandList($landList);
             }
             $plantsTreesList = $afs->getPlantsTreesArray();
             if (count($plantsTreesList)) {
                 $this->displayPlantsTreesList($plantsTreesList);
             }
             $fp = fopen("/home/site/log/faasland1.xml", "w");
             fwrite($fp, "---landitems---\r\n");
             fwrite($fp, $this->formArray["landitems"] . "\r\n");
             fwrite($fp, "---plantitems---\r\n");
             fwrite($fp, $this->formArray["plantitems"] . "\r\n");
             fwrite($fp, "---adjitems---\r\n");
             fwrite($fp, $this->formArray["adjitems"] . "\r\n");
             fwrite($fp, "---summtems---\r\n");
             fwrite($fp, $this->formArray["summitems"] . "\r\n");
             fclose($fp);
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     //		$this->tpl->p("templatePage");
     $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);
     exit;
 }
 function Main()
 {
     $this->getSignatory();
     if (is_array($this->formArray["nameListArray"])) {
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         foreach ($this->formArray["nameListArray"] as $nameList) {
             $this->tpl->set_var("pageNumber", $this->pageNumber);
             $this->tpl->set_var("nameList", $nameList);
             $this->tpl->parse("PageBlock", "Page", true);
             $this->pageNumber++;
         }
     } else {
         exit("no persons/companies to issue to certificate to");
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     }
 }
예제 #10
0
파일: PrintTD.php 프로젝트: armic/erpts
 function Main()
 {
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         exit("afs not found");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             exit("error xmlDoc");
         } else {
             $afs = new AFS();
             $afs->parseDomDocument($domDoc);
             $this->formArray["propertyIndexNumber"] = $afs->getPropertyIndexNumber();
             $this->formArray["arpNumber"] = $afs->getArpNumber();
             $this->formArray["effectivity"] = $afs->getEffectivity();
             if ($afs->getTaxability() == "Taxable") {
                 $this->formArray["isTaxable"] = "X";
                 $this->formArray["isExempt"] = "  ";
             } else {
                 if ($afs->getTaxability() == "Exempt") {
                     $this->formArray["isExempt"] = "X";
                     $this->formArray["isTaxable"] = "  ";
                 }
             }
             $this->displayODAFS($this->formArray["afsID"]);
             $this->displayTDDetails();
             // if propertyType is "Land", grab Land values plus PlantsTrees values
             // if propertyType is "ImprovementsBuildings" or "Machineries", system should later on grab
             // "Land" from another AFS from based on bldg->landPin or mach->landPin field
             // still needs to be resolved whether to do it this way or not
             switch ($this->formArray["propertyType"]) {
                 case "Land":
                     $landList = $afs->getLandArray();
                     $plantsTreesList = $afs->getPlantsTreesArray();
                     if (is_array($landList)) {
                         $this->displayLandDetails($landList);
                         $this->displayLandList($landList);
                     }
                     if (is_array($plantsTreesList)) {
                         $this->displayPlantsTreesList($plantsTreesList);
                     }
                     break;
                 case "ImprovementsBuildings":
                     $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
                     if (is_array($improvementsBuildingsList)) {
                         $this->displayImprovementsBuildingsList($improvementsBuildingsList);
                     }
                     break;
                 case "Machineries":
                     $machineriesList = $afs->getMachineriesArray();
                     if (is_array($machineriesList)) {
                         $this->displayMachineriesList($machineriesList);
                     }
                     break;
             }
             // UNCOMMENT LINES TO GRAB totalMarketValue and totalAssessedValue from AFS object instead of
             // computing from each property:
             //$this->formArray["totalMarketValue"] = $afs->getTotalMarketValue();
             //$this->formArray["totalAssessedValue"] = $afs->getTotalAssessedValue();
             $this->formArray["totalAssessedValueInWords"] = makewords($this->formArray["totalAssessedValue"]);
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     exit;
 }
예제 #11
0
 function Main()
 {
     $this->displayPageHeading();
     $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
     $this->tpl->set_block("Page", "CollectionList", "CollectionListBlock");
     $this->tpl->set_block("Page", "GrandTotal", "GrandTotalBlock");
     $collectionArrayList = $this->getCollectionArrayList();
     if (!is_array($collectionArrayList)) {
         exit("no results found for the selected owner in collection list or empty database");
     }
     $lineCounter = 0;
     $continuousLineCounter = 0;
     $count = count($collectionArrayList);
     $numOfPages = ceil($count / $this->formArray["collectionLinesPerPage"]);
     //		foreach($collectionArrayList as $key => $value){
     //			$keyArray[] = $key;
     //		}
     $tmpOwnerName = "";
     for ($collectionCounter = 0; $collectionCounter <= $count; $collectionCounter++) {
         if ($lineCounter == $this->formArray["collectionLinesPerPage"] || $collectionCounter == $count) {
             $this->formArray["stYPos"] = $this->formArray["cYPos"] - 30;
             $this->formArray["gtYPos"] = $this->formArray["stYPos"] - 20;
             $this->tpl->set_var("stYPos", $this->formArray["stYPos"]);
             $this->tpl->set_var("gtYPos", $this->formArray["gtYPos"]);
             $this->tpl->set_var("stBasicTax", formatCurrency($this->formArray["stBasicTax"]));
             $this->tpl->set_var("stSefTax", formatCurrency($this->formArray["stSefTax"]));
             $this->tpl->set_var("stTotal", formatCurrency($this->formArray["stTotal"]));
             if ($this->formArray["pageNumber"] < $numOfPages) {
                 $this->tpl->set_var("GrandTotalBlock", "");
             } else {
                 $this->tpl->set_var("gtBasicTax", formatCurrency($this->formArray["gtBasicTax"]));
                 $this->tpl->set_var("gtSefTax", formatCurrency($this->formArray["gtSefTax"]));
                 $this->tpl->set_var("gtTotal", formatCurrency($this->formArray["gtTotal"]));
                 $this->tpl->parse("GrandTotalBlock", "GrandTotal", false);
             }
             $this->tpl->set_var("pageNumber", $this->formArray["pageNumber"]);
             $this->tpl->parse("PageBlock", "Page", true);
             $this->tpl->set_var("CollectionListBlock", "");
             $this->formArray["pageNumber"]++;
             $this->formArray["cYPos"] = 616;
             $lineCounter = 0;
         }
         $collectionRecordArray = $collectionArrayList[$collectionCounter];
         if ($tmpOwnerName != $collectionRecordArray["ownerName"]) {
             $ownerName = $collectionRecordArray["ownerName"];
         } else {
             $ownerName = "''";
         }
         if (strlen($ownerName) > 22) {
             $this->tpl->set_var("ownerName", substr($ownerName, 0, 22) . "-");
             $this->tpl->set_var("ownerName2", substr($ownerName, 22));
             $cYPos2 = $this->formArray["cYPos"] - 12;
         } else {
             $this->tpl->set_var("ownerName", $ownerName);
             $this->tpl->set_var("ownerName2", "");
             $cYPos2 = 0;
         }
         $tmpOwnerName = $collectionRecordArray["ownerName"];
         $this->tpl->set_var("taxDeclarationNumber", $collectionRecordArray["taxDeclarationNumber"]);
         $this->tpl->set_var("datePaid", $collectionRecordArray["datePaid"]);
         $this->tpl->set_var("orNumber", $collectionRecordArray["orNumber"]);
         $this->tpl->set_var("basicTax", formatCurrency($collectionRecordArray["basicTax"]));
         $this->tpl->set_var("sefTax", formatCurrency($collectionRecordArray["sefTax"]));
         $this->tpl->set_var("total", formatCurrency($collectionRecordArray["total"]));
         $this->formArray["stBasicTax"] += $collectionRecordArray["basicTax"];
         $this->formArray["stSefTax"] += $collectionRecordArray["sefTax"];
         $this->formArray["stTotal"] += $collectionRecordArray["total"];
         $this->formArray["gtBasicTax"] += $collectionRecordArray["basicTax"];
         $this->formArray["gtSefTax"] += $collectionRecordArray["sefTax"];
         $this->formArray["gtTotal"] += $collectionRecordArray["total"];
         $this->tpl->set_var("cYPos", $this->formArray["cYPos"]);
         $this->tpl->set_var("cYPos2", $cYPos2);
         $this->formArray["cYPos"] -= 12;
         if ($cYPos2 > 0) {
             $this->formArray["cYPos"] -= 12;
             $lineCounter++;
         }
         $this->tpl->set_var("i", $continuousLineCounter + 1);
         $this->tpl->parse("CollectionListBlock", "CollectionList", true);
         $lineCounter++;
         $continuousLineCounter++;
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("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);
     }
 }
예제 #12
0
 function Main()
 {
     $this->displayPageHeading();
     $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
     $this->tpl->set_var("pageNumber", 1);
     $this->tpl->set_block("Page", "Row", "RowBlock");
     $this->tpl->set_block("Page", "Totals", "TotalsBlock");
     $this->formArray["dayArray"] = $this->getDayArrayFromMonthYear();
     $totalsArray = array("totalPaidBasic" => 0, "totalPriorBasic" => 0, "totalPenaltyBasic" => 0, "totalDiscountBasic" => 0, "totalPaidSEF" => 0, "totalPriorSEF" => 0, "totalPenaltySEF" => 0, "totalDiscountSEF" => 0);
     if (is_array($this->formArray["dayArray"])) {
         foreach ($this->formArray["dayArray"] as $day) {
             if ($this->paymentRecords = $this->filterPaymentsByDate($this->formArray["year"], $this->formArray["month"], $day)) {
                 if (is_array($this->paymentRecords->getArrayList())) {
                     $list = $this->paymentRecords->getArrayList();
                     $list2 = $list;
                     $merged = array_merge($list, $list2);
                     $this->formArray["paidBasic"] = 0.0;
                     $this->formArray["priorBasic"] = 0.0;
                     $this->formArray["penaltyBasic"] = 0.0;
                     $this->formArray["discountBasic"] = 0.0;
                     $this->formArray["paidSEF"] = 0.0;
                     $this->formArray["priorSEF"] = 0.0;
                     $this->formArray["penaltySEF"] = 0.0;
                     $this->formArray["discountSEF"] = 0.0;
                     foreach ($list as $payment) {
                         $this->incrementValues($payment);
                     }
                     $totalsArray["totalPaidBasic"] += un_number_format($this->formArray["paidBasic"]);
                     $totalsArray["totalPriorBasic"] += un_number_format($this->formArray["priorBasic"]);
                     $totalsArray["totalPenaltyBasic"] += un_number_format($this->formArray["penaltyBasic"]);
                     $totalsArray["totalDiscountBasic"] += un_number_format($this->formArray["discountBasic"]);
                     $totalsArray["totalPaidSEF"] += un_number_format($this->formArray["paidSEF"]);
                     $totalsArray["totalPriorSEF"] += un_number_format($this->formArray["priorSEF"]);
                     $totalsArray["totalPenaltySEF"] += un_number_format($this->formArray["penaltySEF"]);
                     $totalsArray["totalDiscountSEF"] += un_number_format($this->formArray["discountSEF"]);
                     $this->tpl->set_var("collectionDate", date("M d, Y", strtotime($this->formArray["year"] . "-" . $this->formArray["month"] . "-" . $day)));
                     $this->tpl->set_var("paidBasic", formatCurrency($this->formArray["paidBasic"]));
                     $this->tpl->set_var("priorBasic", formatCurrency($this->formArray["priorBasic"]));
                     $this->tpl->set_var("penaltyBasic", formatCurrency($this->formArray["penaltyBasic"]));
                     $this->tpl->set_var("discountBasic", formatCurrency($this->formArray["discountBasic"]));
                     $this->tpl->set_var("paidSEF", formatCurrency($this->formArray["paidSEF"]));
                     $this->tpl->set_var("priorSEF", formatCurrency($this->formArray["priorSEF"]));
                     $this->tpl->set_var("penaltySEF", formatCurrency($this->formArray["penaltySEF"]));
                     $this->tpl->set_var("discountSEF", formatCurrency($this->formArray["discountSEF"]));
                     $this->tpl->set_var("yposLine", $this->formArray["yposLine"]);
                     $this->tpl->parse("RowBlock", "Row", true);
                     $this->formArray["yposLine"] = $this->formArray["yposLine"] - 10;
                     if ($this->formArray["yposLine"] < 70) {
                         // new page
                         $this->tpl->set_var("TotalsBlock", "");
                         $this->tpl->set_var("pageNumber", $this->formArray["pageNumber"]);
                         $this->tpl->parse("PageBlock", "Page", true);
                         $this->tpl->set_var("RowBlock", "");
                         $this->tpl->set_var("TotalsBlock", "");
                         $this->formArray["yposLine"] = 460;
                         $this->formArray["pageNumber"]++;
                     }
                 }
             }
         }
     }
     $this->tpl->set_var("totalPages", $this->formArray["pageNumber"]);
     // last page
     // print totals:
     foreach ($totalsArray as $key => $value) {
         $value = formatCurrency($value);
         $this->tpl->set_var($key, $value);
     }
     $this->tpl->parse("TotalsBlock", "Totals", true);
     if ($this->formArray["yposLine"] == 460) {
         if ($this->formArray["pageNumber"] - 1 >= 1) {
             $this->tpl->set_var("totalPages", $this->formArray["pageNumber"] - 1);
         } else {
             $this->tpl->set_var("pageNumber", 1);
             $this->tpl->set_var("totalPages", 1);
             $this->tpl->parse("PageBlock", "Page", true);
             $this->tpl->set_var("RowBlock", "");
             $this->tpl->set_var("TotalsBlock", "");
         }
     } else {
         if ($this->formArray["yposLine"] < 460 && $this->formArray["yposLine"] >= 70) {
             $this->tpl->set_var("pageNumber", $this->formArray["pageNumber"]);
             $this->tpl->parse("PageBlock", "Page", true);
             $this->tpl->set_var("RowBlock", "");
             $this->tpl->set_var("TotalsBlock", "");
         }
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     }
 }
예제 #13
0
 function Main()
 {
     $this->displayPageHeading();
     $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
     $this->tpl->set_block("Page", "TaxRollList", "TaxRollListBlock");
     $this->tpl->set_block("Page", "GrandTotal", "GrandTotalBlock");
     $taxRollArrayList = $this->getTaxRollArrayList();
     if (!is_array($taxRollArrayList)) {
         exit("no results found for the selected barangay in tax roll or empty database");
     }
     $trLineCounter = 0;
     $trCount = count($taxRollArrayList);
     $numOfPages = ceil($trCount / $this->formArray["taxRollLinesPerPage"]);
     foreach ($taxRollArrayList as $key => $value) {
         $keyArray[] = $key;
     }
     for ($taxRollCounter = 0; $taxRollCounter <= $trCount; $taxRollCounter++) {
         if ($trLineCounter == $this->formArray["taxRollLinesPerPage"] || $taxRollCounter == $trCount) {
             $this->formArray["stYPos"] = $this->formArray["trYPos"] - 30;
             $this->formArray["gtYPos"] = $this->formArray["stYPos"] - 20;
             $this->tpl->set_var("stYPos", $this->formArray["stYPos"]);
             $this->tpl->set_var("gtYPos", $this->formArray["gtYPos"]);
             $this->tpl->set_var("stAssessedValue", formatCurrency($this->formArray["stAssessedValue"]));
             $this->tpl->set_var("stBasicTax", formatCurrency($this->formArray["stBasicTax"]));
             $this->tpl->set_var("stSefTax", formatCurrency($this->formArray["stSefTax"]));
             $this->tpl->set_var("stTotal", formatCurrency($this->formArray["stTotal"]));
             if ($this->formArray["pageNumber"] < $numOfPages) {
                 $this->tpl->set_var("GrandTotalBlock", "");
             } else {
                 $this->tpl->set_var("gtAssessedValue", formatCurrency($this->formArray["gtAssessedValue"]));
                 $this->tpl->set_var("gtBasicTax", formatCurrency($this->formArray["gtBasicTax"]));
                 $this->tpl->set_var("gtSefTax", formatCurrency($this->formArray["gtSefTax"]));
                 $this->tpl->set_var("gtTotal", formatCurrency($this->formArray["gtTotal"]));
                 $this->tpl->parse("GrandTotalBlock", "GrandTotal", false);
             }
             $this->tpl->set_var("pageNumber", $this->formArray["pageNumber"]);
             $this->tpl->parse("PageBlock", "Page", true);
             $this->tpl->set_var("TaxRollListBlock", "");
             $this->formArray["pageNumber"]++;
             $this->formArray["trYPos"] = 616;
             $trLineCounter = 0;
         }
         $taxRollRecordArray = $taxRollArrayList[$keyArray[$taxRollCounter]];
         if (strlen($taxRollRecordArray["ownerName"]) > 20) {
             $this->tpl->set_var("ownerName", substr($taxRollRecordArray["ownerName"], 0, 25) . "-");
             $this->tpl->set_var("ownerName2", substr($taxRollRecordArray["ownerName"], 25));
             $trYpos2 = $this->formArray["trYPos"] - 12;
         } else {
             $this->tpl->set_var("ownerName", $taxRollRecordArray["ownerName"]);
             $this->tpl->set_var("ownerName2", "");
             $trYpos2 = 0;
         }
         $this->tpl->set_var("taxDeclarationNumber", $taxRollRecordArray["taxDeclarationNumber"]);
         $this->tpl->set_var("actualUse", $taxRollRecordArray["actualUse"]);
         $this->tpl->set_var("assessedValue", formatCurrency($taxRollRecordArray["assessedValue"]));
         $this->tpl->set_var("basicTax", formatCurrency($taxRollRecordArray["basicTax"]));
         $this->tpl->set_var("sefTax", formatCurrency($taxRollRecordArray["sefTax"]));
         $this->tpl->set_var("total", formatCurrency($taxRollRecordArray["total"]));
         $this->formArray["stAssessedValue"] += $taxRollRecordArray["assessedValue"];
         $this->formArray["stBasicTax"] += $taxRollRecordArray["basicTax"];
         $this->formArray["stSefTax"] += $taxRollRecordArray["sefTax"];
         $this->formArray["stTotal"] += $taxRollRecordArray["total"];
         $this->formArray["gtAssessedValue"] += $taxRollRecordArray["assessedValue"];
         $this->formArray["gtBasicTax"] += $taxRollRecordArray["basicTax"];
         $this->formArray["gtSefTax"] += $taxRollRecordArray["sefTax"];
         $this->formArray["gtTotal"] += $taxRollRecordArray["total"];
         $this->tpl->set_var("trYPos", $this->formArray["trYPos"]);
         $this->tpl->set_var("trYPos2", $trYpos2);
         $this->formArray["trYPos"] -= 12;
         if ($trYpos2 > 0) {
             $this->formArray["trYPos"] -= 12;
         }
         $this->tpl->parse("TaxRollListBlock", "TaxRollList", true);
         $trLineCounter++;
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     }
 }
예제 #14
0
파일: PrintTD_old.php 프로젝트: armic/erpts
 function Main()
 {
     $propertyType = $this->formArray["propertyType"];
     $propertyID = $this->formArray["propertyID"];
     switch ($propertyType) {
         case "Land":
             $LandDetails = new SoapObject(NCCBIZ . "LandDetails.php", "urn:Object");
             if (!($xmlStr = $LandDetails->getLand($propertyID))) {
                 echo "xml failed";
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     echo "error open xml";
                 } else {
                     $land = new Land();
                     $land->parseDomDocument($domDoc);
                     $this->formArray["landTotalMarketValue"] += tofloat($land->getMarketValue());
                     $this->formArray["landTotalAssessedValue"] += tofloat($land->getAssessedValue());
                     $this->displayLand($land);
                 }
             }
             break;
         case "PlantsTrees":
             $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object");
             if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($propertyID))) {
                 echo "xml failed";
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     echo "error open xml";
                 } else {
                     $plantsTrees = new PlantsTrees();
                     $plantsTrees->parseDomDocument($domDoc);
                     //$plantsTrees->selectRecord($propertyID);
                     $this->formArray["plantTotalMarketValue"] += tofloat($plantsTrees->getMarketValue());
                     $this->formArray["plantTotalAssessedValue"] += tofloat($plantsTrees->getAssessedValue());
                     $this->displayPlantsTrees($plantsTrees);
                 }
             }
             break;
         case "ImprovementsBuildings":
             $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
             if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($propertyID))) {
                 echo "xml failed";
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     echo "error open xml";
                 } else {
                     $improvementsBuildings = new ImprovementsBuildings();
                     $improvementsBuildings->parseDomDocument($domDoc);
                     $this->formArray["bldgTotalMarketValue"] += tofloat($improvementsBuildings->getMarketValue());
                     $this->formArray["bldgTotalAssessedValue"] += tofloat($improvementsBuildings->getAssessedValue());
                     $this->displayImprovementsBuildings($improvementsBuildings);
                 }
             }
             break;
         case "Machineries":
             $MachineriesDetails = new SoapObject(NCCBIZ . "MachineriesDetails.php", "urn:Object");
             if (!($xmlStr = $MachineriesDetails->getMachineries($propertyID))) {
                 echo "xml failed";
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     echo "error open xml";
                 } else {
                     $machineries = new Machineries();
                     $machineries->parseDomDocument($domDoc);
                     $this->formArray["machTotalMarketValue"] += tofloat($machineries->getMarketValue());
                     $this->formArray["machTotalAssessedValue"] += tofloat($machineries->getAssessedValue());
                     $this->displayMachineries($machineries);
                 }
             }
             break;
         default:
             echo "wrong property type";
     }
     //$this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     exit;
 }
예제 #15
0
 function Main()
 {
     $db = new DB_RPTS();
     if ($this->formArray['quarter'] == "Q1") {
         $this->formArray['startDate'] = $this->formArray['yearYY'] . "-01-01-";
         $this->formArray['endDate'] = $this->formArray['yearYY'] . "-03-31";
         $this->formArray['monthEnd'] = "March";
     } elseif ($this->formArray['quarter'] == "Q2") {
         $this->formArray['startDate'] = $this->formArray['yearYY'] . "-04-01-";
         $this->formArray['endDate'] = $this->formArray['yearYY'] . "-06-30";
         $this->formArray['monthEnd'] = "June";
     } elseif ($this->formArray['quarter'] == "Q3") {
         $this->formArray['startDate'] = $this->formArray['yearYY'] . "-07-01-";
         $this->formArray['endDate'] = $this->formArray['yearYY'] . "-09-30";
         $this->formArray['monthEnd'] = "September";
     } elseif ($this->formArray['quarter'] == "Q4") {
         $this->formArray['startDate'] = $this->formArray['yearYY'] . "-10-01-";
         $this->formArray['endDate'] = $this->formArray['yearYY'] . "-12-31";
         $this->formArray['monthEnd'] = "December";
     }
     /*$sql =	"SELECT  LandActualUses.description as ldesc FROM  LandActualUses ".
     				" INNER  JOIN ImprovementsBuildingsActualUses ON LandActualUses.description = ImprovementsBuildingsActualUses.description".
     				" INNER  JOIN MachineriesActualUses ON MachineriesActualUses.description = ImprovementsBuildingsActualUses.description".
     				" LEFT  JOIN PlantsTreesActualUses ON PlantsTreesActualUses.description = ImprovementsBuildingsActualUses.description";
     
     		$db->query($sql);
     		*/
     $buff = array("Residential", "Agricultural", "Commercial", "Industrial", "Mineral", "Timber", "Special", "Hospital", "Scientific", "Cultural", "Other");
     $this->tpl->set_block("rptsTemplate", "ROW", "rBlk");
     for ($i = 0; $i < count($buff); $i++) {
         $this->formArray['ldesc'] = $buff[$i];
         $this->formArray['specialLevy'] = 0;
         $this->formArray['totalSpecialLevy'] += $this->formArray['specialLevy'];
         $this->compute($buff[$i], "Land", "Basic");
         $this->compute($buff[$i], "Machineries", "Basic");
         $this->compute($buff[$i], "ImprovementsBuildings", "Basic");
         $this->compute($buff[$i], "PlantsTrees", "Basic");
         $this->formArray['paidBasic'] = $this->paidBasicLand + $this->paidBasicImprovementsBuildings + $this->paidBasicMachineries + $this->paidBasicPlantsTrees;
         $this->formArray['discountBasic'] = $this->discountBasicLand + $this->discountBasicImprovementsBuildings + $this->discountBasicMachineries + $this->discountBasicPlantsTrees;
         $this->formArray['priorBasic'] = $this->priorBasicLand + $this->priorBasicImprovementsBuildings + $this->priorBasicMachineries + $this->priorBasicPlantsTrees;
         $this->formArray['penaltyBasic'] = $this->penaltyBasicLand + $this->penaltyBasicImprovementsBuildings + $this->penaltyBasicMachineries + $this->penaltyBasicPlantsTrees;
         $this->formArray['priorPenaltyBasic'] = $this->priorPenaltyBasicLand + $this->priorPenaltyBasicImprovementsBuildings + $this->priorPenaltyBasicMachineries + $this->priorPenaltyBasicPlantsTrees;
         $this->formArray['totalGrossBasic'] = $this->totalGrossBasicLand + $this->totalGrossBasicImprovementsBuildings + $this->totalGrossBasicMachineries + $this->totalGrossBasicPlantsTrees;
         $this->formArray['totalNetBasic'] = $this->totalNetBasicLand + $this->totalNetBasicImprovementsBuildings + $this->totalNetBasicMachineries + $this->totalNetBasicPlantsTrees;
         $this->formArray['totalTotalNetBasic'] += $this->formArray['totalNetBasic'];
         $this->formArray['totalPaidBasic'] += $this->formArray['paidBasic'];
         $this->formArray['totalDiscountBasic'] += $this->formArray['discountBasic'];
         $this->formArray['totalPriorBasic'] += $this->formArray['priorBasic'];
         $this->formArray['totalPenaltyBasic'] += $this->formArray['penaltyBasic'];
         $this->formArray['totalPriorPenaltyBasic'] += $this->formArray['priorPenaltyBasic'];
         $this->formArray['totalTotalGrossBasic'] += $this->formArray['totalGrossBasic'];
         $this->compute($buff[$i], "Land", "Sef");
         $this->compute($buff[$i], "Machineries", "Sef");
         $this->compute($buff[$i], "ImprovementsBuildings", "Sef");
         $this->compute($buff[$i], "PlantsTrees", "Sef");
         $this->formArray['paidSEF'] = $this->paidSefLand + $this->paidSefImprovementsBuildings + $this->paidSefMachineries + $this->paidSefPlantsTrees;
         $this->formArray['discountSEF'] = $this->discountSefLand + $this->discountSefImprovementsBuildings + $this->discountSefMachineries + $this->discountSefPlantsTrees;
         $this->formArray['priorSEF'] = $this->priorSefLand + $this->priorSefImprovementsBuildings + $this->priorSefMachineries + $this->priorSefPlantsTrees;
         $this->formArray['penaltySEF'] = $this->penaltySefLand + $this->penaltySefImprovementsBuildings + $this->penaltySefMachineries + $this->penaltySefPlantsTrees;
         $this->formArray['priorPenaltySEF'] = $this->priorPenaltySefLand + $this->priorPenaltySefImprovementsBuildings + $this->priorPenaltyBasicMachineries + $this->priorPenaltyBasicPlantsTrees;
         $this->formArray['totalGrossSEF'] = $this->totalGrossSefLand + $this->totalGrossSefImprovementsBuildings + $this->totalGrossSefMachineries + $this->totalGrossSefPlantsTrees;
         $this->formArray['totalNetSEF'] = $this->totalNetSefLand + $this->totalNetSefImprovementsBuildings + $this->totalNetSefMachineries + $this->totalNetSefPlantsTrees;
         $this->formArray['totalTotalNetSEF'] += $this->formArray['totalNetSEF'];
         $this->formArray['totalPaidSEF'] += $this->formArray['paidSEF'];
         $this->formArray['totalDiscountSEF'] += $this->formArray['discountSEF'];
         $this->formArray['totalPriorSEF'] += $this->formArray['priorSEF'];
         $this->formArray['totalPenaltySEF'] += $this->formArray['penaltySEF'];
         $this->formArray['totalPriorPenaltySEF'] += $this->formArray['priorPenaltySEF'];
         $this->formArray['totalTotalGrossSEF'] += $this->formArray['totalGrossSEF'];
         $this->compute($buff[$i], "Land", "Idle");
         $this->compute($buff[$i], "Machineries", "Idle");
         $this->compute($buff[$i], "ImprovementsBuildings", "Idle");
         $this->compute($buff[$i], "PlantsTrees", "Idle");
         $this->formArray['paidIdle'] = $this->paidIdleLand + $this->paidIdleImprovementsBuildings + $this->paidIdleMachineries + $this->paidIdlePlantsTrees;
         $this->formArray['discountIdle'] = $this->discountIdleLand + $this->discountIdleImprovementsBuildings + $this->discountIdleMachineries + $this->discountIdlePlantsTrees;
         $this->formArray['priorIdle'] = $this->priorIdleLand + $this->priorIdleImprovementsBuildings + $this->priorIdleMachineries + $this->priorIdlePlantsTrees;
         $this->formArray['penaltyIdle'] = $this->penaltyIdleLand + $this->penaltyIdleImprovementsBuildings + $this->penaltyIdleMachineries + $this->penaltyIdlePlantsTrees;
         $this->formArray['priorPenaltyIdle'] = $this->priorPenaltyIdleLand + $this->priorPenaltyIdleImprovementsBuildings + $this->priorPenaltyBasicMachineries + $this->priorPenaltyBasicPlantsTrees;
         $this->formArray['totalGrossIdle'] = $this->totalGrossIdleLand + $this->totalGrossIdleImprovementsBuildings + $this->totalGrossIdleMachineries + $this->totalGrossIdlePlantsTrees;
         $this->formArray['totalIdle'] = $this->totalNetIdleLand + $this->totalNetIdleImprovementsBuildings + $this->totalNetIdleMachineries + $this->totalNetIdlePlantsTrees;
         $this->formArray['totalTotalNetIdle'] += $this->formArray['totalNetIdle'];
         $this->formArray['totalPaidIdle'] += $this->formArray['paidIdle'];
         $this->formArray['totalDiscountIdle'] += $this->formArray['discountIdle'];
         $this->formArray['totalPriorIdle'] += $this->formArray['priorIdle'];
         $this->formArray['totalPenaltyIdle'] += $this->formArray['penaltyIdle'];
         $this->formArray['totalPriorPenaltyIdle'] += $this->formArray['priorPenaltyIdle'];
         $this->formArray['totalTotalIdle'] += $this->formArray['totalIdle'];
         $this->computeTotalNonCash($buff[$i], "Land");
         $this->computeTotalNonCash($buff[$i], "ImprovementBuildings");
         $this->computeTotalNonCash($buff[$i], "Machineries");
         $this->computeTotalNonCash("ldesc", "PlantsTrees");
         $this->formArray['totalNonCash'] = $this->totalNoncashLand + $this->totalNoncashImprovementsBuildings + $this->totalNoncashMachineries + $this->totalNoncashPlantsTrees;
         $this->formArray['grandTotalNetColl'] = $this->formArray['totalNetBasic'] + $this->formArray['totalNetSEF'] + $this->formArray['totalIdle'] + $this->formArray['totalNonCash'] + $this->formArray['specialLevy'];
         $this->formArray['totalTotalNonCash'] += $this->formArray['totalNonCash'];
         $this->formArray['totalGrandTotalNetColl'] += $this->formArray['grandTotalNetColl'];
         $this->formArray['ypos'] = $this->formArray['ypos'] - 10;
         $this->tpl->set_var($this->formArray);
         $this->tpl->parse("rBlk", "ROW", true);
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     //$this->tpl->p("templatePage");
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get('templatePage'), "string");
     $rptrpdf->writePDF("collectionReport.pdf");
 }
예제 #16
0
    $ypos1 = 416;
    $yposx = 428;
    $yposx1 = 420;
}
#exit;
//if ($i==0) {
//	$tpl->set_var(rowBlk,"<tr><td colspan=\"27\">No records yet.</td></tr>");
//}
$tpl->set_var(startDate, $startDate);
$tpl->set_var(endDate, $endDate);
$tpl->set_var("Session", $sess->url(""));
//$tpl->pparse(report,report);
///*
$tpl->parse('report', 'report');
$tpl->finish('report');
$rptrpdf = new PDFWriter();
//exit($tpl->get('report'));
$rptrpdf->setOutputXML($tpl->get('report'), "string");
$rptrpdf->writePDF("collectionReport2.pdf");
//*/
page_close();
function writeQuery($var, $startDate, $endDate, $municipalityCityID, $rpuClass)
{
    $sql = "select Receipt.receiptNumber as orNo" . ", Receipt.receiptDate as datePaid" . ", Receipt.receivedFrom as taxpayerName" . ", Barangay.description as barangay" . ", Collection.collectionID" . ", Receipt.receiptID" . ", Payment.paymentID" . ", Due.dueID" . ", TD.tdID" . ", AFS.afsID" . ", OD.odID" . ", MunicipalityCity.description" . " FROM Collection,MunicipalityCity" . " INNER JOIN Receipt ON Receipt.receiptID = Collection.receiptID" . " INNER JOIN Payment ON Payment.paymentID = Collection.paymentID" . " INNER JOIN Due ON Due.dueID = Payment.dueID" . " INNER JOIN TD ON TD.tdID = Due.tdID" . " INNER JOIN AFS ON AFS.afsID = TD.afsID" . " INNER JOIN {$var} ON AFS.afsID = " . $var . ".afsID" . " INNER JOIN " . $var . "ActualUses ON {$var}.actualUse = " . $var . "ActualUses." . strtolower($var) . "ActualUsesID" . " INNER JOIN OD ON OD.odID = AFS.odID" . " INNER JOIN Location ON Location.odID = OD.odID" . " INNER JOIN LocationAddress ON LocationAddress.locationAddressID = Location.locationAddressID" . " INNER JOIN Barangay ON Barangay.barangayID = LocationAddress.barangayID" . " WHERE Receipt.receiptDate between '{$startDate}' AND '{$endDate}'" . " AND MunicipalityCity.municipalityCityID=" . $municipalityCityID . " AND " . $var . "ActualUses.code = '{$rpuClass}'  and Payment.status != 'cancelled';";
    /*		$sql = "select distinct collections.receiptNum as orNo
    			, collections.collectionDate as datePaid
    			, collections.receivedFrom as taxpayerName, ".
    			"Barangay.description as barangay".
    			" FROM collections".
    			" INNER JOIN collectionPayments ON collectionPayments.collectionID = collections.collectionID".
    			" INNER JOIN payments ON payments.paymentID = collectionPayments.paymentID".
예제 #17
0
 function Main()
 {
     $eRPTSSettings = new eRPTSSettings();
     if ($eRPTSSettings->selectRecord(1)) {
         $this->tpl->set_var("lguType", strtoupper($eRPTSSettings->getLguType()));
         $this->tpl->set_var("lguName", strtoupper($eRPTSSettings->getLguName()));
     }
     $dbTD = new DB_RPTS();
     $dbBacktaxTD = new DB_RPTS();
     $dbPaymentBacktaxTD = new DB_RPTS();
     $dbPaymentTD = new DB_RPTS();
     $dbDues = new DB_RPTS();
     // gather TD's
     $sql = "SELECT Due.dueID as dueID, " . "Due.tdID as tdID, " . "Due.dueType as dueType, " . "Due.dueDate as dueDate, " . "Due.basicTax as basicTax, " . "Due.basicTaxRate as basicTaxRate, " . "Due.sefTax as sefTax, " . "Due.sefTaxRate as sefTaxRate, " . "Due.idleTax as idleTax, " . "Due.idleTaxRate as idleTaxRate, " . "TD.afsID as afsID, " . "TD.propertyType as propertyType, " . "TD.taxDeclarationNumber as taxDeclarationNumber, " . "AFS.odID as odID, " . "AFS.arpNumber as arpNumber, " . "AFS.propertyIndexNumber as propertyIndexNumber, " . "AFS.taxability as taxability, " . "AFS.effectivity as effectivity, " . "AFS.totalMarketValue as totalMarketValue, " . "AFS.totalAssessedValue as totalAssessedValue " . "FROM Due, TD, AFS " . "WHERE Due.tdID = TD.tdID " . "AND TD.afsID = AFS.afsID " . "AND AFS.archive != 'true' " . "AND TD.archive != 'true' " . "AND Due.dueType = 'Annual' " . "AND YEAR(Due.dueDate)  <= YEAR(NOW()) " . "AND TD.propertyType LIKE '" . $this->formArray["classification"] . "' " . "GROUP BY Due.tdID, YEAR(Due.dueDate) " . "ORDER BY Due.dueDate DESC";
     $dbTD->query($sql);
     if ($dbTD->nf() > 0) {
         // gather BacktaxTD's
         while ($dbTD->next_record()) {
             $sqlBacktaxTD = "SELECT backtaxTDID, " . "tdID, " . "tdNumber, " . "startYear, " . "endYear, " . "startQuarter, " . "assessedValue, " . "basicRate, " . "sefRate, " . "basicTax, " . "sefTax, " . "idleTax, " . "penalties, " . "paid, " . "balance, " . "total " . "FROM BacktaxTD " . "WHERE tdID='" . $dbTD->f("tdID") . "' " . "ORDER BY startYear ASC ";
             $dbBacktaxTD->query($sqlBacktaxTD);
             if ($dbBacktaxTD->nf() > 0) {
                 while ($dbBacktaxTD->next_record()) {
                     $backtaxTDRecordArray[] = $dbBacktaxTD->Record;
                 }
             }
             $tdRecordArray[] = array("td" => $dbTD->Record, "backtaxTD" => $backtaxTDRecordArray);
             unset($backtaxTDRecordArray);
         }
     }
     if (is_array($tdRecordArray)) {
         // verify whether each TD Record or BacktaxTD Record is delinquent by comparing it to Payment
         // if it is not in Payment it is considered delinquent
         // if amountPaid is insufficient to amountDue, it is considered delinquent
         foreach ($tdRecordArray as $recordArray) {
             $basicAmountDelinquent = 0;
             $sefAmountDelinquent = 0;
             $penalty = 0;
             $totalDelinquent = 0;
             // find delinquent backtaxTD's
             if (is_array($recordArray["backtaxTD"])) {
                 foreach ($recordArray["backtaxTD"] as $backtaxTDRecord) {
                     $basicAmountDelinquent = 0;
                     $sefAmountDelinquent = 0;
                     $penalty = 0;
                     $totalDelinquent = 0;
                     $sqlPaymentBacktaxTD = "SELECT paymentID, " . "dueType, " . "backtaxTDID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE backtaxTDID='" . $backtaxTDRecord["backtaxTDID"] . "' " . "AND status!='cancelled'";
                     $dbPaymentBacktaxTD->query($sqlPaymentBacktaxTD);
                     if ($dbPaymentBacktaxTD->nf() > 0) {
                         if ($dbPaymentBacktaxTD->next_record()) {
                             // if amountPaid is less than balanceDue, it is delinquent
                             if ($dbPaymentBacktaxTD->f("amountPaid") < $dbPaymentBacktaxTD->f("balanceDue")) {
                                 $paidBasic = $backtaxTDRecord["basicRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $dbPaymentBacktaxTD->f("amountPaid");
                                 $paidSef = $backtaxTDRecord["sefRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $dbPaymentBacktaxTD->f("amountPaid");
                                 $basicAmountDelinquent = $backtaxTDRecord["basicTax"] - $paidBasic;
                                 $sefAmountDelinquent = $backtaxTDRecord["sefTax"] - $paidSef;
                                 $backtaxTD = new BacktaxTD();
                                 $backtaxTD->selectRecord("", $backtaxTDRecord["backtaxTDID"], "");
                                 $backtaxTD->calculatePenalty(date("Y-m-d"));
                                 $penalty = $backtaxTD->getPenalties();
                                 $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                                 $delinquentRecordArray[] = array("propertyIndexNumber" => "", "taxDeclarationNumber" => $backtaxTDRecord["tdNumber"], "yearDelinquent" => $backtaxTDRecord["startYear"], "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                             }
                         }
                     } else {
                         $paidBasic = $backtaxTDRecord["basicRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $backtaxTDRecord["paid"];
                         $paidSef = $backtaxTDRecord["sefRate"] / ($backtaxTDRecord["basicRate"] + $backtaxTDRecord["sefRate"]) * $backtaxTDRecord["paid"];
                         $basicAmountDelinquent = $backtaxTDRecord["basicTax"] - $paidBasic;
                         $sefAmountDelinquent = $backtaxTDRecord["sefTax"] - $paidSef;
                         $backtaxTD = new BacktaxTD();
                         $backtaxTD->selectRecord("", $backtaxTDRecord["backtaxTDID"], "");
                         $backtaxTD->calculatePenalty(date("Y-m-d"));
                         $penalty = $backtaxTD->getPenalties();
                         $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                         $delinquentRecordArray[] = array("propertyIndexNumber" => "", "taxDeclarationNumber" => $backtaxTDRecord["tdNumber"], "yearDelinquent" => $backtaxTDRecord["startYear"], "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                     }
                 }
             }
             // find delinquent TD's
             if (is_array($recordArray["td"])) {
                 $tdRecord = $recordArray["td"];
                 $basicAmountDelinquent = 0;
                 $sefAmountDelinquent = 0;
                 $penalty = 0;
                 $totalDelinquent = 0;
                 $sqlPaymentTD = "SELECT paymentID, " . "dueID, " . "dueType, " . "tdID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE tdID='" . $tdRecord["tdID"] . "' " . "AND status!='cancelled'";
                 $dbPaymentTD->query($sqlPaymentTD);
                 if ($dbPaymentTD->nf() > 0) {
                     while ($dbPaymentTD->next_record()) {
                         if ($dbPaymentTD->f("dueType") == "Annual") {
                             if ($dbPaymentTD->f("amountPaid") < $dbPaymentTD->f("balanceDue")) {
                                 $paidBasic = $tdRecord["basicRate"] / ($tdRecord["basicRate"] + $tdRecord["sefRate"]) * $dbPaymentTD->f("amountPaid");
                                 $paidSef = $tdRecord["sefRate"] / ($tdRecord["basicRate"] + $tdRecord["sefRate"]) * $dbPaymentTD->f("amountPaid");
                                 $basicAmountDelinquent = $tdRecord["basicTax"] - $paidBasic;
                                 $sefAmountDelinquent = $tdRecord["sefTax"] - $paidSef;
                                 $due = new Due();
                                 $due->selectRecord($tdRecord["dueID"]);
                                 $due = $this->computePenalty(date("Y-m-d"), $due);
                                 $penalty = $due->getPenalty();
                                 $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                                 $delinquentRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "taxDeclarationNumber" => $tdRecord["taxDeclarationNumber"], "yearDelinquent" => date("Y", strtotime($tdRecord["dueDate"])), "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                             }
                             break;
                         } else {
                             $tmpPaidQuarterDues[] = $dbPaymentTD->f("dueID");
                         }
                     }
                     if (is_array($tmpPaidQuarterDues)) {
                         // not all quarters have been paid if less than four
                         if (count($tmpPaidQuarterDues) < 4) {
                             foreach ($tmpPaidQuarterDues as $dueID) {
                                 $sqlDueCondition .= " AND Due.dueID!='" . $dueID . "' ";
                             }
                             // grab unpaid quarterly dues that have not been paid before quarterly dueDate
                             $sqlDues = "SELECT Due.dueID as dueID, " . "Due.dueType as dueType, " . "Due.tdID as tdID " . "FROM Due, TD, AFS " . "WHERE TD.afsID = AFS.afsID " . "AND AFS.archive != 'true' " . "AND TD.archive != 'true' " . "AND Due.dueType != 'Annual' " . "AND Due.tdID = '" . $tdRecord["tdID"] . "'" . "AND TD.propertyType LIKE '" . $this->formArray["classification"] . "' " . "AND YEAR(Due.dueDate)  <= " . date("Y", strtotime($tdRecord["dueDate"])) . " " . "AND Due.dueDate <= '" . date("Y-m-d") . "' " . $sqlDueCondition . " " . "GROUP BY Due.tdID, Due.dueDate " . "ORDER BY Due.dueDate DESC";
                             $dbDues->query($sqlDues);
                             while ($dbDues->next_record()) {
                                 $due = new Due();
                                 $due->selectRecord($dbDues->f("dueID"));
                                 $basicAmountDelinquent += $due->getBasicTax();
                                 $sefAmountDelinquent += $due->getSefTax();
                                 $due = $this->computePenalty(date("Y-m-d"), $due);
                                 $penalty += $due->getPenalty();
                             }
                             $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                             $delinquentRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "taxDeclarationNumber" => $tdRecord["taxDeclarationNumber"], "yearDelinquent" => date("Y", strtotime($tdRecord["dueDate"])), "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                         }
                         unset($sqlDueCondition);
                         unset($tmpPaidQuarterDues);
                     }
                 } else {
                     $basicAmountDelinquent = $tdRecord["basicTax"];
                     $sefAmountDelinquent = $tdRecord["sefTax"];
                     $due = new Due();
                     $due->selectRecord($tdRecord["dueID"]);
                     $due = $this->computePenalty(date("Y-m-d"), $due);
                     $penalty = $due->getPenalty();
                     $totalDelinquent = $basicAmountDelinquent + $sefAmountDelinquent + $penalty;
                     $delinquentRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "taxDeclarationNumber" => $tdRecord["taxDeclarationNumber"], "yearDelinquent" => date("Y", strtotime($tdRecord["dueDate"])), "basicAmountDelinquent" => $basicAmountDelinquent, "sefAmountDelinquent" => $sefAmountDelinquent, "penalty" => $penalty, "totalDelinquent" => $totalDelinquent);
                 }
             }
         }
     }
     // print page
     if (is_array($delinquentRecordArray)) {
         $ypos = 615;
         $decrementYposBy = 12;
         $linesPerPage = 42;
         $count = count($delinquentRecordArray);
         $numOfPages = ceil($count / $linesPerPage);
         $pageCtr = 1;
         $lineCtr = 1;
         $recordCtr = 1;
         $this->tpl->set_var("classification", $this->formArray["classification"]);
         $this->tpl->set_var("numOfPages", $numOfPages);
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         $this->tpl->set_block("Page", "Row", "RowBlock");
         $this->tpl->set_block("Page", "Totals", "TotalsBlock");
         $totalsArray = array("totalBasicAmountDelinquent" => 0, "totalSefAmountDelinquent" => 0, "totalPenalty" => 0, "totalTotalDelinquent" => 0);
         foreach ($delinquentRecordArray as $recordArray) {
             $this->tpl->set_var("ypos", $ypos);
             $this->tpl->set_var("recordCtr", $recordCtr);
             // write values
             $totalsArray["totalBasicAmountDelinquent"] += un_number_format($recordArray["basicAmountDelinquent"]);
             $totalsArray["totalSefAmountDelinquent"] += un_number_format($recordArray["sefAmountDelinquent"]);
             $totalsArray["totalPenalty"] += un_number_format($recordArray["penalty"]);
             $totalsArray["totalTotalDelinquent"] += un_number_format($recordArray["totalDelinquent"]);
             foreach ($recordArray as $key => $value) {
                 switch ($key) {
                     case "basicAmountDelinquent":
                     case "sefAmountDelinquent":
                     case "penalty":
                     case "totalDelinquent":
                         $value = formatCurrency($value);
                         break;
                 }
                 $this->tpl->set_var($key, $value);
             }
             $this->tpl->parse("RowBlock", "Row", true);
             if ($recordCtr == count($delinquentRecordArray) || $lineCtr == $linesPerPage) {
                 if ($pageCtr == $numOfPages) {
                     foreach ($totalsArray as $key => $value) {
                         $value = formatCurrency($value);
                         $this->tpl->set_var($key, $value);
                     }
                     $this->tpl->parse("TotalsBlock", "Totals", true);
                 } else {
                     $this->tpl->set_var("TotalsBlock", "");
                 }
                 $this->tpl->set_var("page", $pageCtr);
                 $this->tpl->parse("PageBlock", "Page", true);
                 $this->tpl->set_var("RowBlock", "");
                 $this->tpl->set_var("TotalsBlock", "");
                 $ypos = 615;
                 $lineCtr = 0;
                 $pageCtr++;
             }
             $lineCtr++;
             $recordCtr++;
             $ypos = $ypos - $decrementYposBy;
         }
         $this->tpl->parse("templatePage", "rptsTemplate");
         $this->tpl->finish("templatePage");
         $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);
         }
     } else {
         exit("no delinquent collectible records to display");
     }
 }
예제 #18
0
 function Main()
 {
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         exit("afs not found");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             exit("error xmlDoc");
         } else {
             $afs = new AFS();
             $afs->parseDomDocument($domDoc);
             $this->formArray["arpNumber"] = $afs->arpNumber;
             $this->formArray["propertyIndexNumber"] = $afs->propertyIndexNumber;
             $this->formArray["taxability"] = $afs->taxability;
             $this->formArray["effectivity"] = $afs->effectivity;
             $this->displayODAFS($this->formArray["afsID"]);
             $this->displayTD($this->formArray["afsID"]);
             $this->displayPostingSummary($afs);
             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
             if (count($improvementsBuildingsList)) {
                 $this->displayImprovementsBuildingsList($improvementsBuildingsList);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $testpdf = new PDFWriter();
     $testpdf->setOutputXML($this->tpl->get("templatePage"), "test");
     if (isset($this->formArray["print"])) {
         $testpdf->writePDF("ImprovementsBuildingsFAAS.pdf");
         //,$this->formArray["print"]);
     } else {
         $testpdf->writePDF("ImprovementsBuildingsFAAS.pdf");
     }
     //		header("location: ".$testpdf->pdfPath);
     exit;
 }
예제 #19
0
파일: ViewSOA1.php 프로젝트: armic/erpts
 function Main()
 {
     $this->formArray['currentDate'] = date("F d, Y");
     $MunicipalityCityDetails = new SoapObject(NCCBIZ . "MunicipalityCityDetails.php", "urn:Object");
     #test values
     //$this->formArray['municipalityCityID']=1;
     if (!($xmlStr = $MunicipalityCityDetails->getMunicipalityCityDetails($this->formArray['municipalityCityID']))) {
         #echo($xmlStr);
         exit("xml failed for municipality");
         //header("Location: ".$this->sess->url("ViewSOA.php")."&status=2");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             echo "error xmlDoc";
         } else {
             $MunicipalityCity = new MunicipalityCity();
             $MunicipalityCity->parseDomDocument($domDoc);
             $this->formArray['municipality'] = $MunicipalityCity->getDescription();
         }
     }
     if ($this->formArray['personID'] != "") {
         $person = new Person();
         $person->selectRecord($this->formArray['personID']);
         $this->tpl->set_var(ownerName, $person->getFullName());
         $this->tpl->set_var(ownerNo, $person->getTin());
         $address = $person->addressArray[0];
         if (is_object($address)) {
             $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         } else {
             $this->tpl->set_var(ownerAddress, "");
         }
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['personID'];
         $db->query($sql);
     } else {
         $company = new Company();
         $company->selectRecord($this->formArray['companyID']);
         $this->tpl->set_var(ownerName, $company->getCompanyName());
         $this->tpl->set_var(ownerNo, $company->getCompanyID());
         $address = $company->addressArray[0];
         $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['companyID'];
         $db->query($sql);
     }
     $ypos = 325;
     $this->tpl->set_block("rptsTemplate", "ROW", "RowBlk");
     for ($i = 0; $db->next_record(); $i++) {
         $rptopID = $db->f("rptopID");
         $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
         if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) {
             //	exit("xml failed for RPTOP");
             header("Location: " . $this->sess->url("ViewSOA.php") . "&status=1");
         } else {
             //echo $xmlStr;
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                 $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
             } else {
                 $rptop = new RPTOP();
                 $td = new TD();
                 $rptop->parseDomDocument($domDoc);
                 foreach ($rptop as $key => $value) {
                     $this->formArray['payableYear'] = $rptop->getTaxableYear();
                     $rptopID = $rptop->getRptopID();
                     if ($key == "tdArray") {
                         $tdCtr = 0;
                         if (count($value)) {
                             foreach ($value as $tkey => $tvalue) {
                                 $td->selectRecord($tvalue->getTdID());
                                 $assessedValue = number_format($td->getAssessedValue(), 2, ".", "");
                                 $propertyType = $td->getPropertyType();
                                 $TaxDeclarationNumber = $td->getTaxDeclarationNumber();
                                 $afsID = $td->getAfsID();
                                 $afs = new AFS();
                                 $afs->selectRecord($afsID);
                                 $od = new OD();
                                 $od->selectRecord($afs->getOdID());
                                 $addr = $od->getLocationAddress();
                                 if (count($addr)) {
                                     $location = strtoupper($addr->getNumber() . " " . substr($addr->getBarangay(), 0, 4) . " " . substr($addr->getMunicipalityCity(), 0, 3) . " " . substr($addr->getProvince(), 0, 3));
                                     $munCityID = $addr->getMunicipalityCityID();
                                 }
                                 if (count($afs->landArray)) {
                                     foreach ($afs->landArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $landActualUses = new LandActualUses();
                                         $landActualUses->selectRecord($actualUse);
                                         $Code = $landActualUses->getCode();
                                     }
                                 }
                                 if (count($afs->improvementsBuildingsArray)) {
                                     foreach ($afs->improvementsBuildingsArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $improvementsBuildingsActualUses = new improvementsBuildingsActualUses();
                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                         $Code = $improvementsBuildingsActualUses->getCode();
                                     }
                                 }
                                 if ($munCityID == $this->formArray['municipalityCityID']) {
                                     $this->tpl->set_var(location, $location);
                                     $this->tpl->set_var("class", $Code);
                                     $this->tpl->set_var(kind, strtoupper(substr($propertyType, 0, 4)));
                                     $this->tpl->set_var(currentTDNo, $TaxDeclarationNumber);
                                     $this->tpl->set_var(municipality, $addr->getMunicipalityCity());
                                     //$dues = new Dues();
                                     //$dues->create($td->getTdID(),"2003");
                                     //$totTaxDue += $dues->getSEF()+$dues->getBasic();
                                     $dues = new Dues($tvalue->getTdID(), $rptop->getTaxableYear(), $assessedValue);
                                     $paymentPeriod = $dues->getPaymentMode();
                                     $totalTaxDue = $dues->getPaidBasic($paymentPeriod) + $dues->getPaidSEF($paymentPeriod) + $dues->getPaidIdle($paymentPeriod);
                                     if ($dues->getAmnesty()) {
                                         $dues->setPctPenalty(0.0);
                                     } else {
                                         $totalTaxDue += $dues->getPenalty($paymentPeriod);
                                     }
                                     if ($dues->getIsDiscount()) {
                                         $taxDue->setDiscount($totalTaxDue);
                                         $totalTaxDue -= $dues->getDiscount();
                                     }
                                     $interest = $dues->getPctPenalty();
                                     if ($interest > 0 && $paymentPeriod != "Annual") {
                                         $paymentPeriod = "Annual";
                                     }
                                     $basic = number_format($dues->getPaidBasic(), "2", ".", "");
                                     $this->tpl->set_var(basic, $basic);
                                     $totBasic += $basic;
                                     $sef = number_format($dues->getPaidSEF(), "2", ".", "");
                                     $this->tpl->set_var(sef, $sef);
                                     $totSEF += number_format($sef, "2", ".", "");
                                     $this->tpl->set_var(total, number_format($sef + $basic, "2", ".", ""));
                                     $this->tpl->set_var(marketValue, number_format($afs->getTotalMarketValue(), 2));
                                     $totMarketValue += $afs->getTotalMarketValue();
                                     $this->tpl->set_var(assessedValue, number_format($afs->getTotalAssessedValue(), 2));
                                     $totAssessedValue += $afs->getTotalAssessedValue();
                                     $pIndexNo = $afs->getPropertyIndexNumber();
                                     if ($pIndexNo == "") {
                                         $pIndexNo = "No value specified";
                                     }
                                     $ypos = $ypos - 10;
                                     $this->tpl->set_var(ypos, $ypos);
                                     $this->tpl->set_var(pin, $pIndexNo);
                                     $this->tpl->parse("RowBlk", "ROW", true);
                                 }
                             }
                             #end foreach($value)
                         }
                         #end if coun value
                         $this->tpl->set_var(totalMarketValue, number_format($totMarketValue, 2));
                         $this->tpl->set_var(totalAssessedValue, number_format($totAssessedValue, 2));
                         $this->tpl->set_var(totalBasic, number_format($totBasic, 2));
                         $this->tpl->set_var(totalSEF, number_format($totSEF, 2));
                         $this->tpl->set_var(totalTaxDue, number_format($totalTaxDue, 2));
                     }
                 }
             }
         }
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     /*		$this->tpl->parse("templatePage", "rptsTemplate");
     		$this->tpl->finish("templatePage");
     		$this->tpl->p("templatePage");
     */
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get('templatePage'), "string");
     $rptrpdf->writePDF("viewSOA.pdf");
 }
예제 #20
0
 function Main()
 {
     $this->setForm();
     $this->tpl->set_block("rptsTemplate", "ReceiptPage", "ReceiptPageBlock");
     $pageNumber = 1;
     $ReceiptDetails = new SoapObject(NCCBIZ . "ReceiptDetails.php", "urn:Object");
     $CollectionList = new SoapObject(NCCBIZ . "CollectionList.php", "urn:Object");
     $PaymentDetails = new SoapObject(NCCBIZ . "PaymentDetails.php", "urn:Object");
     foreach ($this->formArray["receiptIDArray"] as $receiptID) {
         $this->tpl->set_var("pageNumber", $pageNumber);
         $totalAmountPaid = 0;
         $eRPTSSettings = $this->getERPTSSettingsDetails();
         if ($eRPTSSettings->getLguType() == "City") {
             $this->setvar("city", $eRPTSSettings->getLguName());
             $this->setvar("province", "");
         } else {
             $this->setvar("city", "");
             $this->setvar("province", $eRPTSSettings->getLguName());
         }
         if (!($xmlStr = $ReceiptDetails->getReceipt($receiptID))) {
             //exit("xml failed.");
         } else {
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 //exit("error domDoc");
             } else {
                 $receipt = new Receipt();
                 $receipt->parseDomDocument($domDoc);
                 $this->setvar("prevORNum", $receipt->getPreviousReceiptNumber());
                 $porMonth = "";
                 $porDay = "";
                 $porYear = "";
                 if ($receipt->getPreviousReceiptDate() != "0000-00-00") {
                     $porMonth = date("F", strtotime($receipt->getPreviousReceiptDate()));
                     $porDay = date("d", strtotime($receipt->getPreviousReceiptDate()));
                     $porYear = date("Y", strtotime($receipt->getPreviousReceiptDate()));
                 }
                 $this->setvar("porMonth", $porMonth);
                 $this->setvar("porDay", $porDay);
                 $this->setvar("porYear", $porYear);
                 $this->setvar("orNum", $receipt->getReceiptNumber());
                 $orDate = "";
                 if ($receipt->getReceiptDate() != "0000-00-00") {
                     $orDate = date("F d, Y", strtotime($receipt->getReceiptDate()));
                 }
                 $this->setvar("orDate", $orDate);
                 $this->setvar("receivedFrom", $this->getReceivedFromName($receipt->getReceivedFrom()));
                 $this->setvar("paymentMode", $receipt->getPaymentMode());
                 if ($receipt->getPaymentMode() == "check") {
                     $this->setvar("checkNumber", "using Check Number : " . $receipt->getCheckNumber());
                     $this->setvar("dateOfCheck", " dated " . date("F d, Y", strtotime($receipt->getDateOfCheck())));
                     $this->setvar("draweeBank", "(" . $receipt->getDraweeBank() . ")");
                 }
                 $this->setvar("cityTreasurer", $this->getPersonName($receipt->getCityTreasurer()));
                 $this->setvar("deputyTreasurer", $this->getPersonName($receipt->getDeputyTreasurer()));
                 if (!($collectionXmlStr = $CollectionList->getCollectionListFromReceiptID($receiptID))) {
                     // xml failed
                 } else {
                     if (!($collectionDomDoc = domxml_open_mem($collectionXmlStr))) {
                         // error domDoc
                     } else {
                         $collectionRecords = new CollectionRecords();
                         $collectionRecords->parseDomDocument($collectionDomDoc);
                         $collectionArrayList = $collectionRecords->getArrayList();
                         $i = 0;
                         foreach ($collectionArrayList as $collection) {
                             $i++;
                             if ($i <= 1) {
                                 if ($collection->getTaxType() == "basic") {
                                     $this->setvar("receiptType", "[ X ]  BASIC TAX      [  ]  SPECIAL EDUCATION FUND");
                                 } else {
                                     if ($collection->getTaxType() == "sef") {
                                         $this->setvar("receiptType", "[  ]  BASIC TAX     [ X ]  SPECIAL EDUCATION FUND");
                                     } else {
                                         if ($collection->getTaxType() == "idle") {
                                             $this->setvar("receiptType", "[  ]  BASIC TAX     [  ]  SPECIAL EDUCATION FUND     [ X ]  IDLE TAX");
                                         }
                                     }
                                 }
                             }
                             $paymentID = $collection->getPaymentID();
                             if (!($paymentXmlStr = $PaymentDetails->getPayment($paymentID))) {
                                 // xml failed
                             } else {
                                 if (!($paymentDomDoc = domxml_open_mem($paymentXmlStr))) {
                                     // error domDoc
                                 } else {
                                     $payment = new Payment();
                                     $payment->parseDomDocument($paymentDomDoc);
                                     $assessedValue = 0;
                                     // added "orYear" for fix of Feb 08, 2005
                                     $this->formArray["orYear"] = substr($payment->dueDate, 0, 4);
                                     $this->setvar("orYear", $this->formArray["orYear"], false);
                                     if ($i <= 6) {
                                         $this->setvar("ownerName" . $i, $this->getReceivedFromName($receipt->getReceivedFrom()));
                                         if ($payment->getDueID() != "" && $payment->getDueID() != "0") {
                                             // due payment
                                             $due = $this->getDue($payment->getDueID());
                                             $td = $this->getTD($due->getTdID());
                                             $afs = $this->getAFS($td->getAfsID());
                                             $tdNum = $td->getTaxDeclarationNumber();
                                             if ($td->getPropertyType() == "Land") {
                                                 $this->setvar("assessedValueLand" . $i, $afs->getTotalAssessedValue(), true);
                                             } else {
                                                 $this->setvar("assessedValueOthers" . $i, $afs->getTotalAssessedValue(), true);
                                             }
                                             $assessedValue = $afs->getTotalAssessedValue();
                                             if ($payment->getDueType() == "Annual") {
                                                 // commented out: February 08, 2005
                                                 // "fullPmt" must be total paid less penalties... (tax due)
                                                 //$this->setvar("fullPmt".$i,$collection->getBalanceDue(),true);
                                                 $this->setvar("fullPmt" . $i, $collection->getTaxDue(), true);
                                             } else {
                                                 $this->setvar("num" . $i, $payment->getDueType());
                                                 // commented out: February 08, 2005
                                                 // $this->setvar("partialPmt".$i,$collection->getBalanceDue(),true);
                                                 $this->setvar("partialPmt" . $i, $collection->getTaxDue(), true);
                                             }
                                         } else {
                                             if ($payment->getBacktaxTDID() != "" && $payment->getBacktaxTDID() != "0") {
                                                 // backtaxtd payment
                                                 $backtaxTD = $this->getBacktaxTD($payment->getBacktaxTDID());
                                                 $parentTD = $this->getTD($backtaxTD->getTdID());
                                                 $afs = $this->getAFS($parentTD->getAfsID());
                                                 $tdNum = $backtaxTD->getTDNumber();
                                                 $assessedValue = $backtaxTD->getAssessedValue();
                                                 if ($payment->getDueType() == "Annual") {
                                                     // commented out: February 08, 2005
                                                     // $this->setvar("fullPmt".$i,$collection->getBalanceDue(),true);
                                                     $this->setvar("fullPmt" . $i, $collection->getTaxDue(), true);
                                                 } else {
                                                     $this->setvar("num" . $i, $payment->getDueType());
                                                     // commented out: February 08, 2005
                                                     // $this->setvar("partialPmt".$i,$collection->getBalanceDue(),true);
                                                     $this->setvar("partialPmt" . $i, $collection->getTaxDue(), true);
                                                 }
                                             }
                                         }
                                         $od = $this->getOD($afs->getOdID());
                                         $this->setvar("lotAddress" . $i, $od->locationAddress->getStreet() . ", " . $od->locationAddress->getBarangay());
                                         $this->setvar("blockNumber" . $i, $od->getLotNumber() . ", " . $od->getBlockNumber());
                                         $this->setvar("landClass" . $i, $payment->getPropertyClassification());
                                         $this->setvar("tdNum" . $i, $tdNum);
                                         $this->setvar("dueDate" . $i, "(" . substr($payment->getDueDate(), 0, 4) . ")");
                                         $this->setvar("assessedValue" . $i, $assessedValue, true);
                                         $this->setvar("subTotal" . $i, $collection->getTaxDue(), true);
                                         if ($collection->getPenalty() > 0) {
                                             if ($collection->getAmnesty() == "true") {
                                                 //	$this->setvar("penalty".$i,round((($collection->getPenalty()/$collection->getTaxDue())*100)) . " % (amnesty)",true);
                                                 $this->setvar("penalty" . $i, $collection->getPenalty());
                                             } else {
                                                 // $this->setvar("penalty".$i,round((($collection->getPenalty()/$collection->getTaxDue())*100)) . " %",true);
                                                 $this->setvar("penalty" . $i, $collection->getPenalty());
                                             }
                                         }
                                         $this->setvar("grandTotal" . $i, $collection->getAmountPaid(), true);
                                         $totalAmountPaid += $collection->getAmountPaid();
                                         //Inserted by cht 07282008
                                         $sefTotal = $total;
                                         $netAmountPaid = $totalAmountPaid * 2;
                                         //End
                                     }
                                 }
                             }
                         }
                     }
                     // ORIG
                     //$this->setvar("total",$totalAmountPaid,true);
                     //$this->setvar("amountPaid",$totalAmountPaid,true);
                     //$totalInWords = makewords($totalAmountPaid);
                     $this->setvar("sefTotal", $totalAmountPaid, true);
                     $this->setvar("total", $totalAmountPaid, true);
                     $this->setvar("amountPaid", $netAmountPaid, true);
                     $totalInWords = makewords($netAmountPaid);
                     //						$totalInWords = "One Hundred Thousand Two Hundred Thirty Four Pesos And Fifty Seven Centavos Only";
                     if (strlen($totalInWords) < 62) {
                         $this->setvar("y1TotalInWords", "254");
                     } else {
                         $this->setvar("y1TotalInWords", "263");
                     }
                     $this->setvar("totalInWords", $totalInWords);
                 }
             }
         }
         $this->tpl->parse("ReceiptPageBlock", "ReceiptPage", true);
         $pageNumber++;
         $this->clearLine();
     }
     //exit;
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     }
 }
예제 #21
0
 function Main()
 {
     $eRPTSSettings = new eRPTSSettings();
     if ($eRPTSSettings->selectRecord(1)) {
         $this->tpl->set_var("lguType", strtoupper($eRPTSSettings->getLguType()));
         $this->tpl->set_var("lguName", strtoupper($eRPTSSettings->getLguName()));
     }
     $dbPayment = new DB_RPTS();
     $dbTD = new DB_RPTS();
     $dbBacktaxTD = new DB_RPTS();
     $dbDue = new DB_RPTS();
     $dbPaymentTD = new DB_RPTS();
     $dbPaymentBacktaxTD = new DB_RPTS();
     $dbCollection = new DB_RPTS();
     // gather unique TD's and BacktaxTD's from Payments for year
     $sqlPayment = "SELECT paymentID, " . "tdID, " . "backtaxTDID " . "FROM Payment " . "WHERE status!='cancelled' " . "AND YEAR(paymentDate) LIKE '" . $this->formArray["year"] . "' " . "GROUP BY tdID, backtaxTDID " . "ORDER BY paymentID DESC ";
     $dbPayment->query($sqlPayment);
     if ($dbPayment->nf() > 0) {
         while ($dbPayment->next_record()) {
             $year = "";
             $pageRecord = array("propertyIndexNumber" => "", "tdNumber" => "", "paidBasic" => 0, "paidSef" => 0, "discount" => 0, "basicSef" => 0, "yearDel" => "", "basicDel" => 0, "sefDel" => 0, "penalty" => 0, "totalDel" => 0, "totalAmount" => 0);
             if ($dbPayment->f("backtaxTDID") != 0) {
                 // ------- start of BacktaxTD condition ------------------------- //
                 // gather BacktaxTD details
                 $sqlBacktaxTD = "SELECT tdNumber as tdNumber, " . "startYear as year " . "FROM BacktaxTD " . "WHERE " . "backtaxTDID = '" . $dbPayment->f("backtaxTDID") . "' ";
                 $dbBacktaxTD->query($sqlBacktaxTD);
                 if ($dbBacktaxTD->next_record()) {
                     $pageRecord["tdNumber"] = $dbBacktaxTD->f("tdNumber");
                     $year = $dbBacktaxTD->f("year");
                 }
                 // gather Payments for BacktaxTD for this year
                 $sqlPaymentBacktaxTD = "SELECT * " . "FROM Payment WHERE " . "backtaxTDID='" . $dbPayment->f("backtaxTDID") . "' " . "AND YEAR(paymentDate) LIKE '" . $this->formArray["year"] . "' " . "AND status!='cancelled' " . "ORDER BY paymentID DESC ";
                 $dbPaymentBacktaxTD->query($sqlPaymentBacktaxTD);
                 if ($dbPaymentBacktaxTD->nf() > 0) {
                     while ($dbPaymentBacktaxTD->next_record()) {
                         // gather Collections for Payment
                         $sqlCollection = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentBacktaxTD->f("paymentID") . "' " . "AND Collection.status!='cancelled' " . "ORDER BY collectionID DESC ";
                         $dbCollection->query($sqlCollection);
                         if ($dbCollection->nf() > 0) {
                             while ($dbCollection->next_record()) {
                                 switch ($dbCollection->f("taxType")) {
                                     case "basic":
                                         // paidBasic
                                         $paidBasic = 0;
                                         if ($dbCollection->f("amnesty") != "true") {
                                             $paidBasic = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                             // penalty, basicDel and totalDel
                                             if ($dbCollection->f("penalty") > 0) {
                                                 $pageRecord["yearDel"] = $year;
                                                 // basicDel
                                                 $basicDel = 0;
                                                 $basicDel = $dbCollection->f("taxDue");
                                                 // penalty
                                                 $penalty = 0;
                                                 $penalty = $dbCollection->f("penalty");
                                                 // totalDel
                                                 $totalDel = $basicDel + $penalty;
                                                 $pageRecord["basicDel"] += $basicDel;
                                                 $pageRecord["penalty"] += $penalty;
                                                 $pageRecord["totalDel"] += $totalDel;
                                                 // totalAmount
                                                 $pageRecord["totalAmount"] += $penalty;
                                             }
                                         }
                                         $paidBasic = $paidBasic + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                         // discount
                                         $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                         // basicSef
                                         $basicSef = $paidBasic - $discount;
                                         $pageRecord["paidBasic"] += $paidBasic;
                                         $pageRecord["discount"] += $discount;
                                         $pageRecord["basicSef"] += $basicSef;
                                         // totalAmount
                                         $pageRecord["totalAmount"] += $basicSef;
                                         break;
                                     case "sef":
                                         // paidSef
                                         $paidSef = 0;
                                         if ($dbCollection->f("amnesty") != "true") {
                                             $paidSef = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                             // penalty, sefDel and totalDel
                                             if ($dbCollection->f("penalty") > 0) {
                                                 $pageRecord["yearDel"] = $year;
                                                 // sefDel
                                                 $sefDel = 0;
                                                 $sefDel = $dbCollection->f("taxDue");
                                                 // penalty
                                                 $penalty = 0;
                                                 $penalty = $dbCollection->f("penalty");
                                                 // totalDel
                                                 $totalDel = $sefDel + $penalty;
                                                 $pageRecord["sefDel"] += $sefDel;
                                                 $pageRecord["penalty"] += $penalty;
                                                 $pageRecord["totalDel"] += $totalDel;
                                                 // totalAmount
                                                 $pageRecord["totalAmount"] += $penalty;
                                             }
                                         }
                                         $paidSef = $paidSef + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                         // discount
                                         $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                         // basicSef
                                         $basicSef = $paidSef - $discount;
                                         $pageRecord["paidSef"] += $paidSef;
                                         $pageRecord["discount"] += $discount;
                                         $pageRecord["basicSef"] += $basicSef;
                                         // totalAmount
                                         $pageRecord["totalAmount"] += $basicSef;
                                         break;
                                 }
                             }
                         }
                     }
                 }
                 // ------- start of BacktaxTD condition ------------------------- //
             } else {
                 if ($dbPayment->f("tdID") != 0) {
                     // ------- start of TD condition ------------------------- //
                     // gather TD details
                     $sqlTD = "SELECT AFS.propertyIndexNumber as propertyIndexNumber, " . "TD.taxDeclarationNumber as taxDeclarationNumber " . "FROM TD, AFS " . "WHERE " . "TD.afsID = AFS.afsID " . "AND TD.tdID='" . $dbPayment->f("tdID") . "' " . "AND TD.archive!='true' " . "AND AFS.archive!='true' ";
                     $dbTD->query($sqlTD);
                     if ($dbTD->next_record()) {
                         $pageRecord["propertyIndexNumber"] = $dbTD->f("propertyIndexNumber");
                         $pageRecord["tdNumber"] = $dbTD->f("taxDeclarationNumber");
                     }
                     // gather dueDate Year from Due
                     $sqlDue = "SELECT YEAR(dueDate) as year " . "FROM Due " . "WHERE tdID='" . $dbPayment->f("tdID") . "' " . "AND dueType='Annual' ";
                     $dbDue->query($sqlDue);
                     if ($dbDue->next_record()) {
                         $year = $dbDue->f("year");
                     }
                     // gather Payments for TD for this year
                     $sqlPaymentTD = "SELECT * " . "FROM Payment WHERE " . "tdID='" . $dbPayment->f("tdID") . "' " . "AND YEAR(paymentDate) LIKE '" . $this->formArray["year"] . "' " . "AND status!='cancelled' " . "ORDER BY paymentID DESC ";
                     $dbPaymentTD->query($sqlPaymentTD);
                     if ($dbPaymentTD->nf() > 0) {
                         while ($dbPaymentTD->next_record()) {
                             // gather Collections for Payment
                             $sqlCollection = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentTD->f("paymentID") . "' " . "AND Collection.status!='cancelled' " . "ORDER BY collectionID DESC ";
                             $dbCollection->query($sqlCollection);
                             if ($dbCollection->nf() > 0) {
                                 while ($dbCollection->next_record()) {
                                     switch ($dbCollection->f("taxType")) {
                                         case "basic":
                                             // paidBasic
                                             $paidBasic = 0;
                                             if ($dbCollection->f("amnesty") != "true") {
                                                 $paidBasic = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                                 // penalty, basicDel and totalDel
                                                 if ($dbCollection->f("penalty") > 0) {
                                                     $pageRecord["yearDel"] = $year;
                                                     // basicDel
                                                     $basicDel = 0;
                                                     $basicDel = $dbCollection->f("taxDue");
                                                     // penalty
                                                     $penalty = 0;
                                                     $penalty = $dbCollection->f("penalty");
                                                     // totalDel
                                                     $totalDel = $basicDel + $penalty;
                                                     $pageRecord["basicDel"] += $basicDel;
                                                     $pageRecord["penalty"] += $penalty;
                                                     $pageRecord["totalDel"] += $totalDel;
                                                     // totalAmount
                                                     $pageRecord["totalAmount"] += $penalty;
                                                 }
                                             }
                                             $paidBasic = $paidBasic + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                             // discount
                                             $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                             // basicSef
                                             $basicSef = $paidBasic - $discount;
                                             $pageRecord["paidBasic"] += $paidBasic;
                                             $pageRecord["discount"] += $discount;
                                             $pageRecord["basicSef"] += $basicSef;
                                             // totalAmount
                                             $pageRecord["totalAmount"] += $basicSef;
                                             break;
                                         case "sef":
                                             // paidSef
                                             $paidSef = 0;
                                             if ($dbCollection->f("amnesty") != "true") {
                                                 $paidSef = $dbCollection->f("amountPaid") - $dbCollection->f("penalty");
                                                 // penalty, sefDel and totalDel
                                                 if ($dbCollection->f("penalty") > 0) {
                                                     $pageRecord["yearDel"] = $year;
                                                     // sefDel
                                                     $sefDel = 0;
                                                     $sefDel = $dbCollection->f("taxDue");
                                                     // penalty
                                                     $penalty = 0;
                                                     $penalty = $dbCollection->f("penalty");
                                                     // totalDel
                                                     $totalDel = $sefDel + $penalty;
                                                     $pageRecord["sefDel"] += $sefDel;
                                                     $pageRecord["penalty"] += $penalty;
                                                     $pageRecord["totalDel"] += $totalDel;
                                                     // totalAmount
                                                     $pageRecord["totalAmount"] += $penalty;
                                                 }
                                             }
                                             $paidSef = $paidSef + ($dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount"));
                                             // discount
                                             $discount = $dbCollection->f("earlyPaymentDiscount") + $dbCollection->f("advancedPaymentDiscount");
                                             // basicSef
                                             $basicSef = $paidSef - $discount;
                                             $pageRecord["paidSef"] += $paidSef;
                                             $pageRecord["discount"] += $discount;
                                             $pageRecord["basicSef"] += $basicSef;
                                             // totalAmount
                                             $pageRecord["totalAmount"] += $basicSef;
                                             break;
                                     }
                                 }
                             }
                         }
                     }
                     // ------- end of TD condition ------------------------- //
                 }
             }
             $pageRecordArrayList[] = $pageRecord;
             unset($pageRecord);
         }
         if (is_array($pageRecordArrayList)) {
             $ypos = 426;
             $decrementYposBy = 12;
             $linesPerPage = 24;
             $count = count($pageRecordArrayList);
             $numOfPages = ceil($count / $linesPerPage);
             $pageCtr = 1;
             $lineCtr = 1;
             $recordCtr = 1;
             $this->tpl->set_var("year", $this->formArray["year"]);
             $this->tpl->set_var("numOfPages", $numOfPages);
             $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
             $this->tpl->set_block("Page", "Row", "RowBlock");
             $this->tpl->set_block("Page", "Totals", "TotalsBlock");
             $totalsArray = array("totalPaidBasic" => 0, "totalPaidSef" => 0, "totalDiscount" => 0, "totalBasicSef" => 0, "totalBasicDel" => 0, "totalSefDel" => 0, "totalPenalty" => 0, "totalTotalDel" => 0, "totalTotalAmount" => 0);
             foreach ($pageRecordArrayList as $recordArray) {
                 $this->tpl->set_var("ypos", $ypos);
                 $this->tpl->set_var("recordCtr", $recordCtr);
                 // write values
                 $totalsArray["totalPaidBasic"] += un_number_format($recordArray["paidBasic"]);
                 $totalsArray["totalPaidSef"] += un_number_format($recordArray["paidSef"]);
                 $totalsArray["totalDiscount"] += un_number_format($recordArray["discount"]);
                 $totalsArray["totalBasicSef"] += un_number_format($recordArray["basicSef"]);
                 $totalsArray["totalBasicDel"] += un_number_format($recordArray["basicDel"]);
                 $totalsArray["totalSefDel"] += un_number_format($recordArray["sefDel"]);
                 $totalsArray["totalPenalty"] += un_number_format($recordArray["penalty"]);
                 $totalsArray["totalTotalDel"] += un_number_format($recordArray["totalDel"]);
                 $totalsArray["totalTotalAmount"] += un_number_format($recordArray["totalAmount"]);
                 foreach ($recordArray as $key => $value) {
                     switch ($key) {
                         case "paidBasic":
                         case "paidSef":
                         case "discount":
                         case "basicSef":
                         case "basicDel":
                         case "sefDel":
                         case "penalty":
                         case "totalDel":
                         case "totalAmount":
                             $value = formatCurrency($value);
                             break;
                     }
                     $this->tpl->set_var($key, $value);
                 }
                 $this->tpl->parse("RowBlock", "Row", true);
                 if ($recordCtr == count($pageRecordArrayList) || $lineCtr == $linesPerPage) {
                     if ($pageCtr == $numOfPages) {
                         foreach ($totalsArray as $key => $value) {
                             $value = formatCurrency($value);
                             $this->tpl->set_var($key, $value);
                         }
                         $this->tpl->parse("TotalsBlock", "Totals", true);
                     } else {
                         $this->tpl->set_var("TotalsBlock", "");
                     }
                     $this->tpl->set_var("page", $pageCtr);
                     $this->tpl->parse("PageBlock", "Page", true);
                     $this->tpl->set_var("RowBlock", "");
                     $this->tpl->set_var("TotalsBlock", "");
                     $ypos = 426;
                     $lineCtr = 0;
                     $pageCtr++;
                 }
                 $lineCtr++;
                 $recordCtr++;
                 $ypos = $ypos - $decrementYposBy;
             }
             $this->tpl->parse("templatePage", "rptsTemplate");
             $this->tpl->finish("templatePage");
         } else {
             exit("no collections to list for " . $this->formArray["year"]);
         }
     } else {
         exit("no collections to list for " . $this->formArray["year"]);
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     }
 }
예제 #22
0
파일: PrintTDsumm.php 프로젝트: armic/erpts
 function Main()
 {
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         exit("afs not found");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             exit("error xmlDoc");
         } else {
             $afs = new AFS();
             $afs->parseDomDocument($domDoc);
             $this->displayODAFS($this->formArray["afsID"]);
             $this->formArray["propertyIndexNumber"] = $afs->propertyIndexNumber;
             //inserted this code for arpNumber - renonj
             $this->formArray["arpNumber"] = $afs->getArpNumber();
             $this->formArray["taxability"] = $afs->getTaxability();
             //Inserted by CHT 07292008
             if ($afs->getTaxability() == "Taxable") {
                 $this->formArray["isTaxable"] = "X";
                 $this->formArray["isExempt"] = "  ";
             } else {
                 if ($afs->getTaxability() == "Exempt") {
                     $this->formArray["isExempt"] = "X";
                     $this->formArray["isTaxable"] = "  ";
                 }
             }
             //End
             //land
             $landList = $afs->getLandArray();
             if (count($landList)) {
                 $this->displayLandList($landList);
             }
             //plantsTrees
             $plantsTreesList = $afs->getPlantsTreesArray();
             if (count($plantsTreesList)) {
                 $this->displayPlantsTreesList($plantsTreesList);
             }
             //improvementsBuildings
             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
             if (count($improvementsBuildingsList)) {
                 $this->displayImprovementsBuildingsList($improvementsBuildingsList);
             }
             //machineries
             $machineriesList = $afs->getMachineriesArray();
             if (count($machineriesList)) {
                 $this->displayMachineriesList($machineriesList);
             }
             $this->displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList);
             $this->displayLGUInfo();
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $testpdf = new PDFWriter();
     $testpdf->setOutputXML($this->tpl->get("templatePage"), "test");
     if (isset($this->formArray["print"])) {
         $testpdf->writePDF("TDSummary.pdf");
         //,$this->formArray["print"]);
     } else {
         $testpdf->writePDF("TDSummary.pdf");
     }
     //		header("location: ".$testpdf->pdfPath);
     exit;
 }
예제 #23
0
 function Main()
 {
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         exit("afs not found");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             exit("error xmlDoc");
         } else {
             $afs = new AFS();
             $afs->parseDomDocument($domDoc);
             $this->formArray["arpNumber"] = $afs->arpNumber;
             $this->formArray["propertyIndexNumber"] = $afs->propertyIndexNumber;
             $this->displayODAFS($this->formArray["afsID"]);
             $landList = $afs->getLandArray();
             if (count($landList)) {
                 $this->displayLandList($landList);
             }
             $plantsTreesList = $afs->getPlantsTreesArray();
             if (count($plantsTreesList)) {
                 $this->displayPlantsTreesList($plantsTreesList);
             }
         }
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     exit;
 }
예제 #24
0
 function Main()
 {
     global $DBid;
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->set_var("date", date("F d, Y"));
     $this->subRETaxableRealPropertyUnits = 0;
     $this->subRETaxableLandArea = 0;
     $this->subAGTaxableRealPropertyUnits = 0;
     $this->subAGTaxableLandArea = 0;
     $this->subCOTaxableRealPropertyUnits = 0;
     $this->subCOTaxableLandArea = 0;
     $this->subINTaxableRealPropertyUnits = 0;
     $this->subINTaxableLandArea = 0;
     $this->subMITaxableRealPropertyUnits = 0;
     $this->subMITaxableLandArea = 0;
     $this->subTITaxableRealPropertyUnits = 0;
     $this->subTITaxableLandArea = 0;
     $this->subSPTaxableRealPropertyUnits = 0;
     $this->subSPTaxableLandArea = 0;
     $this->subHOTaxableRealPropertyUnits = 0;
     $this->subHOTaxableLandArea = 0;
     $this->subSCTaxableRealPropertyUnits = 0;
     $this->subSCTaxableLandArea = 0;
     $this->subCUTaxableRealPropertyUnits = 0;
     $this->subCUTaxableLandArea = 0;
     $this->subOTTaxableRealPropertyUnits = 0;
     $this->subOTTaxableLandArea = 0;
     $this->subGOExemptRealPropertyUnits = 0;
     $this->subGOExemptLandArea = 0;
     $this->subRLExemptRealPropertyUnits = 0;
     $this->subRLExemptLandArea = 0;
     $this->subCHExemptRealPropertyUnits = 0;
     $this->subCHExemptLandArea = 0;
     $this->subEDExemptRealPropertyUnits = 0;
     $this->subEDExemptLandArea = 0;
     $this->subOTExemptRealPropertyUnits = 0;
     $this->subOTExemptLandArea = 0;
     $this->subRETaxableLandMarketValue = 0;
     $this->subRETaxableLandAssessedValue = 0;
     $this->subAGTaxableLandMarketValue = 0;
     $this->subAGTaxableLandAssessedValue = 0;
     $this->subCOTaxableLandMarketValue = 0;
     $this->subCOTaxableLandAssessedValue = 0;
     $this->subINTaxableLandMarketValue = 0;
     $this->subINTaxableLandAssessedValue = 0;
     $this->subMITaxableLandMarketValue = 0;
     $this->subMITaxableLandAssessedValue = 0;
     $this->subTITaxableLandMarketValue = 0;
     $this->subTITaxableLandAssessedValue = 0;
     $this->subSPTaxableLandMarketValue = 0;
     $this->subSPTaxableLandAssessedValue = 0;
     $this->subHOTaxableLandMarketValue = 0;
     $this->subHOTaxableLandAssessedValue = 0;
     $this->subSCTaxableLandMarketValue = 0;
     $this->subSCTaxableLandAssessedValue = 0;
     $this->subCUTaxableLandMarketValue = 0;
     $this->subCUTaxableLandAssessedValue = 0;
     $this->subOTTaxableLandMarketValue = 0;
     $this->subOTTaxableLandAssessedValue = 0;
     $this->subGOExemptLandMarketValue = 0;
     $this->subGOExemptLandAssessedValue = 0;
     $this->subRLExemptLandMarketValue = 0;
     $this->subRLExemptLandAssessedValue = 0;
     $this->subCHExemptLandMarketValue = 0;
     $this->subCHExemptLandAssessedValue = 0;
     $this->subEDExemptLandMarketValue = 0;
     $this->subEDExemptLandAssessedValue = 0;
     $this->subOTExemptLandMarketValue = 0;
     $this->subOTExemptLandAssessedValue = 0;
     $this->subRETaxableBldgLessMarketValue = 0;
     $this->subRETaxableBldgLessAssessedValue = 0;
     $this->subAGTaxableBldgLessMarketValue = 0;
     $this->subAGTaxableBldgLessAssessedValue = 0;
     $this->subCOTaxableBldgLessMarketValue = 0;
     $this->subCOTaxableBldgLessAssessedValue = 0;
     $this->subINTaxableBldgLessMarketValue = 0;
     $this->subINTaxableBldgLessAssessedValue = 0;
     $this->subMITaxableBldgLessMarketValue = 0;
     $this->subMITaxableBldgLessAssessedValue = 0;
     $this->subTITaxableBldgLessMarketValue = 0;
     $this->subTITaxableBldgLessAssessedValue = 0;
     $this->subSPTaxableBldgLessMarketValue = 0;
     $this->subSPTaxableBldgLessAssessedValue = 0;
     $this->subHOTaxableBldgLessMarketValue = 0;
     $this->subHOTaxableBldgLessAssessedValue = 0;
     $this->subSCTaxableBldgLessMarketValue = 0;
     $this->subSCTaxableBldgLessAssessedValue = 0;
     $this->subCUTaxableBldgLessMarketValue = 0;
     $this->subCUTaxableBldgLessAssessedValue = 0;
     $this->subOTTaxableBldgLessMarketValue = 0;
     $this->subOTTaxableBldgLessAssessedValue = 0;
     $this->subGOExemptBldgLessMarketValue = 0;
     $this->subGOExemptBldgLessAssessedValue = 0;
     $this->subRLExemptBldgLessMarketValue = 0;
     $this->subRLExemptBldgLessAssessedValue = 0;
     $this->subCHExemptBldgLessMarketValue = 0;
     $this->subCHExemptBldgLessAssessedValue = 0;
     $this->subEDExemptBldgLessMarketValue = 0;
     $this->subEDExemptBldgLessAssessedValue = 0;
     $this->subOTExemptBldgLessMarketValue = 0;
     $this->subOTExemptBldgLessAssessedValue = 0;
     $this->subRETaxableBldgOverMarketValue = 0;
     $this->subRETaxableBldgOverAssessedValue = 0;
     $this->subAGTaxableBldgOverMarketValue = 0;
     $this->subAGTaxableBldgOverAssessedValue = 0;
     $this->subCOTaxableBldgOverMarketValue = 0;
     $this->subCOTaxableBldgOverAssessedValue = 0;
     $this->subINTaxableBldgOverMarketValue = 0;
     $this->subINTaxableBldgOverAssessedValue = 0;
     $this->subMITaxableBldgOverMarketValue = 0;
     $this->subMITaxableBldgOverAssessedValue = 0;
     $this->subTITaxableBldgOverMarketValue = 0;
     $this->subTITaxableBldgOverAssessedValue = 0;
     $this->subSPTaxableBldgOverMarketValue = 0;
     $this->subSPTaxableBldgOverAssessedValue = 0;
     $this->subHOTaxableBldgOverMarketValue = 0;
     $this->subHOTaxableBldgOverAssessedValue = 0;
     $this->subSCTaxableBldgOverMarketValue = 0;
     $this->subSCTaxableBldgOverAssessedValue = 0;
     $this->subCUTaxableBldgOverMarketValue = 0;
     $this->subCUTaxableBldgOverAssessedValue = 0;
     $this->subOTTaxableBldgOverMarketValue = 0;
     $this->subOTTaxableBldgOverAssessedValue = 0;
     $this->subGOExemptBldgOverMarketValue = 0;
     $this->subGOExemptBldgOverAssessedValue = 0;
     $this->subRLExemptBldgOverMarketValue = 0;
     $this->subRLExemptBldgOverAssessedValue = 0;
     $this->subCHExemptBldgOverMarketValue = 0;
     $this->subCHExemptBldgOverAssessedValue = 0;
     $this->subEDExemptBldgOverMarketValue = 0;
     $this->subEDExemptBldgOverAssessedValue = 0;
     $this->subOTExemptBldgOverMarketValue = 0;
     $this->subOTExemptBldgOverAssessedValue = 0;
     $this->subRETaxableMachMarketValue = 0;
     $this->subRETaxableMachAssessedValue = 0;
     $this->subAGTaxableMachMarketValue = 0;
     $this->subAGTaxableMachAssessedValue = 0;
     $this->subCOTaxableMachMarketValue = 0;
     $this->subCOTaxableMachAssessedValue = 0;
     $this->subINTaxableMachMarketValue = 0;
     $this->subINTaxableMachAssessedValue = 0;
     $this->subMITaxableMachMarketValue = 0;
     $this->subMITaxableMachAssessedValue = 0;
     $this->subTITaxableMachMarketValue = 0;
     $this->subTITaxableMachAssessedValue = 0;
     $this->subSPTaxableMachMarketValue = 0;
     $this->subSPTaxableMachAssessedValue = 0;
     $this->subHOTaxableMachMarketValue = 0;
     $this->subHOTaxableMachAssessedValue = 0;
     $this->subSCTaxableMachMarketValue = 0;
     $this->subSCTaxableMachAssessedValue = 0;
     $this->subCUTaxableMachMarketValue = 0;
     $this->subCUTaxableMachAssessedValue = 0;
     $this->subOTTaxableMachMarketValue = 0;
     $this->subOTTaxableMachAssessedValue = 0;
     $this->subGOExemptMachMarketValue = 0;
     $this->subGOExemptMachAssessedValue = 0;
     $this->subRLExemptMachMarketValue = 0;
     $this->subRLExemptMachAssessedValue = 0;
     $this->subCHExemptMachMarketValue = 0;
     $this->subCHExemptMachAssessedValue = 0;
     $this->subEDExemptMachMarketValue = 0;
     $this->subEDExemptMachAssessedValue = 0;
     $this->subOTExemptMachMarketValue = 0;
     $this->subOTExemptMachAssessedValue = 0;
     $this->subRETaxableOtherMarketValue = 0;
     $this->subRETaxableOtherAssessedValue = 0;
     $this->subAGTaxableOtherMarketValue = 0;
     $this->subAGTaxableOtherAssessedValue = 0;
     $this->subCOTaxableOtherMarketValue = 0;
     $this->subCOTaxableOtherAssessedValue = 0;
     $this->subINTaxableOtherMarketValue = 0;
     $this->subINTaxableOtherAssessedValue = 0;
     $this->subMITaxableOtherMarketValue = 0;
     $this->subMITaxableOtherAssessedValue = 0;
     $this->subTITaxableOtherMarketValue = 0;
     $this->subTITaxableOtherAssessedValue = 0;
     $this->subSPTaxableOtherMarketValue = 0;
     $this->subSPTaxableOtherAssessedValue = 0;
     $this->subHOTaxableOtherMarketValue = 0;
     $this->subHOTaxableOtherAssessedValue = 0;
     $this->subSCTaxableOtherMarketValue = 0;
     $this->subSCTaxableOtherAssessedValue = 0;
     $this->subCUTaxableOtherMarketValue = 0;
     $this->subCUTaxableOtherAssessedValue = 0;
     $this->subOTTaxableOtherMarketValue = 0;
     $this->subOTTaxableOtherAssessedValue = 0;
     $this->subGOExemptOtherMarketValue = 0;
     $this->subGOExemptOtherAssessedValue = 0;
     $this->subRLExemptOtherMarketValue = 0;
     $this->subRLExemptOtherAssessedValue = 0;
     $this->subCHExemptOtherMarketValue = 0;
     $this->subCHExemptOtherAssessedValue = 0;
     $this->subEDExemptOtherMarketValue = 0;
     $this->subEDExemptOtherAssessedValue = 0;
     $this->subOTExemptOtherMarketValue = 0;
     $this->subOTExemptOtherAssessedValue = 0;
     $this->totalRETaxableMarketValue = 0;
     $this->totalRETaxableAssessedValue = 0;
     $this->totalAGTaxableMarketValue = 0;
     $this->totalAGTaxableAssessedValue = 0;
     $this->totalCOTaxableMarketValue = 0;
     $this->totalCOTaxableAssessedValue = 0;
     $this->totalINTaxableMarketValue = 0;
     $this->totalINTaxableAssessedValue = 0;
     $this->totalMITaxableMarketValue = 0;
     $this->totalMITaxableAssessedValue = 0;
     $this->totalTITaxableMarketValue = 0;
     $this->totalTITaxableAssessedValue = 0;
     $this->totalSPTaxableMarketValue = 0;
     $this->totalSPTaxableAssessedValue = 0;
     $this->totalHOTaxableMarketValue = 0;
     $this->totalHOTaxableAssessedValue = 0;
     $this->totalSCTaxableMarketValue = 0;
     $this->totalSCTaxableAssessedValue = 0;
     $this->totalCUTaxableMarketValue = 0;
     $this->totalCUTaxableAssessedValue = 0;
     $this->totalOTTaxableMarketValue = 0;
     $this->totalOTTaxableAssessedValue = 0;
     $this->totalGOExemptMarketValue = 0;
     $this->totalGOExemptAssessedValue = 0;
     $this->totalRLExemptMarketValue = 0;
     $this->totalRLExemptAssessedValue = 0;
     $this->totalCHExemptMarketValue = 0;
     $this->totalCHExemptAssessedValue = 0;
     $this->totalEDExemptMarketValue = 0;
     $this->totalEDExemptAssessedValue = 0;
     $this->totalOTExemptMarketValue = 0;
     $this->totalOTExemptAssessedValue = 0;
     $this->totalTaxableRealPropertyUnits = 0;
     $this->totalTaxableLandArea = 0;
     $this->totalTaxableLandMarketValue = 0;
     $this->totalTaxableLandAssessedValue = 0;
     $this->totalTaxableBldgLessMarketValue = 0;
     $this->totalTaxableBldgLessAssessedValue = 0;
     $this->totalTaxableBldgOverMarketValue = 0;
     $this->totalTaxableBldgOverAssessedValue = 0;
     $this->totalTaxableMachMarketValue = 0;
     $this->totalTaxableMachAssessedValue = 0;
     $this->totalTaxableOtherMarketValue = 0;
     $this->totalTaxableOtherAssessedValue = 0;
     $this->totalTaxableMarketValue = 0;
     $this->totalTaxableAssessedValue = 0;
     $this->totalExemptRealPropertyUnits = 0;
     $this->totalExemptLandArea = 0;
     $this->totalExemptLandMarketValue = 0;
     $this->totalExemptLandAssessedValue = 0;
     $this->totalExemptBldgLessMarketValue = 0;
     $this->totalExemptBldgLessAssessedValue = 0;
     $this->totalExemptBldgOverMarketValue = 0;
     $this->totalExemptBldgOverAssessedValue = 0;
     $this->totalExemptMachMarketValue = 0;
     $this->totalExemptMachAssessedValue = 0;
     $this->totalExemptOtherMarketValue = 0;
     $this->totalExemptOtherAssessedValue = 0;
     $this->totalExemptMarketValue = 0;
     $this->totalExemptAssessedValue = 0;
     $this->totalRealPropertyUnits = 0;
     $this->totalLandArea = 0;
     $this->totalLandMarketValue = 0;
     $this->totalLandAssessedValue = 0;
     $this->totalBldgLessMarketValue = 0;
     $this->totalBldgLessAssessedValue = 0;
     $this->totalBldgOverMarketValue = 0;
     $this->totalBldgOverAssessedValue = 0;
     $this->totalMachMarketValue = 0;
     $this->totalMachAssessedValue = 0;
     $this->totalOtherMarketValue = 0;
     $this->totalOtherAssessedValue = 0;
     $this->totalMarketValue = 0;
     $this->totalAssessedValue = 0;
     $ctr = 1;
     $this->dbs = "";
     foreach ($DBid as $key => $value) {
         $lgu = new LGU();
         $lgu->selectRecord($value);
         $this->dbName = $lgu->getLGUDB();
         if ($ctr == 1) {
             $this->dbs = $lgu->getLGUName();
         } else {
             $this->dbs .= " - " . $lgu->getLGUName();
         }
         $ctr++;
         $sql = "SELECT a.reportCode as reportCode, b.actualUse, count(b.propertyID) as rpu, sum( b.assessedValue ) as assessedValue, sum( b.adjustedMarketValue ) as adjustedMarketValue, sum(area) as area" . " FROM LandActualUses a" . " LEFT  JOIN Land b ON a.landActualUsesID = b.actualUse" . " GROUP  BY a.reportCode;";
         $this->computeProperty("Land", $sql);
         $sql = "SELECT a.reportCode as reportCode, b.actualUse, count(b.propertyID), sum( b.assessedValue ) as assessedValue, sum( b.adjustedMarketValue ) as adjustedMarketValue" . " FROM ImprovementsBuildingsActualUses a" . " LEFT  JOIN ImprovementsBuildings b ON a.improvementsBuildingsActualUsesID = b.actualUse AND b.adjustedMarketValue <= 175000" . " GROUP  BY a.reportCode;";
         $this->computeProperty("BldgLess", $sql);
         $sql = "SELECT a.reportCode as reportCode, b.actualUse, count(b.propertyID), sum( b.assessedValue ) as assessedValue, sum( b.adjustedMarketValue ) as adjustedMarketValue" . " FROM ImprovementsBuildingsActualUses a" . " LEFT  JOIN ImprovementsBuildings b ON a.improvementsBuildingsActualUsesID = b.actualUse AND b.adjustedMarketValue > 175000" . " GROUP  BY a.reportCode;";
         $this->computeProperty("BldgOver", $sql);
         $sql = "SELECT a.reportCode as reportCode, b.actualUse, count(b.propertyID), sum( b.assessedValue ) as assessedValue, sum( b.adjustedMarketValue ) as adjustedMarketValue" . " FROM MachineriesActualUses a" . " LEFT  JOIN Machineries b ON a.machineriesActualUsesID = b.actualUse" . " GROUP  BY a.reportCode;";
         $this->computeProperty("Mach", $sql);
         $this->countRealPropertyUnits();
     }
     $this->tpl->set_var("RETaxable_RealPropertyUnits", number_format($this->subRETaxableRealPropertyUnits));
     $this->tpl->set_var("RETaxable_LandArea", $this->checkNumericFormat($this->subRETaxableLandArea));
     $this->tpl->set_var("AGTaxable_RealPropertyUnits", number_format($this->subAGTaxableRealPropertyUnits));
     $this->tpl->set_var("AGTaxable_LandArea", $this->checkNumericFormat($this->subAGTaxableLandArea));
     $this->tpl->set_var("COTaxable_RealPropertyUnits", number_format($this->subCOTaxableRealPropertyUnits));
     $this->tpl->set_var("COTaxable_LandArea", $this->checkNumericFormat($this->subCOTaxableLandArea));
     $this->tpl->set_var("INTaxable_RealPropertyUnits", number_format($this->subINTaxableRealPropertyUnits));
     $this->tpl->set_var("INTaxable_LandArea", $this->checkNumericFormat($this->subINTaxableLandArea));
     $this->tpl->set_var("MITaxable_RealPropertyUnits", number_format($this->subMITaxableRealPropertyUnits));
     $this->tpl->set_var("MITaxable_LandArea", $this->checkNumericFormat($this->subMITaxableLandArea));
     $this->tpl->set_var("TITaxable_RealPropertyUnits", number_format($this->subTITaxableRealPropertyUnits));
     $this->tpl->set_var("TITaxable_LandArea", $this->checkNumericFormat($this->subTITaxableLandArea));
     $this->tpl->set_var("SPTaxable_RealPropertyUnits", number_format($this->subSPTaxableRealPropertyUnits));
     $this->tpl->set_var("SPTaxable_LandArea", $this->checkNumericFormat($this->subSPTaxableLandArea));
     $this->tpl->set_var("HOTaxable_RealPropertyUnits", number_format($this->subHOTaxableRealPropertyUnits));
     $this->tpl->set_var("HOTaxable_LandArea", $this->checkNumericFormat($this->subHOTaxableLandArea));
     $this->tpl->set_var("SCTaxable_RealPropertyUnits", number_format($this->subSCTaxableRealPropertyUnits));
     $this->tpl->set_var("SCTaxable_LandArea", $this->checkNumericFormat($this->subSCTaxableLandArea));
     $this->tpl->set_var("CUTaxable_RealPropertyUnits", number_format($this->subCUTaxableRealPropertyUnits));
     $this->tpl->set_var("CUTaxable_LandArea", $this->checkNumericFormat($this->subCUTaxableLandArea));
     $this->tpl->set_var("OTTaxable_RealPropertyUnits", number_format($this->subOTTaxableRealPropertyUnits));
     $this->tpl->set_var("OTTaxable_LandArea", $this->checkNumericFormat($this->subOTTaxableLandArea));
     $this->tpl->set_var("GOExempt_RealPropertyUnits", number_format($this->subGOExemptRealPropertyUnits));
     $this->tpl->set_var("GOExempt_LandArea", $this->checkNumericFormat($this->subGOExemptLandArea));
     $this->tpl->set_var("RLExempt_RealPropertyUnits", number_format($this->subRLExemptRealPropertyUnits));
     $this->tpl->set_var("RLExempt_LandArea", $this->checkNumericFormat($this->subRLExemptLandArea));
     $this->tpl->set_var("CHExempt_RealPropertyUnits", number_format($this->subCHExemptRealPropertyUnits));
     $this->tpl->set_var("CHExempt_LandArea", $this->checkNumericFormat($this->subCHExemptLandArea));
     $this->tpl->set_var("EDExempt_RealPropertyUnits", number_format($this->subEDExemptRealPropertyUnits));
     $this->tpl->set_var("EDExempt_LandArea", $this->checkNumericFormat($this->subEDExemptLandArea));
     $this->tpl->set_var("OTExempt_RealPropertyUnits", number_format($this->subOTExemptRealPropertyUnits));
     $this->tpl->set_var("OTExempt_LandArea", $this->checkNumericFormat($this->subOTExemptLandArea));
     $this->tpl->set_var("RETaxable_LandMV", $this->checkNumericFormat($this->subRETaxableLandMarketValue));
     $this->tpl->set_var("RETaxable_LandAV", $this->checkNumericFormat($this->subRETaxableLandAssessedValue));
     $this->tpl->set_var("AGTaxable_LandMV", $this->checkNumericFormat($this->subAGTaxableLandMarketValue));
     $this->tpl->set_var("AGTaxable_LandAV", $this->checkNumericFormat($this->subAGTaxableLandAssessedValue));
     $this->tpl->set_var("COTaxable_LandMV", $this->checkNumericFormat($this->subCOTaxableLandMarketValue));
     $this->tpl->set_var("COTaxable_LandAV", $this->checkNumericFormat($this->subCOTaxableLandAssessedValue));
     $this->tpl->set_var("INTaxable_LandMV", $this->checkNumericFormat($this->subINTaxableLandMarketValue));
     $this->tpl->set_var("INTaxable_LandAV", $this->checkNumericFormat($this->subINTaxableLandAssessedValue));
     $this->tpl->set_var("MITaxable_LandMV", $this->checkNumericFormat($this->subMITaxableLandMarketValue));
     $this->tpl->set_var("MITaxable_LandAV", $this->checkNumericFormat($this->subMITaxableLandAssessedValue));
     $this->tpl->set_var("TITaxable_LandMV", $this->checkNumericFormat($this->subTITaxableLandMarketValue));
     $this->tpl->set_var("TITaxable_LandAV", $this->checkNumericFormat($this->subTITaxableLandAssessedValue));
     $this->tpl->set_var("SPTaxable_LandMV", $this->checkNumericFormat($this->subSPTaxableLandMarketValue));
     $this->tpl->set_var("SPTaxable_LandAV", $this->checkNumericFormat($this->subSPTaxableLandAssessedValue));
     $this->tpl->set_var("HOTaxable_LandMV", $this->checkNumericFormat($this->subHOTaxableLandMarketValue));
     $this->tpl->set_var("HOTaxable_LandAV", $this->checkNumericFormat($this->subHOTaxableLandAssessedValue));
     $this->tpl->set_var("SCTaxable_LandMV", $this->checkNumericFormat($this->subSCTaxableLandMarketValue));
     $this->tpl->set_var("SCTaxable_LandAV", $this->checkNumericFormat($this->subSCTaxableLandAssessedValue));
     $this->tpl->set_var("CUTaxable_LandMV", $this->checkNumericFormat($this->subCUTaxableLandMarketValue));
     $this->tpl->set_var("CUTaxable_LandAV", $this->checkNumericFormat($this->subCUTaxableLandAssessedValue));
     $this->tpl->set_var("OTTaxable_LandMV", $this->checkNumericFormat($this->subOTTaxableLandMarketValue));
     $this->tpl->set_var("OTTaxable_LandAV", $this->checkNumericFormat($this->subOTTaxableLandAssessedValue));
     $this->tpl->set_var("GOExempt_LandMV", $this->checkNumericFormat($this->subGOExemptLandMarketValue));
     $this->tpl->set_var("GOExempt_LandAV", $this->checkNumericFormat($this->subGOExemptLandAssessedValue));
     $this->tpl->set_var("RLExempt_LandMV", $this->checkNumericFormat($this->subRLExemptLandMarketValue));
     $this->tpl->set_var("RLExempt_LandAV", $this->checkNumericFormat($this->subRLExemptLandAssessedValue));
     $this->tpl->set_var("CHExempt_LandMV", $this->checkNumericFormat($this->subCHExemptLandMarketValue));
     $this->tpl->set_var("CHExempt_LandAV", $this->checkNumericFormat($this->subCHExemptLandAssessedValue));
     $this->tpl->set_var("EDExempt_LandMV", $this->checkNumericFormat($this->subEDExemptLandMarketValue));
     $this->tpl->set_var("EDExempt_LandAV", $this->checkNumericFormat($this->subEDExemptLandAssessedValue));
     $this->tpl->set_var("OTExempt_LandMV", $this->checkNumericFormat($this->subOTExemptLandMarketValue));
     $this->tpl->set_var("OTExempt_LandAV", $this->checkNumericFormat($this->subOTExemptLandAssessedValue));
     $this->tpl->set_var("RETaxable_BldgLessMV", $this->checkNumericFormat($this->subRETaxableBldgLessMarketValue));
     $this->tpl->set_var("RETaxable_BldgLessAV", $this->checkNumericFormat($this->subRETaxableBldgLessAssessedValue));
     $this->tpl->set_var("AGTaxable_BldgLessMV", $this->checkNumericFormat($this->subAGTaxableBldgLessMarketValue));
     $this->tpl->set_var("AGTaxable_BldgLessAV", $this->checkNumericFormat($this->subAGTaxableBldgLessAssessedValue));
     $this->tpl->set_var("COTaxable_BldgLessMV", $this->checkNumericFormat($this->subCOTaxableBldgLessMarketValue));
     $this->tpl->set_var("COTaxable_BldgLessAV", $this->checkNumericFormat($this->subCOTaxableBldgLessAssessedValue));
     $this->tpl->set_var("INTaxable_BldgLessMV", $this->checkNumericFormat($this->subINTaxableBldgLessMarketValue));
     $this->tpl->set_var("INTaxable_BldgLessAV", $this->checkNumericFormat($this->subINTaxableBldgLessAssessedValue));
     $this->tpl->set_var("MITaxable_BldgLessMV", $this->checkNumericFormat($this->subMITaxableBldgLessMarketValue));
     $this->tpl->set_var("MITaxable_BldgLessAV", $this->checkNumericFormat($this->subMITaxableBldgLessAssessedValue));
     $this->tpl->set_var("TITaxable_BldgLessMV", $this->checkNumericFormat($this->subTITaxableBldgLessMarketValue));
     $this->tpl->set_var("TITaxable_BldgLessAV", $this->checkNumericFormat($this->subTITaxableBldgLessAssessedValue));
     $this->tpl->set_var("SPTaxable_BldgLessMV", $this->checkNumericFormat($this->subSPTaxableBldgLessMarketValue));
     $this->tpl->set_var("SPTaxable_BldgLessAV", $this->checkNumericFormat($this->subSPTaxableBldgLessAssessedValue));
     $this->tpl->set_var("HOTaxable_BldgLessMV", $this->checkNumericFormat($this->subHOTaxableBldgLessMarketValue));
     $this->tpl->set_var("HOTaxable_BldgLessAV", $this->checkNumericFormat($this->subHOTaxableBldgLessAssessedValue));
     $this->tpl->set_var("SCTaxable_BldgLessMV", $this->checkNumericFormat($this->subSCTaxableBldgLessMarketValue));
     $this->tpl->set_var("SCTaxable_BldgLessAV", $this->checkNumericFormat($this->subSCTaxableBldgLessAssessedValue));
     $this->tpl->set_var("CUTaxable_BldgLessMV", $this->checkNumericFormat($this->subCUTaxableBldgLessMarketValue));
     $this->tpl->set_var("CUTaxable_BldgLessAV", $this->checkNumericFormat($this->subCUTaxableBldgLessAssessedValue));
     $this->tpl->set_var("OTTaxable_BldgLessMV", $this->checkNumericFormat($this->subOTTaxableBldgLessMarketValue));
     $this->tpl->set_var("OTTaxable_BldgLessAV", $this->checkNumericFormat($this->subOTTaxableBldgLessAssessedValue));
     $this->tpl->set_var("GOExempt_BldgLessMV", $this->checkNumericFormat($this->subGOExemptBldgLessMarketValue));
     $this->tpl->set_var("GOExempt_BldgLessAV", $this->checkNumericFormat($this->subGOExemptBldgLessAssessedValue));
     $this->tpl->set_var("RLExempt_BldgLessMV", $this->checkNumericFormat($this->subRLExemptBldgLessMarketValue));
     $this->tpl->set_var("RLExempt_BldgLessAV", $this->checkNumericFormat($this->subRLExemptBldgLessAssessedValue));
     $this->tpl->set_var("CHExempt_BldgLessMV", $this->checkNumericFormat($this->subCHExemptBldgLessMarketValue));
     $this->tpl->set_var("CHExempt_BldgLessAV", $this->checkNumericFormat($this->subCHExemptBldgLessAssessedValue));
     $this->tpl->set_var("EDExempt_BldgLessMV", $this->checkNumericFormat($this->subEDExemptBldgLessMarketValue));
     $this->tpl->set_var("EDExempt_BldgLessAV", $this->checkNumericFormat($this->subEDExemptBldgLessAssessedValue));
     $this->tpl->set_var("OTExempt_BldgLessMV", $this->checkNumericFormat($this->subOTExemptBldgLessMarketValue));
     $this->tpl->set_var("OTExempt_BldgLessAV", $this->checkNumericFormat($this->subOTExemptBldgLessAssessedValue));
     $this->tpl->set_var("RETaxable_BldgOverMV", $this->checkNumericFormat($this->subRETaxableBldgOverMarketValue));
     $this->tpl->set_var("RETaxable_BldgOverAV", $this->checkNumericFormat($this->subRETaxableBldgOverAssessedValue));
     $this->tpl->set_var("AGTaxable_BldgOverMV", $this->checkNumericFormat($this->subAGTaxableBldgOverMarketValue));
     $this->tpl->set_var("AGTaxable_BldgOverAV", $this->checkNumericFormat($this->subAGTaxableBldgOverAssessedValue));
     $this->tpl->set_var("COTaxable_BldgOverMV", $this->checkNumericFormat($this->subCOTaxableBldgOverMarketValue));
     $this->tpl->set_var("COTaxable_BldgOverAV", $this->checkNumericFormat($this->subCOTaxableBldgOverAssessedValue));
     $this->tpl->set_var("INTaxable_BldgOverMV", $this->checkNumericFormat($this->subINTaxableBldgOverMarketValue));
     $this->tpl->set_var("INTaxable_BldgOverAV", $this->checkNumericFormat($this->subINTaxableBldgOverAssessedValue));
     $this->tpl->set_var("MITaxable_BldgOverMV", $this->checkNumericFormat($this->subMITaxableBldgOverMarketValue));
     $this->tpl->set_var("MITaxable_BldgOverAV", $this->checkNumericFormat($this->subMITaxableBldgOverAssessedValue));
     $this->tpl->set_var("TITaxable_BldgOverMV", $this->checkNumericFormat($this->subTITaxableBldgOverMarketValue));
     $this->tpl->set_var("TITaxable_BldgOverAV", $this->checkNumericFormat($this->subTITaxableBldgOverAssessedValue));
     $this->tpl->set_var("SPTaxable_BldgOverMV", $this->checkNumericFormat($this->subSPTaxableBldgOverMarketValue));
     $this->tpl->set_var("SPTaxable_BldgOverAV", $this->checkNumericFormat($this->subSPTaxableBldgOverAssessedValue));
     $this->tpl->set_var("HOTaxable_BldgOverMV", $this->checkNumericFormat($this->subHOTaxableBldgOverMarketValue));
     $this->tpl->set_var("HOTaxable_BldgOverAV", $this->checkNumericFormat($this->subHOTaxableBldgOverAssessedValue));
     $this->tpl->set_var("SCTaxable_BldgOverMV", $this->checkNumericFormat($this->subSCTaxableBldgOverMarketValue));
     $this->tpl->set_var("SCTaxable_BldgOverAV", $this->checkNumericFormat($this->subSCTaxableBldgOverAssessedValue));
     $this->tpl->set_var("CUTaxable_BldgOverMV", $this->checkNumericFormat($this->subCUTaxableBldgOverMarketValue));
     $this->tpl->set_var("CUTaxable_BldgOverAV", $this->checkNumericFormat($this->subCUTaxableBldgOverAssessedValue));
     $this->tpl->set_var("OTTaxable_BldgOverMV", $this->checkNumericFormat($this->subOTTaxableBldgOverMarketValue));
     $this->tpl->set_var("OTTaxable_BldgOverAV", $this->checkNumericFormat($this->subOTTaxableBldgOverAssessedValue));
     $this->tpl->set_var("GOExempt_BldgOverMV", $this->checkNumericFormat($this->subGOExemptBldgOverMarketValue));
     $this->tpl->set_var("GOExempt_BldgOverAV", $this->checkNumericFormat($this->subGOExemptBldgOverAssessedValue));
     $this->tpl->set_var("RLExempt_BldgOverMV", $this->checkNumericFormat($this->subRLExemptBldgOverMarketValue));
     $this->tpl->set_var("RLExempt_BldgOverAV", $this->checkNumericFormat($this->subRLExemptBldgOverAssessedValue));
     $this->tpl->set_var("CHExempt_BldgOverMV", $this->checkNumericFormat($this->subCHExemptBldgOverMarketValue));
     $this->tpl->set_var("CHExempt_BldgOverAV", $this->checkNumericFormat($this->subCHExemptBldgOverAssessedValue));
     $this->tpl->set_var("EDExempt_BldgOverMV", $this->checkNumericFormat($this->subEDExemptBldgOverMarketValue));
     $this->tpl->set_var("EDExempt_BldgOverAV", $this->checkNumericFormat($this->subEDExemptBldgOverAssessedValue));
     $this->tpl->set_var("OTExempt_BldgOverMV", $this->checkNumericFormat($this->subOTExemptBldgOverMarketValue));
     $this->tpl->set_var("OTExempt_BldgOverAV", $this->checkNumericFormat($this->subOTExemptBldgOverAssessedValue));
     $this->tpl->set_var("RETaxable_MachMV", $this->checkNumericFormat($this->subRETaxableMachMarketValue));
     $this->tpl->set_var("RETaxable_MachAV", $this->checkNumericFormat($this->subRETaxableMachAssessedValue));
     $this->tpl->set_var("AGTaxable_MachMV", $this->checkNumericFormat($this->subAGTaxableMachMarketValue));
     $this->tpl->set_var("AGTaxable_MachAV", $this->checkNumericFormat($this->subAGTaxableMachAssessedValue));
     $this->tpl->set_var("COTaxable_MachMV", $this->checkNumericFormat($this->subCOTaxableMachMarketValue));
     $this->tpl->set_var("COTaxable_MachAV", $this->checkNumericFormat($this->subCOTaxableMachAssessedValue));
     $this->tpl->set_var("INTaxable_MachMV", $this->checkNumericFormat($this->subINTaxableMachMarketValue));
     $this->tpl->set_var("INTaxable_MachAV", $this->checkNumericFormat($this->subINTaxableMachAssessedValue));
     $this->tpl->set_var("MITaxable_MachMV", $this->checkNumericFormat($this->subMITaxableMachMarketValue));
     $this->tpl->set_var("MITaxable_MachAV", $this->checkNumericFormat($this->subMITaxableMachAssessedValue));
     $this->tpl->set_var("TITaxable_MachMV", $this->checkNumericFormat($this->subTITaxableMachMarketValue));
     $this->tpl->set_var("TITaxable_MachAV", $this->checkNumericFormat($this->subTITaxableMachAssessedValue));
     $this->tpl->set_var("SPTaxable_MachMV", $this->checkNumericFormat($this->subSPTaxableMachMarketValue));
     $this->tpl->set_var("SPTaxable_MachAV", $this->checkNumericFormat($this->subSPTaxableMachAssessedValue));
     $this->tpl->set_var("HOTaxable_MachMV", $this->checkNumericFormat($this->subHOTaxableMachMarketValue));
     $this->tpl->set_var("HOTaxable_MachAV", $this->checkNumericFormat($this->subHOTaxableMachAssessedValue));
     $this->tpl->set_var("SCTaxable_MachMV", $this->checkNumericFormat($this->subSCTaxableMachMarketValue));
     $this->tpl->set_var("SCTaxable_MachAV", $this->checkNumericFormat($this->subSCTaxableMachAssessedValue));
     $this->tpl->set_var("CUTaxable_MachMV", $this->checkNumericFormat($this->subCUTaxableMachMarketValue));
     $this->tpl->set_var("CUTaxable_MachAV", $this->checkNumericFormat($this->subCUTaxableMachAssessedValue));
     $this->tpl->set_var("OTTaxable_MachMV", $this->checkNumericFormat($this->subOTTaxableMachMarketValue));
     $this->tpl->set_var("OTTaxable_MachAV", $this->checkNumericFormat($this->subOTTaxableMachAssessedValue));
     $this->tpl->set_var("GOExempt_MachMV", $this->checkNumericFormat($this->subGOExemptMachMarketValue));
     $this->tpl->set_var("GOExempt_MachAV", $this->checkNumericFormat($this->subGOExemptMachAssessedValue));
     $this->tpl->set_var("RLExempt_MachMV", $this->checkNumericFormat($this->subRLExemptMachMarketValue));
     $this->tpl->set_var("RLExempt_MachAV", $this->checkNumericFormat($this->subRLExemptMachAssessedValue));
     $this->tpl->set_var("CHExempt_MachMV", $this->checkNumericFormat($this->subCHExemptMachMarketValue));
     $this->tpl->set_var("CHExempt_MachAV", $this->checkNumericFormat($this->subCHExemptMachAssessedValue));
     $this->tpl->set_var("EDExempt_MachMV", $this->checkNumericFormat($this->subEDExemptMachMarketValue));
     $this->tpl->set_var("EDExempt_MachAV", $this->checkNumericFormat($this->subEDExemptMachAssessedValue));
     $this->tpl->set_var("OTExempt_MachMV", $this->checkNumericFormat($this->subOTExemptMachMarketValue));
     $this->tpl->set_var("OTExempt_MachAV", $this->checkNumericFormat($this->subOTExemptMachAssessedValue));
     $this->tpl->set_var("RETaxable_OtherMV", $this->checkNumericFormat($this->subRETaxableOtherMarketValue));
     $this->tpl->set_var("RETaxable_OtherAV", $this->checkNumericFormat($this->subRETaxableOtherAssessedValue));
     $this->tpl->set_var("AGTaxable_OtherMV", $this->checkNumericFormat($this->subAGTaxableOtherMarketValue));
     $this->tpl->set_var("AGTaxable_OtherAV", $this->checkNumericFormat($this->subAGTaxableOtherAssessedValue));
     $this->tpl->set_var("COTaxable_OtherMV", $this->checkNumericFormat($this->subCOTaxableOtherMarketValue));
     $this->tpl->set_var("COTaxable_OtherAV", $this->checkNumericFormat($this->subCOTaxableOtherAssessedValue));
     $this->tpl->set_var("INTaxable_OtherMV", $this->checkNumericFormat($this->subINTaxableOtherMarketValue));
     $this->tpl->set_var("INTaxable_OtherAV", $this->checkNumericFormat($this->subINTaxableOtherAssessedValue));
     $this->tpl->set_var("MITaxable_OtherMV", $this->checkNumericFormat($this->subMITaxableOtherMarketValue));
     $this->tpl->set_var("MITaxable_OtherAV", $this->checkNumericFormat($this->subMITaxableOtherAssessedValue));
     $this->tpl->set_var("TITaxable_OtherMV", $this->checkNumericFormat($this->subTITaxableOtherMarketValue));
     $this->tpl->set_var("TITaxable_OtherAV", $this->checkNumericFormat($this->subTITaxableOtherAssessedValue));
     $this->tpl->set_var("SPTaxable_OtherMV", $this->checkNumericFormat($this->subSPTaxableOtherMarketValue));
     $this->tpl->set_var("SPTaxable_OtherAV", $this->checkNumericFormat($this->subSPTaxableOtherAssessedValue));
     $this->tpl->set_var("HOTaxable_OtherMV", $this->checkNumericFormat($this->subHOTaxableOtherMarketValue));
     $this->tpl->set_var("HOTaxable_OtherAV", $this->checkNumericFormat($this->subHOTaxableOtherAssessedValue));
     $this->tpl->set_var("SCTaxable_OtherMV", $this->checkNumericFormat($this->subSCTaxableOtherMarketValue));
     $this->tpl->set_var("SCTaxable_OtherAV", $this->checkNumericFormat($this->subSCTaxableOtherAssessedValue));
     $this->tpl->set_var("CUTaxable_OtherMV", $this->checkNumericFormat($this->subCUTaxableOtherMarketValue));
     $this->tpl->set_var("CUTaxable_OtherAV", $this->checkNumericFormat($this->subCUTaxableOtherAssessedValue));
     $this->tpl->set_var("OTTaxable_OtherMV", $this->checkNumericFormat($this->subOTTaxableOtherMarketValue));
     $this->tpl->set_var("OTTaxable_OtherAV", $this->checkNumericFormat($this->subOTTaxableOtherAssessedValue));
     $this->tpl->set_var("GOExempt_OtherMV", $this->checkNumericFormat($this->subGOExemptOtherMarketValue));
     $this->tpl->set_var("GOExempt_OtherAV", $this->checkNumericFormat($this->subGOExemptOtherAssessedValue));
     $this->tpl->set_var("RLExempt_OtherMV", $this->checkNumericFormat($this->subRLExemptOtherMarketValue));
     $this->tpl->set_var("RLExempt_OtherAV", $this->checkNumericFormat($this->subRLExemptOtherAssessedValue));
     $this->tpl->set_var("CHExempt_OtherMV", $this->checkNumericFormat($this->subCHExemptOtherMarketValue));
     $this->tpl->set_var("CHExempt_OtherAV", $this->checkNumericFormat($this->subCHExemptOtherAssessedValue));
     $this->tpl->set_var("EDExempt_OtherMV", $this->checkNumericFormat($this->subEDExemptOtherMarketValue));
     $this->tpl->set_var("EDExempt_OtherAV", $this->checkNumericFormat($this->subEDExemptOtherAssessedValue));
     $this->tpl->set_var("OTExempt_OtherMV", $this->checkNumericFormat($this->subOTExemptOtherMarketValue));
     $this->tpl->set_var("OTExempt_OtherAV", $this->checkNumericFormat($this->subOTExemptOtherAssessedValue));
     $this->tpl->set_var("RETaxable_TotalMV", $this->checkNumericFormat($this->totalRETaxableMarketValue));
     $this->tpl->set_var("RETaxable_TotalAV", $this->checkNumericFormat($this->totalRETaxableAssessedValue));
     $this->tpl->set_var("AGTaxable_TotalMV", $this->checkNumericFormat($this->totalAGTaxableMarketValue));
     $this->tpl->set_var("AGTaxable_TotalAV", $this->checkNumericFormat($this->totalAGTaxableAssessedValue));
     $this->tpl->set_var("COTaxable_TotalMV", $this->checkNumericFormat($this->totalCOTaxableMarketValue));
     $this->tpl->set_var("COTaxable_TotalAV", $this->checkNumericFormat($this->totalCOTaxableAssessedValue));
     $this->tpl->set_var("INTaxable_TotalMV", $this->checkNumericFormat($this->totalINTaxableMarketValue));
     $this->tpl->set_var("INTaxable_TotalAV", $this->checkNumericFormat($this->totalINTaxableAssessedValue));
     $this->tpl->set_var("MITaxable_TotalMV", $this->checkNumericFormat($this->totalMITaxableMarketValue));
     $this->tpl->set_var("MITaxable_TotalAV", $this->checkNumericFormat($this->totalMITaxableAssessedValue));
     $this->tpl->set_var("TITaxable_TotalMV", $this->checkNumericFormat($this->totalTITaxableMarketValue));
     $this->tpl->set_var("TITaxable_TotalAV", $this->checkNumericFormat($this->totalTITaxableAssessedValue));
     $this->tpl->set_var("SPTaxable_TotalMV", $this->checkNumericFormat($this->totalSPTaxableMarketValue));
     $this->tpl->set_var("SPTaxable_TotalAV", $this->checkNumericFormat($this->totalSPTaxableAssessedValue));
     $this->tpl->set_var("HOTaxable_TotalMV", $this->checkNumericFormat($this->totalHOTaxableMarketValue));
     $this->tpl->set_var("HOTaxable_TotalAV", $this->checkNumericFormat($this->totalHOTaxableAssessedValue));
     $this->tpl->set_var("SCTaxable_TotalMV", $this->checkNumericFormat($this->totalSCTaxableMarketValue));
     $this->tpl->set_var("SCTaxable_TotalAV", $this->checkNumericFormat($this->totalSCTaxableAssessedValue));
     $this->tpl->set_var("CUTaxable_TotalMV", $this->checkNumericFormat($this->totalCUTaxableMarketValue));
     $this->tpl->set_var("CUTaxable_TotalAV", $this->checkNumericFormat($this->totalCUTaxableAssessedValue));
     $this->tpl->set_var("OTTaxable_TotalMV", $this->checkNumericFormat($this->totalOTTaxableMarketValue));
     $this->tpl->set_var("OTTaxable_TotalAV", $this->checkNumericFormat($this->totalOTTaxableAssessedValue));
     $this->tpl->set_var("GOExempt_TotalMV", $this->checkNumericFormat($this->totalGOExemptMarketValue));
     $this->tpl->set_var("GOExempt_TotalAV", $this->checkNumericFormat($this->totalGOExemptAssessedValue));
     $this->tpl->set_var("RLExempt_TotalMV", $this->checkNumericFormat($this->totalRLExemptMarketValue));
     $this->tpl->set_var("RLExempt_TotalAV", $this->checkNumericFormat($this->totalRLExemptAssessedValue));
     $this->tpl->set_var("CHExempt_TotalMV", $this->checkNumericFormat($this->totalCHExemptMarketValue));
     $this->tpl->set_var("CHExempt_TotalAV", $this->checkNumericFormat($this->totalCHExemptAssessedValue));
     $this->tpl->set_var("EDExempt_TotalMV", $this->checkNumericFormat($this->totalEDExemptMarketValue));
     $this->tpl->set_var("EDExempt_TotalAV", $this->checkNumericFormat($this->totalEDExemptAssessedValue));
     $this->tpl->set_var("OTExempt_TotalMV", $this->checkNumericFormat($this->totalOTExemptMarketValue));
     $this->tpl->set_var("OTExempt_TotalAV", $this->checkNumericFormat($this->totalOTExemptAssessedValue));
     $this->tpl->set_var("Taxable_RealPropertyUnits", number_format($this->totalTaxableRealPropertyUnits));
     $this->tpl->set_var("Taxable_LandArea", $this->checkNumericFormat($this->totalTaxableLandArea));
     $this->tpl->set_var("Taxable_LandMV", $this->checkNumericFormat($this->totalTaxableLandMarketValue));
     $this->tpl->set_var("Taxable_LandAV", $this->checkNumericFormat($this->totalTaxableLandAssessedValue));
     $this->tpl->set_var("Taxable_BldgLessMV", $this->checkNumericFormat($this->totalTaxableBldgLessMarketValue));
     $this->tpl->set_var("Taxable_BldgLessAV", $this->checkNumericFormat($this->totalTaxableBldgLessAssessedValue));
     $this->tpl->set_var("Taxable_BldgOverMV", $this->checkNumericFormat($this->totalTaxableBldgOverMarketValue));
     $this->tpl->set_var("Taxable_BldgOverAV", $this->checkNumericFormat($this->totalTaxableBldgOverAssessedValue));
     $this->tpl->set_var("Taxable_MachMV", $this->checkNumericFormat($this->totalTaxableMachMarketValue));
     $this->tpl->set_var("Taxable_MachAV", $this->checkNumericFormat($this->totalTaxableMachAssessedValue));
     $this->tpl->set_var("Taxable_OtherMV", $this->checkNumericFormat($this->totalTaxableOtherMarketValue));
     $this->tpl->set_var("Taxable_OtherAV", $this->checkNumericFormat($this->totalTaxableOtherAssessedValue));
     $this->tpl->set_var("Taxable_TotalMV", $this->checkNumericFormat($this->totalTaxableMarketValue));
     $this->tpl->set_var("Taxable_TotalAV", $this->checkNumericFormat($this->totalTaxableAssessedValue));
     $this->tpl->set_var("Exempt_RealPropertyUnits", $this->checkNumericFormat($this->totalExemptRealPropertyUnits));
     $this->tpl->set_var("Exempt_LandArea", $this->checkNumericFormat($this->totalExemptLandArea));
     $this->tpl->set_var("Exempt_LandMV", $this->checkNumericFormat($this->totalExemptLandMarketValue));
     $this->tpl->set_var("Exempt_LandAV", $this->checkNumericFormat($this->totalExemptLandAssessedValue));
     $this->tpl->set_var("Exempt_BldgLessMV", $this->checkNumericFormat($this->totalExemptBldgLessMarketValue));
     $this->tpl->set_var("Exempt_BldgLessAV", $this->checkNumericFormat($this->totalExemptBldgLessAssessedValue));
     $this->tpl->set_var("Exempt_BldgOverMV", $this->checkNumericFormat($this->totalExemptBldgOverMarketValue));
     $this->tpl->set_var("Exempt_BldgOverAV", $this->checkNumericFormat($this->totalExemptBldgOverAssessedValue));
     $this->tpl->set_var("Exempt_MachMV", $this->checkNumericFormat($this->totalExemptMachMarketValue));
     $this->tpl->set_var("Exempt_MachAV", $this->checkNumericFormat($this->totalExemptMachAssessedValue));
     $this->tpl->set_var("Exempt_OtherMV", $this->checkNumericFormat($this->totalExemptOtherMarketValue));
     $this->tpl->set_var("Exempt_OtherAV", $this->checkNumericFormat($this->totalExemptOtherAssessedValue));
     $this->tpl->set_var("Exempt_TotalMV", $this->checkNumericFormat($this->totalExemptMarketValue));
     $this->tpl->set_var("Exempt_TotalAV", $this->checkNumericFormat($this->totalExemptAssessedValue));
     $this->tpl->set_var("TOTAL_RealPropertyUnits", number_format($this->totalRealPropertyUnits));
     $this->tpl->set_var("TOTAL_LandArea", $this->checkNumericFormat($this->totalLandArea));
     $this->tpl->set_var("TOTAL_LandMV", $this->checkNumericFormat($this->totalLandMarketValue));
     $this->tpl->set_var("TOTAL_LandAV", $this->checkNumericFormat($this->totalLandAssessedValue));
     $this->tpl->set_var("TOTAL_BldgLessMV", $this->checkNumericFormat($this->totalBldgLessMarketValue));
     $this->tpl->set_var("TOTAL_BldgLessAV", $this->checkNumericFormat($this->totalBldgLessAssessedValue));
     $this->tpl->set_var("TOTAL_BldgOverMV", $this->checkNumericFormat($this->totalBldgOverMarketValue));
     $this->tpl->set_var("TOTAL_BldgOverAV", $this->checkNumericFormat($this->totalBldgOverAssessedValue));
     $this->tpl->set_var("TOTAL_MachMV", $this->checkNumericFormat($this->totalMachMarketValue));
     $this->tpl->set_var("TOTAL_MachAV", $this->checkNumericFormat($this->totalMachAssessedValue));
     $this->tpl->set_var("TOTAL_OtherMV", $this->checkNumericFormat($this->totalOtherMarketValue));
     $this->tpl->set_var("TOTAL_OtherAV", $this->checkNumericFormat($this->totalOtherAssessedValue));
     $this->tpl->set_var("TOTAL_TotalMV", $this->checkNumericFormat($this->totalMarketValue));
     $this->tpl->set_var("TOTAL_TotalAV", $this->checkNumericFormat($this->totalAssessedValue));
     $treasurySettings = new TreasurySettings();
     $treasurySettings->selectRecord();
     $this->basicTaxRate = $treasurySettings->getPctRPTax() * 100;
     $this->sefTaxRate = $treasurySettings->getPctSEF() * 100;
     $this->rateOfLevy = $this->basicTaxRate + $this->sefTaxRate;
     $this->taxableBasicCollectibles = 0;
     $this->taxableSEFCollectibles = 0;
     $this->totalBasicCollectibles = 0;
     $this->totalSEFCollectibles = 0;
     $this->reTaxableBasicCollectibles = $this->totalRETaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->reTaxableSEFCollectibles = $this->totalRETaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->reTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->reTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->reTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->reTaxableSEFCollectibles;
     $this->tpl->set_var("RETaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("RETaxable_BasicCollectibles", $this->checkNumericFormat($this->reTaxableBasicCollectibles));
     $this->tpl->set_var("RETaxable_SEFCollectibles", $this->checkNumericFormat($this->reTaxableSEFCollectibles));
     $this->agTaxableBasicCollectibles = $this->totalAGTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->agTaxableSEFCollectibles = $this->totalAGTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->agTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->agTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->agTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->agTaxableSEFCollectibles;
     $this->tpl->set_var("AGTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("AGTaxable_BasicCollectibles", $this->checkNumericFormat($this->agTaxableBasicCollectibles));
     $this->tpl->set_var("AGTaxable_SEFCollectibles", $this->checkNumericFormat($this->agTaxableSEFCollectibles));
     $this->coTaxableBasicCollectibles = $this->totalCOTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->coTaxableSEFCollectibles = $this->totalCOTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->coTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->coTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->coTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->coTaxableSEFCollectibles;
     $this->tpl->set_var("COTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("COTaxable_BasicCollectibles", $this->checkNumericFormat($this->coTaxableBasicCollectibles));
     $this->tpl->set_var("COTaxable_SEFCollectibles", $this->checkNumericFormat($this->coTaxableSEFCollectibles));
     $this->inTaxableBasicCollectibles = $this->totalINTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->inTaxableSEFCollectibles = $this->totalINTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->inTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->inTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->inTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->inTaxableSEFCollectibles;
     $this->tpl->set_var("INTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("INTaxable_BasicCollectibles", $this->checkNumericFormat($this->inTaxableBasicCollectibles));
     $this->tpl->set_var("INTaxable_SEFCollectibles", $this->checkNumericFormat($this->inTaxableSEFCollectibles));
     $this->miTaxableBasicCollectibles = $this->totalMITaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->miTaxableSEFCollectibles = $this->totalMITaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->miTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->miTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->miTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->miTaxableSEFCollectibles;
     $this->tpl->set_var("MITaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("MITaxable_BasicCollectibles", $this->checkNumericFormat($this->miTaxableBasicCollectibles));
     $this->tpl->set_var("MITaxable_SEFCollectibles", $this->checkNumericFormat($this->miTaxableSEFCollectibles));
     $this->tiTaxableBasicCollectibles = $this->totalTITaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->tiTaxableSEFCollectibles = $this->totalTITaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->tiTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->tiTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->tiTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->tiTaxableSEFCollectibles;
     $this->tpl->set_var("TITaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("TITaxable_BasicCollectibles", $this->checkNumericFormat($this->tiTaxableBasicCollectibles));
     $this->tpl->set_var("TITaxable_SEFCollectibles", $this->checkNumericFormat($this->tiTaxableSEFCollectibles));
     $this->spTaxableBasicCollectibles = $this->totalSPTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->spTaxableSEFCollectibles = $this->totalSPTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->spTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->spTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->spTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->spTaxableSEFCollectibles;
     $this->tpl->set_var("SPTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("SPTaxable_BasicCollectibles", $this->checkNumericFormat($this->spTaxableBasicCollectibles));
     $this->tpl->set_var("SPTaxable_SEFCollectibles", $this->checkNumericFormat($this->spTaxableSEFCollectibles));
     $this->hoTaxableBasicCollectibles = $this->totalHOTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->hoTaxableSEFCollectibles = $this->totalHOTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->hoTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->hoTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->hoTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->hoTaxableSEFCollectibles;
     $this->tpl->set_var("HOTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("HOTaxable_BasicCollectibles", $this->checkNumericFormat($this->hoTaxableBasicCollectibles));
     $this->tpl->set_var("HOTaxable_SEFCollectibles", $this->checkNumericFormat($this->hoTaxableSEFCollectibles));
     $this->scTaxableBasicCollectibles = $this->totalSCTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->scTaxableSEFCollectibles = $this->totalSCTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->scTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->scTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->scTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->scTaxableSEFCollectibles;
     $this->tpl->set_var("SCTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("SCTaxable_BasicCollectibles", $this->checkNumericFormat($this->scTaxableBasicCollectibles));
     $this->tpl->set_var("SCTaxable_SEFCollectibles", $this->checkNumericFormat($this->scTaxableSEFCollectibles));
     $this->cuTaxableBasicCollectibles = $this->totalCUTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->cuTaxableSEFCollectibles = $this->totalCUTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->cuTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->cuTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->cuTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->cuTaxableSEFCollectibles;
     $this->tpl->set_var("CUTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("CUTaxable_BasicCollectibles", $this->checkNumericFormat($this->cuTaxableBasicCollectibles));
     $this->tpl->set_var("CUTaxable_SEFCollectibles", $this->checkNumericFormat($this->cuTaxableSEFCollectibles));
     $this->otTaxableBasicCollectibles = $this->totalOTTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->otTaxableSEFCollectibles = $this->totalOTTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->otTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->otTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->otTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->otTaxableSEFCollectibles;
     $this->tpl->set_var("OTTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("OTTaxable_BasicCollectibles", $this->checkNumericFormat($this->otTaxableBasicCollectibles));
     $this->tpl->set_var("OTTaxable_SEFCollectibles", $this->checkNumericFormat($this->otTaxableSEFCollectibles));
     $this->taTaxableBasicCollectibles = $this->totalTaTaxableAssessedValue * ($this->basicTaxRate / 100);
     $this->taTaxableSEFCollectibles = $this->totalTaTaxableAssessedValue * ($this->sefTaxRate / 100);
     $this->taxableBasicCollectibles += $this->taTaxableBasicCollectibles;
     $this->taxableSEFCollectibles += $this->taTaxableSEFCollectibles;
     $this->totalBasicCollectibles += $this->taTaxableBasicCollectibles;
     $this->totalSEFCollectibles += $this->taTaxableSEFCollectibles;
     $this->tpl->set_var("TaTaxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("TaTaxable_BasicCollectibles", $this->checkNumericFormat($this->taTaxableBasicCollectibles));
     $this->tpl->set_var("TaTaxable_SEFCollectibles", $this->checkNumericFormat($this->taTaxableSEFCollectibles));
     $this->tpl->set_var("Taxable_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("Taxable_BasicCollectibles", $this->checkNumericFormat($this->taxableBasicCollectibles));
     $this->tpl->set_var("Taxable_SEFCollectibles", $this->checkNumericFormat($this->taxableSEFCollectibles));
     $this->tpl->set_var("TOTAL_RateOfLevy", $this->rateOfLevy . "%");
     $this->tpl->set_var("TOTAL_BasicCollectibles", $this->checkNumericFormat($this->totalBasicCollectibles));
     $this->tpl->set_var("TOTAL_SEFCollectibles", $this->checkNumericFormat($this->totalSEFCollectibles));
     $this->setPageDetailPerms();
     $this->tpl->set_var("dbs", $this->dbs);
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     if ($this->reportType == "HTML") {
         $this->tpl->p("templatePage");
     } else {
         $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);
         }
     }
 }
 function Main()
 {
     $this->displayPageHeading();
     if ($this->paymentRecords = $this->getFilteredPaymentRecords()) {
         // (modifed Dec. 08 but released on February 16, 2005)
         // ff two lines commented out: December 08, 2004 in favor of getFilteredPaymentRecords for faster processing.
         //		if($this->paymentRecords = $this->filterPaymentsByCurrentQuarter()){
         //			if($this->paymentRecords = $this->filterPaymentsByLocationAndAssignPropertyClassification()){
         if (is_array($this->paymentRecords->getArrayList())) {
             $list = $this->paymentRecords->getArrayList();
             foreach ($list as $payment) {
                 switch ($payment->getPropertyClassification()) {
                     case "RE":
                         $suffixKey = 1;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "AG":
                         $suffixKey = 2;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "CO":
                         $suffixKey = 3;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "IN":
                         $suffixKey = 4;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "MI":
                         $suffixKey = 5;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "TI":
                         $suffixKey = 6;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "SP":
                         $suffixKey = 7;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "HO":
                         $suffixKey = 8;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "SC":
                         $suffixKey = 9;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "CU":
                         $suffixKey = 10;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                     case "CH":
                     case "ED":
                     case "GO":
                     case "OTX":
                     case "OTE":
                     case "RL":
                     default:
                         $suffixKey = 11;
                         $this->incrementValues($suffixKey, $payment);
                         break;
                 }
             }
         }
         //			}
     }
     $this->computeTotals();
     $this->formatCurrencyFigures();
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("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);
     }
 }
예제 #26
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;
 }
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "remove":
             //echo "removeOwnerRPTOP(".$this->formArray["rptopID"].",".$this->formArray["ownerID"].",".$this->formArray["personID"].",".$this->formArray["companyID"].")";
             $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
             if (count($this->formArray["personID"]) || count($this->formArray["companyID"])) {
                 if (!($deletedRows = $OwnerList->removeOwnerRPTOP($this->formArray["rptopID"], $this->formArray["ownerID"], $this->formArray["personID"], $this->formArray["companyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                     //echo "SOAP failed";
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: RPTOPDetails.php" . $this->sess->url("") . $this->sess->add_query(array("rptopID" => $this->formArray["rptopID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     //select
     $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))) {
             $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
             $this->tpl->set_var("OwnerListTableBlock", "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) {
                                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                 $this->tpl->set_var("OwnerListTableBlock", "");
                             } else {
                                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                                 } else {
                                     $this->displayOwnerList($domDoc);
                                 }
                             }
                         } else {
                             $this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock");
                             $this->tpl->set_var("PersonListBlock", "");
                             $this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
                             $this->tpl->set_var("CompanyListBlock", "");
                         }
                         break;
                     case "cityAssessor":
                         if (is_numeric($value)) {
                             $cityAssessor = new Person();
                             $cityAssessor->selectRecord($value);
                             $this->tpl->set_var("cityAssessorID", $cityAssessor->getPersonID());
                             $this->tpl->set_var("cityAssessorName", $cityAssessor->getFullName());
                             $this->formArray["cityAssessorName"] = $cityAssessor->getFullName();
                         } else {
                             $cityAssessor = $value;
                             $this->tpl->set_var("cityAssessorID", $cityAssessor);
                             $this->tpl->set_var("cityAssessorName", $cityAssessor);
                             $this->formArray["cityAssessorName"] = $cityAssessor;
                         }
                         break;
                     case "cityTreasurer":
                         if (is_numeric($value)) {
                             $cityTreasurer = new Person();
                             $cityTreasurer->selectRecord($value);
                             $this->tpl->set_var("cityTreasurerID", $cityTreasurer->getPersonID());
                             $this->tpl->set_var("cityTreasurerName", $cityTreasurer->getFullName());
                             $this->formArray["cityTreasurerName"] = $cityTreasurer->getFullName();
                         } else {
                             $cityTreasurer = $value;
                             $this->tpl->set_var("cityTreasurerID", $cityTreasurer);
                             $this->tpl->set_var("cityTreasurerName", $cityTreasurer);
                             $this->formArray["cityTreasurerName"] = $cityTreasurer;
                         }
                         break;
                     case "tdArray":
                         //$this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock");
                         //$this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock");
                         //$this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
                         //$this->tpl->set_block("TDList", "BacktaxesList", "BacktaxesListBlock");
                         $tdCtr = 0;
                         if (count($value)) {
                             $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock");
                             $this->tpl->set_var("TDDBEmptyBlock", "");
                             /*
                             $this->tpl->set_block("TDList", "Land", "LandBlock");
                             $this->tpl->set_block("TDList", "PlantsTrees", "PlantsTreesBlock");
                             $this->tpl->set_block("TDList", "ImprovementsBuildings", "ImprovementsBuildingsBlock");
                             $this->tpl->set_block("TDList", "Machineries", "MachineriesBlock");
                             */
                             foreach ($value as $tkey => $tvalue) {
                                 //foreach($tvalue as $column => $val){
                                 //	$this->tpl->set_var($column,$val);
                                 //}
                                 /*
                                 $this->tpl->set_var("tdID",$tvalue->getTDID());
                                 $this->tpl->set_var("taxDeclarationNumber",$tvalue->getTaxDeclarationNumber());
                                 $this->tpl->set_var("afsID",$tvalue->getAfsID());
                                 $this->tpl->set_var("cancelsTDNumber",$tvalue->getCancelsTDNumber());
                                 $this->tpl->set_var("canceledByTDNumber",$tvalue->getCanceledByTDNumber());
                                 $this->tpl->set_var("taxBeginsWithTheYear",$tvalue->getTaxBeginsWithTheYear());
                                 $this->tpl->set_var("ceasesWithTheYear",$tvalue->getCeasesWithTheYear());
                                 $this->tpl->set_var("enteredInRPARForBy",$tvalue->getEnteredInRPARForBy());
                                 $this->tpl->set_var("enteredInRPARForYear",$tvalue->getEnteredInRPARForYear());
                                 $this->tpl->set_var("previousOwner",$tvalue->getPreviousOwner());
                                 $this->tpl->set_var("previousAssessedValue",$tvalue->getPreviousAssessedValue());
                                 
                                 list($dateArr["year"],$dateArr["month"],$dateArr["day"]) = explode("-",$tvalue->getProvincialAssessorDate());
                                 $this->tpl->set_var("pa_yearValue",removePreZero($dateArr["year"]));
                                 $this->tpl->set_var("pa_month",removePreZero($dateArr["month"]));
                                 $this->tpl->set_var("pa_dayValue",removePreZero($dateArr["day"]));
                                 list($dateArr["year"],$dateArr["month"],$dateArr["day"]) = explode("-",$tvalue->getCityMunicipalAssessorDate());
                                 $this->tpl->set_var("cm_yearValue",removePreZero($dateArr["year"]));
                                 $this->tpl->set_var("cm_month",removePreZero($dateArr["month"]));
                                 $this->tpl->set_var("cm_dayValue",removePreZero($dateArr["day"]));
                                 
                                 $this->tpl->set_var("provincialAssessorName",$tvalue->provincialAssessor);
                                 $this->tpl->set_var("cityMunicipalAssessorName",$tvalue->cityMunicipalAssessor);
                                 //$this->tpl->set_var("assessedValue",$tvalue->getAssessedValue());
                                 
                                 $this->tpl->set_var("propertyType",$tvalue->getPropertyType());
                                 
                                 $this->tpl->set_var("basicTax","");
                                 $this->tpl->set_var("sefTax", "");
                                 $this->tpl->set_var("total", "");
                                 
                                 //$this->tpl->set_var("basicTax",$tvalue->getBasicTax());
                                 //$this->tpl->set_var("sefTax",$tvalue->getSefTax());
                                 //$this->tpl->set_var("total",$tvalue->getTotal());
                                 */
                                 $this->tdRecord["arpNumber"] = $tvalue->getTaxDeclarationNumber();
                                 $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
                                 if (!($xmlStr = $AFSDetails->getAFS($tvalue->getAfsID()))) {
                                     //$this->tpl->set_block("rptsTemplate", "AFSTable", "AFSTableBlock");
                                     //$this->tpl->set_var("AFSTableBlock", "afs not found");
                                 } else {
                                     //echo $xmlStr;
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         //$this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                                         //$this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                                     } else {
                                         $afs = new AFS();
                                         $afs->parseDomDocument($domDoc);
                                         $odID = $afs->getOdID();
                                         $od = new OD();
                                         $od->selectRecord($odID);
                                         if (is_object($od->locationAddress)) {
                                             $locationAddress = $od->getLocationAddress();
                                             $this->tdRecord["location"] = $locationAddress->getBarangay() . ", " . $locationAddress->getMunicipalityCity();
                                         }
                                         switch ($tvalue->getPropertyType()) {
                                             case "ImprovementsBuildings":
                                                 if (is_array($afs->getImprovementsBuildingsArray())) {
                                                     $improvementsBuildings = $afs->improvementsBuildingsArray[0];
                                                     $actualUse = $improvementsBuildings->getActualUse();
                                                     if (is_numeric($actualUse)) {
                                                         $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                                         $actualUse = $improvementsBuildingsActualUses->getCode();
                                                         //$actualUse = $improvementsBuildingsActualUses->getDescription();
                                                     }
                                                     $this->tdRecord["class"] = $actualUse;
                                                 }
                                                 break;
                                             case "Machineries":
                                                 if (is_array($afs->getMachineriesArray())) {
                                                     $machineries = $afs->machineriesArray[0];
                                                     $actualUse = $machineries->getActualUse();
                                                     if (is_numeric($actualUse)) {
                                                         $machineriesActualUses = new MachineriesActualUses();
                                                         $machineriesActualUses->selectRecord($actualUse);
                                                         $actualUse = $machineriesActualUses->getCode();
                                                         //$actualUse = $machineriesActualUses->getDescription();
                                                     }
                                                     $this->tdRecord["class"] = $actualUse;
                                                 }
                                                 break;
                                             case "Land":
                                             default:
                                                 if (is_array($afs->getLandArray())) {
                                                     $land = $afs->landArray[0];
                                                     $actualUse = $land->getActualUse();
                                                     if (is_numeric($actualUse)) {
                                                         $landActualUses = new LandActualUses();
                                                         $landActualUses->selectRecord($actualUse);
                                                         $actualUse = $landActualUses->getCode();
                                                         //$actualUse = $landActualUses->getDescription();
                                                     }
                                                     $this->tdRecord["class"] = $actualUse;
                                                 } else {
                                                     if (is_array($afs->getPlantsTreesArray())) {
                                                         if (is_numeric($actualUse)) {
                                                             $plantsTreesActualUses = new PlantsTreesActualUses();
                                                             $plantsTreesActualUses->selectRecord($actualUse);
                                                             $actualUse = $plantsTreesActualUses->getCode();
                                                             //$actualUse = $plantsTreesActualUses->getDescription();
                                                         }
                                                         $this->tdRecord["class"] = $actualUse;
                                                     }
                                                 }
                                         }
                                         $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["totalMarketValue"] += $afs->getTotalMarketValue();
                                         $this->formArray["totalAssessedValue"] += $afs->getTotalAssessedValue();
                                         $this->tpl->set_var("marketValue", number_format($afs->getTotalMarketValue(), 2, '.', ','));
                                         $this->tpl->set_var("assessedValue", number_format($afs->getTotalAssessedValue(), 2, '.', ','));
                                         $this->tpl->set_var("taxability", $afs->getTaxability());
                                         $this->tpl->set_var("effectivity", $afs->getEffectivity());
                                         $this->formArray["idle"] = "No";
                                         if ($tvalue->getPropertyType() == "Land") {
                                             if (is_array($afs->landArray)) {
                                                 // if land is stripped
                                                 if (count($afs->landArray) > 1) {
                                                     foreach ($afs->landArray as $land) {
                                                         if ($land->getIdle() == "Yes") {
                                                             $this->formArray["idle"] = "Yes";
                                                             break;
                                                         }
                                                     }
                                                 } else {
                                                     $this->formArray["idle"] = $afs->landArray[0]->getIdle();
                                                 }
                                             }
                                         }
                                         if ($this->formArray["idle"] == "") {
                                             $this->formArray["idle"] = "No";
                                         }
                                         $this->tpl->set_var("idle", $this->formArray["idle"]);
                                     }
                                 }
                                 // grab DueRecords from tdID
                                 $DueList = new SoapObject(NCCBIZ . "DueList.php", "urn:Object");
                                 $dueArrayList = array("Annual" => "", "Q1" => "", "Q2" => "", "Q3" => "", "Q4" => "");
                                 if (!($xmlStr = $DueList->getDueList($tvalue->getTdID(), $rptop->getTaxableYear()))) {
                                     if ($this->formArray["rptopID"] != "") {
                                         $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>.";
                                     } else {
                                         $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list.";
                                     }
                                     exit($redirectMessage);
                                 } else {
                                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                                         if ($this->formArray["rptopID"] != "") {
                                             $redirectMessage = "Dues are uncalculated. <a href='CalculateRPTOPDetails.php" . $this->sess->url("") . "&rptopID=" . $this->formArray["rptopID"] . "'>Click here</a> to go to calculation page or <a href='SOA.php" . $this->sess->url("") . "'>return to list</a>.";
                                         } else {
                                             $redirectMessage = "Dues are uncalculated. <a href='SOA.php" . $this->sess->url("") . "'>Click here</a> to return to list.";
                                         }
                                         exit($redirectMessage);
                                     } else {
                                         $dueRecords = new DueRecords();
                                         $dueRecords->parseDomDocument($domDoc);
                                         foreach ($dueRecords->getArrayList() as $due) {
                                             foreach ($due as $dueKey => $dueValue) {
                                                 switch ($dueKey) {
                                                     case "dueType":
                                                         if ($dueValue == "Annual") {
                                                             $this->formArray["totalTaxDue"] += $due->getTaxDue();
                                                         }
                                                         $dueArrayList[$dueValue] = $due;
                                                         $this->tpl->set_var("basicTax[" . $dueValue . "]", formatCurrency($due->getBasicTax()));
                                                         $this->tpl->set_var("sefTax[" . $dueValue . "]", formatCurrency($due->getSEFTax()));
                                                         $this->tpl->set_var("idleTax[" . $dueValue . "]", formatCurrency($due->getIdleTax()));
                                                         $this->tpl->set_var("taxDue[" . $dueValue . "]", formatCurrency($due->getTaxDue()));
                                                         $this->tpl->set_var("dueDate[" . $dueValue . "]", date("M. d, Y", strtotime($due->getDueDate())));
                                                         $dueDateYear = date("Y", strtotime($due->getDueDate()));
                                                         $this->tdRecord["year"] = $dueDateYear;
                                                         break;
                                                 }
                                             }
                                         }
                                         $treasurySettings = new TreasurySettings();
                                         $treasurySettings->selectRecord();
                                         // initialize discountPeriod and discountPercentage for earlyPaymentDiscount
                                         $this->tpl->set_var("discountPercentage", $treasurySettings->getDiscountPercentage() . "%");
                                         $this->tpl->set_var("discountPeriod", "January 01, " . $dueDateYear . " - " . date("F d, Y", strtotime($dueDateYear . "-" . $treasurySettings->getDiscountPeriod())));
                                         $this->formArray["discountPercentage"] = $treasurySettings->getDiscountPercentage();
                                         $this->formArray["discountPeriod"] = $treasurySettings->getDiscountPeriod();
                                         $this->formArray["discountPeriod_End"] = strtotime($dueDateYear . "-" . $this->formArray["discountPeriod"]);
                                         $this->formArray["discountPeriod_Start"] = strtotime($dueDateYear . "-01-01");
                                         // initialize advancedDiscountPercentage for advancedPayment
                                         $this->tpl->set_var("advancedDiscountPercentage", $treasurySettings->getAdvancedDiscountPercentage() . "%");
                                         $this->formArray["advancedDiscountPercentage"] = $treasurySettings->getAdvancedDiscountPercentage();
                                         $this->tpl->set_var("q1AdvancedDiscountPercentage", $treasurySettings->getQ1AdvancedDiscountPercentage() . "%");
                                         $this->formArray["q1AdvancedDiscountPercentage"] = $treasurySettings->getQ1AdvancedDiscountPercentage();
                                         // initialize penaltyLUTArray
                                         $penaltyLUTArray = $treasurySettings->getPenaltyLUT();
                                         $this->penaltyLUTArray = $treasurySettings->getPenaltyLUT();
                                         foreach ($dueArrayList as $dKey => $due) {
                                             $dueArrayList[$dKey]->setEarlyPaymentDiscountPeriod($this->formArray["discountPeriod"]);
                                             $dueArrayList[$dKey]->setEarlyPaymentDiscountPercentage($this->formArray["discountPercentage"]);
                                             // compute earlyPaymentDiscount as of today
                                             // check if today is within the discountPeriod and compute Discount
                                             // AND if today is BEFORE annual dueDate
                                             $dueArrayList[$dKey]->setEarlyPaymentDiscount(0.0);
                                             if ($due->getDueType() == "Annual") {
                                                 if (strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]) {
                                                     if (strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())) {
                                                         $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100));
                                                     }
                                                 }
                                             } else {
                                                 // if today is BEFORE dueDate
                                                 if (strtotime($this->now) <= strtotime($due->getDueDate()) && strtotime($this->now) >= $this->formArray["discountPeriod_Start"]) {
                                                     $dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100));
                                                 }
                                                 // commented out Febuary 08, 2005 : Provide Quarterly Discounts
                                                 // earlyPaymentDiscount aren't given to Quarterly Dues except for Quarter 1
                                                 /*
                                                 if($due->getDueType()=="Q1"){
                                                 	if(strtotime($this->now) >= $this->formArray["discountPeriod_Start"] && strtotime($this->now) <= $this->formArray["discountPeriod_End"]){
                                                 		if(strtotime($this->now) <= strtotime($dueArrayList[$dKey]->getDueDate())){
                                                 			$dueArrayList[$dKey]->setEarlyPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"]/100));
                                                 		}
                                                 	}
                                                 }
                                                 */
                                             }
                                             // compute advancedPaymentDiscount as of today
                                             // check if today is BEFORE January 1 of the year of the annual dueDate
                                             $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0.0);
                                             if (strtotime($this->now) < strtotime(date("Y", strtotime($dueArrayList[$dKey]->getDueDate())) . "-01-01")) {
                                                 // for advanced payments, give 20% discount to annual dues [advanced discount]
                                                 // give 10% discount to quarterly dues [early discount]
                                                 if ($due->getDueType() == "Annual") {
                                                     $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["advancedDiscountPercentage"] / 100));
                                                 } else {
                                                     if ($due->getDueType() == "Q1") {
                                                         $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["q1AdvancedDiscountPercentage"] / 100));
                                                     } else {
                                                         $dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["discountPercentage"] / 100));
                                                     }
                                                     // commented out: February 08, 2005
                                                     // advancedPaymentDiscount aren't given to Quarterly Dues except for Quarter 1
                                                     /*
                                                     if($due->getDueType()=="Q1"){
                                                     	$dueArrayList[$dKey]->setAdvancedPaymentDiscount($dueArrayList[$dKey]->getTaxDue() * ($this->formArray["q1AdvancedDiscountPercentage"]/100));
                                                     }
                                                     */
                                                 }
                                             }
                                             $latestPaymentDate[$dKey] = $this->getLatestPaymentDateForDue($dueArrayList[$dKey]);
                                             $amountPaidForDue = $this->getAmountPaidForDue($dueArrayList);
                                             $latestPaymentDueType = $this->getLatestPaymentDueType($dueArrayList);
                                             $amnestyStatus[$dKey] = $this->getAmnestyStatusForDue($dueArrayList[$dKey]);
                                             $totalEarlyPaymentDiscount = $this->getTotalEarlyPaymentDiscountForDue($dueArrayList);
                                             $totalAdvancedPaymentDiscount = $this->getTotalAdvancedPaymentDiscountForDue($dueArrayList);
                                             if ($totalEarlyPaymentDiscount > 0) {
                                                 $earlyPaymentDiscountForDueType = $this->getTotalEarlyPaymentDiscountForDueType($dueArrayList[$dKey]);
                                                 if ($earlyPaymentDiscountForDueType > 0) {
                                                     $dueArrayList[$dKey]->setEarlyPaymentDiscount($earlyPaymentDiscountForDueType);
                                                 }
                                             }
                                             if ($totalAdvancedPaymentDiscount > 0) {
                                                 $advancedPaymentDiscountForDueType = $this->getTotalAdvancedPaymentDiscountForDueType($dueArrayList[$dKey]);
                                                 if ($advancedPaymentDiscountForDueType > 0) {
                                                     $dueArrayList[$dKey]->setAdvancedPaymentDiscount($advancedPaymentDiscountForDueType);
                                                 }
                                             }
                                             // calculate Penalties verses either today or verses the last paymentDate
                                             if ($latestPaymentDate[$dKey] != "" || $latestPaymentDate[$dKey] != "now") {
                                                 $dueArrayList[$dKey] = $this->computePenalty($latestPaymentDate[$dKey], $dueArrayList[$dKey]);
                                                 // if balance is 0 leave penalty as is, otherwise calculatePenalty according to date now
                                                 $balance = round($dueArrayList[$dKey]->getInitialNetDue() - $amountPaidForDue, 4);
                                                 // 0.1 is used instead of 0 because a lot of balances may end up as 0.002 or so...
                                                 if ($balance > 0.1) {
                                                     $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]);
                                                 }
                                             } else {
                                                 $dueArrayList[$dKey] = $this->computePenalty($this->now, $dueArrayList[$dKey]);
                                             }
                                             //print_r($dueArrayList[$dKey]);
                                             //echo "<hr>";
                                             $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount()));
                                             $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount()));
                                             $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue());
                                             $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100);
                                             $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty()));
                                             $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue();
                                             if ($amnestyStatus[$dKey]) {
                                                 $this->initialNetDue[$dKey] -= $dueArrayList[$dKey]->getPenalty();
                                                 $this->tpl->set_var("amnesty[" . $dKey . "]", "Yes");
                                             } else {
                                                 $this->tpl->set_var("amnesty[" . $dKey . "]", "No");
                                             }
                                             $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($this->initialNetDue[$dKey]));
                                         }
                                         // out of the loop,
                                         // verify balances to make disable penalties and discounts for Annual if ALL QUARTERS have been paid
                                         // and to disable penalties and discounts for Quarters if ALL of ANNUAL has been paid
                                         // example: Q1, Q2, Q3 and Q4 have been fully paid. Annual should not show any payables.
                                         //          Likewise if Annual has been fully paid, Q1, Q2, Q3 and Q4 should not show any payables.
                                         $totalQuarterlyNetDue = 0;
                                         $totalQuarterlyNetDue += $dueArrayList["Q1"]->getBasicTax() + $dueArrayList["Q1"]->getSefTax() + $dueArrayList["Q1"]->getIdleTax();
                                         $totalQuarterlyNetDue -= $dueArrayList["Q1"]->getEarlyPaymentDiscount() + $dueArrayList["Q1"]->getAdvancedPaymentDiscount();
                                         if (!$amnestyStatus["Q1"]) {
                                             $totalQuarterlyNetDue += $dueArrayList["Q1"]->getPenalty();
                                         }
                                         $totalQuarterlyNetDue += $dueArrayList["Q2"]->getBasicTax() + $dueArrayList["Q2"]->getSefTax() + $dueArrayList["Q2"]->getIdleTax();
                                         $totalQuarterlyNetDue -= $dueArrayList["Q2"]->getEarlyPaymentDiscount() + $dueArrayList["Q2"]->getAdvancedPaymentDiscount();
                                         if (!$amnestyStatus["Q2"]) {
                                             $totalQuarterlyNetDue += $dueArrayList["Q2"]->getPenalty();
                                         }
                                         $totalQuarterlyNetDue += $dueArrayList["Q3"]->getBasicTax() + $dueArrayList["Q3"]->getSefTax() + $dueArrayList["Q3"]->getIdleTax();
                                         $totalQuarterlyNetDue -= $dueArrayList["Q3"]->getEarlyPaymentDiscount() + $dueArrayList["Q3"]->getAdvancedPaymentDiscount();
                                         if (!$amnestyStatus["Q3"]) {
                                             $totalQuarterlyNetDue += $dueArrayList["Q3"]->getPenalty();
                                         }
                                         $totalQuarterlyNetDue += $dueArrayList["Q4"]->getBasicTax() + $dueArrayList["Q4"]->getSefTax() + $dueArrayList["Q4"]->getIdleTax();
                                         $totalQuarterlyNetDue -= $dueArrayList["Q4"]->getEarlyPaymentDiscount() + $dueArrayList["Q4"]->getAdvancedPaymentDiscount();
                                         if (!$amnestyStatus["Q4"]) {
                                             $totalQuarterlyNetDue += $dueArrayList["Q4"]->getPenalty();
                                         }
                                         $totalAnnualNetDue = 0;
                                         $totalAnnualNetDue += $dueArrayList["Annual"]->getBasicTax() + $dueArrayList["Annual"]->getSefTax() + $dueArrayList["Annual"]->getIdleTax();
                                         $totalAnnualNetDue -= $dueArrayList["Annual"]->getEarlyPaymentDiscount() + $dueArrayList["Annual"]->getAdvancedPaymentDiscount();
                                         if (!$amnestyStatus["Annual"]) {
                                             $totalAnnualNetDue += $dueArrayList["Annual"]->getPenalty();
                                         }
                                         if ($latestPaymentDueType != "Annual" && $totalQuarterlyNetDue - $amountPaidForDue <= 0) {
                                             // all QUARTERLY DUES have been paid, modify Annual Due values
                                             $dueArrayList["Annual"]->setAdvancedPaymentDiscount(0);
                                             $dueArrayList["Annual"]->setEarlyPaymentDiscount(0);
                                             $dueArrayList["Annual"]->setMonthsOverDue(0);
                                             $dueArrayList["Annual"]->setPenaltyPercentage(0);
                                             $dueArrayList["Annual"]->setPenalty(0);
                                             $this->initialNetDue["Annual"] = $dueArrayList["Annual"]->getInitialNetDue();
                                             $this->tpl->set_var("advancedPaymentDiscount[Annual]", formatCurrency($dueArrayList["Annual"]->getAdvancedPaymentDiscount()));
                                             $this->tpl->set_var("earlyPaymentDiscount[Annual]", formatCurrency($dueArrayList["Annual"]->getEarlyPaymentDiscount()));
                                             $this->tpl->set_var("monthsOverDue[Annual]", $dueArrayList["Annual"]->getMonthsOverDue());
                                             $this->tpl->set_var("penaltyPercentage[Annual]", $dueArrayList["Annual"]->getPenaltyPercentage() * 100);
                                             $this->tpl->set_var("penalty[Annual]", formatCurrency($dueArrayList["Annual"]->getPenalty()));
                                             $this->tpl->set_var("amnesty[Annual]", "No");
                                             $this->tpl->set_var("initialNetDue[Annual]", formatCurrency($this->initialNetDue["Annual"]));
                                         } else {
                                             if ($latestPaymentDueType == "Annual" && $totalAnnualNetDue - $amountPaidForDue <= 0) {
                                                 // all of ANNUAL Due has been fully paid, modify Quarterly Due values
                                                 $quarterlyDueKeys = array("Q1", "Q2", "Q3", "Q4");
                                                 foreach ($quarterlyDueKeys as $dKey) {
                                                     $dueArrayList[$dKey]->setAdvancedPaymentDiscount(0);
                                                     $dueArrayList[$dKey]->setEarlyPaymentDiscount(0);
                                                     $dueArrayList[$dKey]->setMonthsOverDue(0);
                                                     $dueArrayList[$dKey]->setPenaltyPercentage(0);
                                                     $dueArrayList[$dKey]->setPenalty(0);
                                                     $this->initialNetDue[$dKey] = $dueArrayList[$dKey]->getInitialNetDue();
                                                     $this->tpl->set_var("advancedPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getAdvancedPaymentDiscount()));
                                                     $this->tpl->set_var("earlyPaymentDiscount[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getEarlyPaymentDiscount()));
                                                     $this->tpl->set_var("monthsOverDue[" . $dKey . "]", $dueArrayList[$dKey]->getMonthsOverDue());
                                                     $this->tpl->set_var("penaltyPercentage[" . $dKey . "]", $dueArrayList[$dKey]->getPenaltyPercentage() * 100);
                                                     $this->tpl->set_var("penalty[" . $dKey . "]", formatCurrency($dueArrayList[$dKey]->getPenalty()));
                                                     $this->tpl->set_var("amnesty[" . $dKey . "]", "No");
                                                     $this->tpl->set_var("initialNetDue[" . $dKey . "]", formatCurrency($this->initialNetDue[$dKey]));
                                                 }
                                             }
                                         }
                                     }
                                 }
                                 // display Backtaxes and previousTD Backtaxes
                                 $this->formArray["totalBacktaxesBalance"] = 0;
                                 $this->displayBacktaxTD($tvalue->getTdID());
                                 $precedingTDArray = $this->getPrecedingTDArray($tvalue);
                                 if (is_array($precedingTDArray)) {
                                     foreach ($precedingTDArray as $precedingTD) {
                                         $this->displayBacktaxTD($precedingTD->getTdID());
                                     }
                                 }
                                 $this->tpl->set_var("total", number_format($this->formArray["totalBacktaxesDue"], 2));
                                 $this->tpl->set_var("totalBacktaxesBalance", number_format($this->formArray["totalBacktaxesBalance"], 2));
                                 // grab dueID's and backtaxTDID's to run through payments
                                 // create $dueIDArray
                                 foreach ($dueArrayList as $due) {
                                     $this->dueIDArray[] = $due->getDueID();
                                 }
                                 $this->displayTotalPaid();
                                 $this->displayNetDue();
                                 $this->tdArrayList[$this->tdRecord["year"] . $this->tdArrayListCounter] = $this->tdRecord;
                                 $this->tdArrayListCounter++;
                                 unset($this->tdRecord);
                                 $this->tpl->set_var("ctr", $tdCtr);
                                 //$this->tpl->parse("defaultTDListBlock", "defaultTDList", true);
                                 //$this->tpl->parse("toggleTDListBlock", "toggleTDList", true);
                                 //$this->tpl->parse("TDListBlock", "TDList", true);
                                 //$this->tpl->set_var("BacktaxesListBlock", "");
                                 /*
                                 $this->tpl->set_var("LandBlock", "");
                                 $this->tpl->set_var("PlantsTreesBlock", "");
                                 $this->tpl->set_var("ImprovementsBuildingsBlock", "");
                                 $this->tpl->set_var("MachineriesBlock", "");
                                 */
                                 $tdCtr++;
                             }
                         } else {
                             $this->tpl->set_var("defaultTDListBlock", "//no default");
                             $this->tpl->set_var("toggleTDListBlock", "//no Toggle");
                             $this->tpl->set_var("TDListBlock", "");
                         }
                         $this->tpl->set_var("tdCtr", $tdCtr);
                         break;
                     case "landTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "landTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "plantTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "bldgTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "machTotalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalMarketValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     case "totalAssessedValue":
                         if (!$this->formArray[$key]) {
                             $this->formArray[$key] = $value;
                         }
                         break;
                     default:
                         $this->formArray[$key] = $value;
                 }
             }
             $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);
             $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
             $rptop = new RPTOP();
             $rptop->setRptopID($this->formArray["rptopID"]);
             $rptop->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]);
             $rptop->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]);
             $rptop->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]);
             $rptop->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]);
             $rptop->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]);
             $rptop->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]);
             $rptop->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]);
             $rptop->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]);
             $rptop->setTotalMarketValue($this->formArray["totalMarketValue"]);
             $rptop->setTotalAssessedValue($this->formArray["totalAssessedValue"]);
             $rptop->setCreatedBy($this->userID);
             $rptop->setModifiedBy($this->userID);
             $rptop->setDomDocument();
             $RPTOPEncode = new SoapObject(NCCBIZ . "RPTOPEncode.php", "urn:Object");
             $rptop->setDomDocument();
             $doc = $rptop->getDomDocument();
             $xmlStr = $doc->dump_mem(true);
             //echo $xmlStr;
             if (!($ret = $RPTOPEncode->updateRPTOPtotals($xmlStr))) {
                 echo "ret=" . $ret;
             }
             //echo $ret;
         }
     }
     if (is_array($this->tdArrayList)) {
         ksort($this->tdArrayList);
         reset($this->tdArrayList);
         //			$this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock");
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         $this->tpl->set_block("Page", "TDList", "TDListBlock");
         $this->tpl->set_block("Page", "TotalDue", "TotalDueBlock");
         $this->formArray["totalTaxDue"] = 0;
         $maxRows = 20;
         $numRows = count($this->tdArrayList);
         $numPages = ceil($numRows / $maxRows);
         $rowStr = "";
         $j = 0;
         $page = 0;
         foreach ($this->tdArrayList as $tdRecord) {
             ++$j;
             if ($j > $maxRows) {
                 $this->formArray["tdYPosValue"] = "564";
                 $this->tpl->set_var("TDListBlock", $rowStr);
                 $this->tpl->set_var("PageNumber", ++$page);
                 if ($page == $numPages) {
                     $this->tpl->set_var("TotalDueBlock", $this->tpl->subst("TotalDue"));
                 } else {
                     $this->tpl->set_var("TotalDueBlock", "");
                 }
                 $this->tpl->parse("PageBlock", "Page", true);
                 $rowStr = "";
                 $j = 1;
             }
             $this->tpl->set_var("arpNumber", $tdRecord["arpNumber"]);
             $this->tpl->set_var("class", $tdRecord["class"]);
             $this->tpl->set_var("location", $tdRecord["location"]);
             $this->tpl->set_var("year", $tdRecord["year"]);
             $this->tpl->set_var("taxDue", formatCurrency($tdRecord["taxDue"]));
             $this->tpl->set_var("tdYPos", $this->formArray["tdYPosValue"]);
             $this->formArray["tdYPosValue"] -= 15;
             $this->formArray["totalTaxDue"] += $tdRecord["taxDue"];
             $rowStr .= $this->tpl->subst("TDList");
         }
         $this->tpl->set_var("TDListBlock", $rowStr);
         $this->tpl->set_var("PageNumber", ++$page);
         if ($page == $numPages) {
             $this->tpl->set_var("TotalDueBlock", $this->tpl->subst("TotalDue"));
         } else {
             $this->tpl->set_var("TotalDueBlock", "");
         }
         $this->tpl->parse("PageBlock", "Page", true);
         //			echo $this->tpl->subst("Page");
         /*
         			$maxRows = 5;
         			$numRows = count($this->tdArrayList);
         			$numPages = ceil($numRows/$maxRows);
         			$tdRecord = current($this->tdArrayList);
         			for ($page=0; $page<$numPages; ++$page) {
         				$rowStr = "";
         				$this->formArray["tdYPosValue"] = "564";
         				for ($currRow=0; $currRow<$maxRows; ++$currRow) {
         //					$tdRecord = $this->tdArrayList[($page*$maxRows)+$currRow];
         
         					$this->tpl->set_var("arpNumber", $tdRecord["arpNumber"]);
         					$this->tpl->set_var("class", $tdRecord["class"]);
         					$this->tpl->set_var("location", $tdRecord["location"]);
         					$this->tpl->set_var("year", $tdRecord["year"]);
         					$this->tpl->set_var("taxDue", formatCurrency($tdRecord["taxDue"]));
         					$this->tpl->set_var("tdYPos", $this->formArray["tdYPosValue"]);
         					$this->formArray["tdYPosValue"]-=15;
         					$rowStr .= $this->tpl->subst("TDList");
         
         					$this->formArray["totalTaxDue"] += $tdRecord["taxDue"];
         					$tdRecord = next($this->tdArrayList);
         				}
         				echo $rowStr;
         				$this->tpl->set_var("TDListBlock", $rowStr);
         				$this->tpl->set_var("PageNum", $page+1);
         				$this->tpl->parse("PageBlock", "Page", true);
         			}
         
         			foreach($this->tdArrayList as $tdRecord){
         				$this->tpl->set_var("arpNumber", $tdRecord["arpNumber"]);
         				$this->tpl->set_var("class", $tdRecord["class"]);
         				$this->tpl->set_var("location", $tdRecord["location"]);
         				$this->tpl->set_var("year", $tdRecord["year"]);
         				$this->tpl->set_var("taxDue", formatCurrency($tdRecord["taxDue"]));
         				$this->tpl->set_var("tdYPos", $this->formArray["tdYPosValue"]);
         
         				$this->formArray["totalTaxDue"] += $tdRecord["taxDue"];
         				$this->tpl->parse("TDListBlock", "TDList", true);
         				$this->formArray["tdYPosValue"]-=15;
         			}
         */
     }
     $this->setForm();
     /*
     $this->setPageDetailPerms();
     
     $this->tpl->set_var("uname", $this->user["uname"]);
     
     $this->tpl->set_var("today", date("F j, Y",strtotime($this->now)));
     
     $this->tpl->set_var("Session", $this->sess->url("").$this->sess->add_query(array("rptopID"=>$this->formArray["rptopID"],"ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
     */
     $this->tpl->set_var("today", date("F j, Y", strtotime($this->now)));
     $this->setLguDetails();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     exit;
 }
예제 #28
0
 function Main()
 {
     $eRPTSSettings = new eRPTSSettings();
     if ($eRPTSSettings->selectRecord(1)) {
         $this->tpl->set_var("lguType", strtoupper($eRPTSSettings->getLguType()));
         $this->tpl->set_var("lguName", strtoupper($eRPTSSettings->getLguName()));
     }
     $dbTD = new DB_RPTS();
     $dbBacktaxTD = new DB_RPTS();
     $dbPaymentBacktaxTD = new DB_RPTS();
     $dbPaymentTD = new DB_RPTS();
     $dbCollectionBacktaxTD = new DB_RPTS();
     $dbCollectionTD = new DB_RPTS();
     $dbDue = new DB_RPTS();
     // gather TD's
     $sql = "SELECT Due.dueID as dueID, " . "Due.tdID as tdID, " . "Due.dueType as dueType, " . "Due.dueDate as dueDate, " . "Due.basicTax as basicTax, " . "Due.basicTaxRate as basicTaxRate, " . "Due.sefTax as sefTax, " . "Due.sefTaxRate as sefTaxRate, " . "Due.idleTax as idleTax, " . "Due.idleTaxRate as idleTaxRate, " . "TD.afsID as afsID, " . "TD.propertyType as propertyType, " . "TD.taxDeclarationNumber as taxDeclarationNumber, " . "AFS.odID as odID, " . "AFS.arpNumber as arpNumber, " . "AFS.propertyIndexNumber as propertyIndexNumber, " . "AFS.taxability as taxability, " . "AFS.effectivity as effectivity, " . "AFS.totalMarketValue as totalMarketValue, " . "AFS.totalAssessedValue as totalAssessedValue " . "FROM Due, TD, AFS " . "WHERE Due.tdID = TD.tdID " . "AND TD.afsID = AFS.afsID " . "AND AFS.archive != 'true' " . "AND TD.archive != 'true' " . "AND Due.dueType = 'Annual' " . "AND TD.propertyType LIKE '" . $this->formArray["classification"] . "' " . "GROUP BY Due.tdID, YEAR(Due.dueDate) " . "ORDER BY Due.dueDate DESC";
     $dbTD->query($sql);
     if ($dbTD->nf() > 0) {
         // gather BacktaxTD's
         while ($dbTD->next_record()) {
             $sqlBacktaxTD = "SELECT backtaxTDID, " . "tdID, " . "tdNumber, " . "startYear, " . "endYear, " . "startQuarter, " . "assessedValue, " . "basicRate, " . "sefRate, " . "basicTax, " . "sefTax, " . "idleTax, " . "penalties, " . "paid, " . "balance, " . "total " . "FROM BacktaxTD " . "WHERE tdID='" . $dbTD->f("tdID") . "' " . "ORDER BY startYear ASC ";
             $dbBacktaxTD->query($sqlBacktaxTD);
             if ($dbBacktaxTD->nf() > 0) {
                 while ($dbBacktaxTD->next_record()) {
                     $backtaxTDRecordArray[] = $dbBacktaxTD->Record;
                 }
             }
             $tdRecordArray[] = array("td" => $dbTD->Record, "backtaxTD" => $backtaxTDRecordArray);
             unset($backtaxTDRecordArray);
         }
     }
     if (is_array($tdRecordArray)) {
         foreach ($tdRecordArray as $recordArray) {
             // gather backtaxTD details
             if (is_array($recordArray["backtaxTD"])) {
                 foreach ($recordArray["backtaxTD"] as $backtaxTDRecord) {
                     $paidBasic = 0;
                     $paidSEF = 0;
                     $paidPenalty = 0;
                     $totalTaxCollected = 0;
                     $basic = 0;
                     $sef = 0;
                     $penalty = 0;
                     $totalCollectible = 0;
                     // get totalTaxCollected
                     $sqlPaymentBacktaxTD = "SELECT paymentID, " . "dueType, " . "backtaxTDID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE backtaxTDID='" . $backtaxTDRecord["backtaxTDID"] . "' " . "AND status!='cancelled'";
                     $dbPaymentBacktaxTD->query($sqlPaymentBacktaxTD);
                     if ($dbPaymentBacktaxTD->nf() > 0) {
                         while ($dbPaymentBacktaxTD->next_record()) {
                             $sqlCollectionBacktaxTD = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentBacktaxTD->f("paymentID") . "' " . "AND status!='cancelled' ";
                             $dbCollectionBacktaxTD->query($sqlCollectionBacktaxTD);
                             if ($dbCollectionBacktaxTD->nf() > 0) {
                                 while ($dbCollectionBacktaxTD->next_record()) {
                                     switch ($dbCollectionBacktaxTD->f("taxType")) {
                                         case "basic":
                                             if ($dbCollectionBacktaxTD->f("amnesty") != "true") {
                                                 $paidBasic += $dbCollectionBacktaxTD->f("amountPaid") - $dbCollectionBacktaxTD->f("penalty");
                                                 $paidPenalty += $dbCollectionBacktaxTD->f("penalty");
                                                 $totalTaxCollected += $dbCollectionBacktaxTD->f("amountPaid");
                                             } else {
                                                 $paidBasic += $dbCollectionBacktaxTD->f("amountPaid");
                                                 $totalTaxCollected += $paidBasic;
                                             }
                                             break;
                                         case "sef":
                                             if ($dbCollectionBacktaxTD->f("amnesty") != "true") {
                                                 $paidSEF += $dbCollectionBacktaxTD->f("amountPaid") - $dbCollectionBacktaxTD->f("penalty");
                                                 $paidPenalty += $dbCollectionBacktaxTD->f("penalty");
                                                 $totalTaxCollected += $dbCollectionBacktaxTD->f("amountPaid");
                                             } else {
                                                 $paidSEF += $dbCollectionBacktaxTD->f("amountPaid");
                                                 $totalTaxCollected += $paidSEF;
                                             }
                                             break;
                                     }
                                 }
                             }
                         }
                     }
                     // get totalCollectible
                     $basic = $backtaxTDRecord["basicTax"];
                     $sef = $backtaxTDRecord["sefTax"];
                     $backtaxTD = new BacktaxTD();
                     $backtaxTD->selectRecord("", $backtaxTDRecord["backtaxTDID"], "");
                     $backtaxTD->calculatePenalty(date("Y-m-d"));
                     $penalty = $backtaxTD->getPenalties();
                     $totalCollectible = $basic + $sef + $penalty;
                     $lineRecordArray[] = array("propertyIndexNumber" => "TD#:" . $backtaxTDRecord["tdNumber"] . " (" . $backtaxTDRecord["startYear"] . ")", "tdNumber" => $backtaxTDRecord["tdNumber"], "paidBasic" => $paidBasic, "paidSEF" => $paidSEF, "paidPenalty" => $paidPenalty, "totalTaxCollected" => $totalTaxCollected, "basic" => $basic, "sef" => $sef, "penalty" => $penalty, "totalCollectible" => $totalCollectible);
                 }
             }
             $paidBasic = 0;
             $paidSEF = 0;
             $paidPenalty = 0;
             $totalTaxCollected = 0;
             $basic = 0;
             $sef = 0;
             $penalty = 0;
             $totalCollectible = 0;
             // gather TD details
             if (is_array($recordArray["td"])) {
                 $tdRecord = $recordArray["td"];
                 // get totalTaxCollected
                 $sqlPaymentTD = "SELECT paymentID, " . "dueType, " . "backtaxTDID, " . "taxDue, " . "earlyPaymentDiscount, " . "advancedPaymentDiscount, " . "penalty, " . "amnesty, " . "balanceDue, " . "amountPaid, " . "dueDate, " . "paymentDate " . "FROM Payment " . "WHERE tdID='" . $tdRecord["tdID"] . "' " . "AND status!='cancelled'";
                 $dbPaymentTD->query($sqlPaymentTD);
                 if ($dbPaymentTD->nf() > 0) {
                     while ($dbPaymentTD->next_record()) {
                         $sqlCollectionTD = "SELECT * " . "FROM Collection " . "WHERE paymentID='" . $dbPaymentTD->f("paymentID") . "' " . "AND status!='cancelled' ";
                         $dbCollectionTD->query($sqlCollectionTD);
                         if ($dbCollectionTD->nf() > 0) {
                             while ($dbCollectionTD->next_record()) {
                                 switch ($dbCollectionTD->f("taxType")) {
                                     case "basic":
                                         if ($dbCollectionTD->f("amnesty") != "true") {
                                             $paidBasic += $dbCollectionTD->f("amountPaid") - $dbCollectionTD->f("penalty");
                                             $paidPenalty += $dbCollectionTD->f("penalty");
                                             $totalTaxCollected += $dbCollectionTD->f("amountPaid");
                                         } else {
                                             $paidBasic += $dbCollectionTD->f("amountPaid");
                                             $totalTaxCollected += $paidBasic;
                                         }
                                         break;
                                     case "sef":
                                         if ($dbCollectionTD->f("amnesty") != "true") {
                                             $paidSEF += $dbCollectionTD->f("amountPaid") - $dbCollectionTD->f("penalty");
                                             $paidPenalty += $dbCollectionTD->f("penalty");
                                             $totalTaxCollected += $dbCollectionTD->f("amountPaid");
                                         } else {
                                             $paidSEF += $dbCollectionTD->f("amountPaid");
                                             $totalTaxCollected += $paidSEF;
                                         }
                                         break;
                                 }
                             }
                         }
                     }
                 }
                 // get totalCollectible
                 $due = new Due();
                 if ($due->selectRecord($tdRecord["dueID"])) {
                     $basic = $due->getBasicTax();
                     $sef = $due->getSefTax();
                     $due = $this->computePenalty(date("Y-m-d"), $due);
                     $penalty = $due->getPenalty();
                     $totalCollectible = $basic + $sef + $penalty;
                 }
                 $lineRecordArray[] = array("propertyIndexNumber" => $tdRecord["propertyIndexNumber"], "tdNumber" => $tdRecord["taxDeclarationNumber"], "paidBasic" => $paidBasic, "paidSEF" => $paidSEF, "paidPenalty" => $paidPenalty, "totalTaxCollected" => $totalTaxCollected, "basic" => $basic, "sef" => $sef, "penalty" => $penalty, "totalCollectible" => $totalCollectible);
             }
         }
     }
     // print page
     if (is_array($lineRecordArray)) {
         $ypos = 400;
         $decrementYposBy = 12;
         $linesPerPage = 20;
         $count = count($lineRecordArray);
         $numOfPages = ceil($count / $linesPerPage);
         $pageCtr = 1;
         $lineCtr = 1;
         $recordCtr = 1;
         $this->tpl->set_var("classification", $this->formArray["classification"]);
         $this->tpl->set_var("numOfPages", $numOfPages);
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         $this->tpl->set_block("Page", "Row", "RowBlock");
         $this->tpl->set_block("Page", "Totals", "TotalsBlock");
         $totalsArray = array("totalPaidBasic" => 0, "totalPaidSEF" => 0, "totalPaidPenalty" => 0, "totalTotalTaxCollected" => 0, "totalBasic" => 0, "totalSef" => 0, "totalPenalty" => 0, "totalTotalCollectible" => 0);
         foreach ($lineRecordArray as $recordArray) {
             $this->tpl->set_var("ypos", $ypos);
             $this->tpl->set_var("recordCtr", $recordCtr);
             // tally totals
             $totalsArray["totalPaidBasic"] += un_number_format($recordArray["paidBasic"]);
             $totalsArray["totalPaidSEF"] += un_number_format($recordArray["paidSEF"]);
             $totalsArray["totalPaidPenalty"] += un_number_format($recordArray["paidPenalty"]);
             $totalsArray["totalTotalTaxCollected"] += un_number_format($recordArray["totalTaxCollected"]);
             $totalsArray["totalBasic"] += un_number_format($recordArray["basic"]);
             $totalsArray["totalSef"] += un_number_format($recordArray["sef"]);
             $totalsArray["totalPenalty"] += un_number_format($recordArray["penalty"]);
             $totalsArray["totalTotalCollectible"] += un_number_format($recordArray["totalCollectible"]);
             // write values
             foreach ($recordArray as $key => $value) {
                 switch ($key) {
                     case "paidBasic":
                     case "paidSEF":
                     case "paidPenalty":
                     case "totalTaxCollected":
                     case "basic":
                     case "sef":
                     case "penalty":
                     case "totalCollectible":
                         $value = formatCurrency($value);
                         break;
                 }
                 $this->tpl->set_var($key, $value);
             }
             $this->tpl->parse("RowBlock", "Row", true);
             if ($recordCtr == count($lineRecordArray) || $lineCtr == $linesPerPage) {
                 if ($pageCtr == $numOfPages) {
                     foreach ($totalsArray as $key => $value) {
                         $value = formatCurrency($value);
                         $this->tpl->set_var($key, $value);
                     }
                     $this->tpl->parse("TotalsBlock", "Totals", true);
                 } else {
                     $this->tpl->set_var("TotalsBlock", "");
                 }
                 $this->tpl->set_var("page", $pageCtr);
                 $this->tpl->parse("PageBlock", "Page", true);
                 $this->tpl->set_var("RowBlock", "");
                 $this->tpl->set_var("TotalsBlock", "");
                 $ypos = 400;
                 $lineCtr = 0;
                 $pageCtr++;
             }
             $lineCtr++;
             $recordCtr++;
             $ypos = $ypos - $decrementYposBy;
         }
         $this->tpl->parse("templatePage", "rptsTemplate");
         $this->tpl->finish("templatePage");
         $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);
         }
     } else {
         exit("no records to display");
     }
 }
예제 #29
0
파일: RPTRPrint.php 프로젝트: armic/erpts
 function showReceipt($preprinted)
 {
     if ($preprinted) {
         $this->tpl->set_file(array('step3' => 'PayRPTOP3.htm', 'receipt' => 'pprptreceipt.xml'));
     } else {
         $this->tpl->set_file(array('step3' => 'PayRPTOP3.htm', 'receipt' => 'rptreceipt.xml'));
     }
     # get all the details from the page
     if (isset($_POST['tdID'])) {
         $this->setDetails();
     }
     $this->tpl->set_var('ownerAddress', strip_tags($this->tpl->get("ownerAddress")));
     $this->tpl->parse('OUT', 'receipt');
     $this->tpl->finish('OUT');
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get("OUT"), "string");
     $rptrpdf->writePDF("rptr.pdf");
     // echo to browser
     // $tpl->p('OUT');
 }
예제 #30
0
 function Main()
 {
     $this->getSignatory();
     if (is_array($this->formArray["personCompanyIDArray"])) {
         $this->tpl->set_block("rptsTemplate", "Page", "PageBlock");
         foreach ($this->formArray["personCompanyIDArray"] as $personCompanyID) {
             $this->tpl->set_var("pageNumber", $this->pageNumber);
             switch ($this->formArray["ownerType"]) {
                 case "Company":
                     $company = new Company();
                     $company->selectRecord($personCompanyID);
                     $nameList = $company->getCompanyName();
                     break;
                 case "Person":
                 default:
                     $person = new Person();
                     $person->selectRecord($personCompanyID);
                     $nameList = $person->getName();
                     break;
             }
             $this->tpl->set_var("nameList", $nameList);
             $tdNumberList = "";
             $tdArray = $this->getTDArrayFromOwner($personCompanyID);
             if (is_array($tdArray)) {
                 foreach ($tdArray as $td) {
                     if ($tdNumberList != "") {
                         $tdNumberList .= "\n";
                     }
                     $tdNumberList .= $this->getTDNumberListLine($td);
                 }
             }
             $this->tpl->set_var("tdNumberList", $tdNumberList);
             $this->tpl->parse("PageBlock", "Page", true);
             $this->pageNumber++;
         }
     } else {
         exit("no owners selected");
     }
     $this->setLguDetails();
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $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);
     }
 }