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); } }
function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList) { $totalMarketValue = 0; $totalAssessedValue = 0; $totalArea = 0; // RC 20091008 $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; $nLandTotalArea = 0; $nPlantsTotalAssessedValue = 0; $nPlantsTotalAdjustedMarketValue = 0; $nBuildingsTotalAssessedValue = 0; $nBuildingsTotalAdjustedMarketValue = 0; $nBuildingsTotalArea = 0; // RC 20091008 $nMachineriesTotalAssessedValue = 0; $nMachineriesTotalAdjustedMarketValue = 0; $swornLandTotal = 0; $swornImprovementTotal = 0; $swornOverallTotal = 0; $i = 1; $flag = 0; $counter = 0; $summlvl = 0; $summuse = ""; $summcla = ""; //RC 20091001 for summary total by Use & level if (count($landList)) { $this->formArray["kindIsLand"] = "X"; // RC 20091006 foreach ($landList as $key => $land) { if ($i < 5) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); } // add pre new if ($landActualUsesCode == "RE" || $landActualUsesCode == "COM" || $landActualUsesCode == "IND" || $landActualUsesCode == "MI" || $landActualUsesCode == "TI" || $landActualUsesCode == "SP") { $tempname = $landActualUsesDescription; $counter += 1; } // end of2 add $totalMarketValue += toFloat($land->getAdjustedMarketValue()); $totalAssessedValue += toFloat($land->getAssessedValue()); $swornLandTotal += toFloat($land->getAdjustedMarketValue()); $swornOverallTotal += toFloat($land->getAdjustedMarketValue()); // display the summary of lands value if ($counter > 0) { $this->formArray["propertyActualUse" . $i] = $tempname; } else { $this->formArray["propertyActualUse" . $i] = "Agricultural"; } //RC 20091001 To properly report summary by Actual Use and Level $thislvl = $land->getAssessmentLevel(); $thisuse = $landActualUsesDescription; if ($summuse == '') { //RC first record $summlvl = $thislvl; $summuse = $thisuse; $summcla = $landClassesDescription; $nLandTotalArea = 0; $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; } if ($summlvl != $thislvl || $summuse != $thisuse) { //RC print if new assessment level or new actual use $this->formArray["propertyKind" . $i] = "Land"; $this->formArray["classification" . $i] = $summcla; $this->formArray["propertyActualUse" . $i] = $summuse; $this->formArray["findingsTotalArea" . $i] = $nLandTotalArea; $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%"; $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue; $i++; $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; $nLandTotalArea = 0; $summlvl = $thislvl; $summuse = $thisuse; $summcla = $landClassesDescription; } $nLandTotalAssessedValue += toFloat($land->getAssessedValue()); $nLandTotalAdjustedMarketValue += toFloat($land->getAdjustedMarketValue()); $nLandTotalArea += toFloat($land->getArea()); } } $this->formArray["propertyKind" . $i] = "Land"; $this->formArray["classification" . $i] = $summcla; $this->formArray["propertyActualUse" . $i] = $summuse; $this->formArray["findingsTotalArea" . $i] = $nLandTotalArea; $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%"; $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue; $i++; // end of summary of lands } if (count($plantsTreesList)) { $this->formArray["kindIsOthers"] = "X"; // RC 20091006 foreach ($plantsTreesList as $key => $plantsTrees) { if ($i < 5) { // productClass $plantsTreesClasses = new PlantsTreesClasses(); if (is_numeric($plantsTrees->getProductClass())) { $plantsTreesClasses->selectRecord($plantsTrees->getProductClass()); $plantsTreesClassesDescription = $plantsTreesClasses->getDescription(); $plantsTreesClassesCode = $plantsTreesClasses->getCode(); } else { $plantsTreesClassesDescription = $plantsTrees->getProductClass(); $plantsTreesClassesCode = $plantsTrees->getProductClass(); } // actualUse $plantsTreesActualUses = new PlantsTreesActualUses(); if (is_numeric($plantsTrees->getActualUse())) { $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse()); $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription(); $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode(); } else { $plantsTreesActualUsesDescription = $plantsTrees->getActualUse(); $plantsTreesActualUsesCode = $plantsTrees->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "PlantsTrees"; //$this->formArray["propertyActualUse".($i+1)] =$plantsTreesActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] =$plantsTrees->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $plantsTrees->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $plantsTrees->getAssessedValue(); $totalMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $totalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAdjustedMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $swornLandTotal += toFloat($plantsTrees->getAdjustedMarketValue()); $swornOverallTotal += toFloat($plantsTrees->getAdjustedMarketValue()); //$i++; } } $this->formArray["propertyKind" . $i] = "PlantTrees"; //inserted May 31, 2008 $this->formArray["classification" . $i] = $plantsTreesClassesDescription; $this->formArray["propertyActualUse" . $i] = $plantsTreesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nPlantsTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $plantsTrees->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nPlantsTotalAssessedValue; $i++; // additional new line for total of LAND AND PLANT TREES // $nSwornLandTotal =$nPlantsTotalAdjustedMarketValue + $nLandTotalAdjustedMarketValue; // $this->formArray["swornLandTotal"] =$nSwornLandTotal; //number_format($nSwornLandTotal,2); // END } if (count($improvementsBuildingsList)) { $this->formArray["kindIsBuilding"] = "X"; // RC 20091006 // $this->formArray["numberOfStoreys"] = $improvementsBuildings->getNumberOfStoreys(); $nBuildingTotalArea = 0; $nBuildingTotalAssessedValue = 0; $nBuildingTotalAdjustedMarketValue = 0; foreach ($improvementsBuildingsList as $key => $improvementsBuildings) { if ($i < 5) { // buildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); if (is_numeric($improvementsBuildings->getBuildingClassification())) { $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification()); $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription(); $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode(); } else { $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification(); } // actualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); if (is_numeric($improvementsBuildings->getActualUse())) { $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse()); $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription(); $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode(); } else { $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse(); } $totalMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $totalArea += $improvementsBuildings->getTotalBuildingArea(); // RC 20091008 $thislvl = $improvementsBuildings->getAssessmentLevel(); $thisuse = $improvementsBuildingsActualUsesDescription; if ($summuse == '') { //RC first record $summlvl = $thislvl; $summuse = $thisuse; $summcla = $improvementsBuildingsClassesDescription; } if ($summlvl != $thislvl || $summuse != $thisuse) { //RC print if new assessment level or new actual use $this->formArray["propertyKind" . $i] = "Land"; $this->formArray["classification" . $i] = $summcla; $this->formArray["propertyActualUse" . $i] = $summuse; $this->formArray["findingsTotalArea" . $i] = $nBuildingTotalArea; $this->formArray["propertyMarketValue" . $i] = $nBuildingTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $summlvl . "%"; $this->formArray["propertyAssessedValue" . $i] = $nBuildingTotalAssessedValue; $i++; $nBuildingTotalAssessedValue = 0; $nBuildingTotalAdjustedMarketValue = 0; $nBuildingTotalArea = 0; $summlvl = $thislvl; $summuse = $thisuse; $summcla = $improvementsBuildingsClassesDescription; } $nBuildingTotalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $nBuildingTotalAdjustedMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $nBuildingTotalArea += toFloat($improvementsBuildings->getTotalBuildingArea()); $swornImprovementTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); $swornOverallTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); } } $this->formArray["propertyKind" . $i] = "ImprovementsBuildings"; $this->formArray["classification" . $i] = $improvementsBuildingsClassesDescription; $this->formArray["propertyActualUse" . $i] = $improvementsBuildingsActualUsesDescription; $this->formArray["findingsTotalArea" . $i] = $nBuildingTotalArea; $this->formArray["propertyMarketValue" . $i] = $nBuildingTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $improvementsBuildings->getAssessmentLevel() . "%"; $this->formArray["propertyAssessedValue" . $i] = $nBuildingTotalAssessedValue; $i++; $this->formArray["findingsTotalArea"] = $totalArea; //RC 20091008 } if (count($machineriesList)) { $this->formArray["kindIsMachinery"] = "X"; // RC 20091006 foreach ($machineriesList as $key => $machineries) { if ($i < 5) { // kind $machineriesClasses = new MachineriesClasses(); if (is_numeric($machineries->getKind())) { $machineriesClasses->selectRecord($machineries->getKind()); $machineriesClassesDescription = $machineriesClasses->getDescription(); $machineriesClassesCode = $machineriesClasses->getCode(); } else { $machineriesClassesDescription = $machineries->getKind(); $machineriesClassesCode = $machineries->getActualUse(); } // actualUse $machineriesActualUses = new MachineriesActualUses(); if (is_numeric($machineries->getActualUse())) { $machineriesActualUses->selectRecord($machineries->getActualUse()); $machineriesActualUsesDescription = $machineriesActualUses->getDescription(); $machineriesActualUsesCode = $machineriesActualUses->getCode(); } else { $machineriesActualUsesDescription = $machineries->getActualUse(); $machineriesActualUsesCode = $machineries->getActualUse(); } $totalMarketValue += toFloat($machineries->getAdjustedMarketValue()); $totalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAdjustedMarketValue += toFloat($machineries->getAdjustedMarketValue()); $swornImprovementTotal += toFloat($machineries->getAdjustedMarketValue()); $swornOverallTotal += toFloat($machineries->getAdjustedMarketValue()); // $i++; } } $this->formArray["propertyKind" . $i] = "Machineries"; $this->formArray["classification" . $i] = $machineriesClassesDescription; $this->formArray["propertyActualUse" . $i] = $machineriesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nMachineriesTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $machineries->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nMachineriesTotalAssessedValue; $i++; } // add pre hehe for sworn statement total and machineries $this->formArray["swornLandTotal"] = $swornLandTotal; $this->formArray["swornImprovementTotal"] = $swornImprovementTotal; $this->formArray["swornOverallTotal"] = $swornOverallTotal; // $nSwornImprovementTotal =$nMachineriesTotalAdjustedMarketValue + $nBuildingsTotalAdjustedMarketValue; // $this->formArray["swornImprovementTotal"] =$nSwornImprovementTotal; // $nSwornOverallTotal =$nSwornImprovementTotal + $nSwornLandTotal; // $this->formArray["swornOverallTotal"] =$nSwornOverallTotal; // end $this->formArray["totalMarketValue"] = $totalMarketValue; $this->formArray["totalAssessedValue"] = $totalAssessedValue; $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue); }
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; }
function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList) { $totalMarketValue = 0; $totalAssessedValue = 0; $nLandTotalAssessedValue = 0; $nLandTotalAdjustedMarketValue = 0; $nPlantsTotalAssessedValue = 0; $nPlantsTotalAdjustedMarketValue = 0; $nBuildingsTotalAssessedValue = 0; $nBuildingsTotalAdjustedMarketValue = 0; $nMachineriesTotalAssessedValue = 0; $nMachineriesTotalAdjustedMarketValue = 0; $swornLandTotal = 0; $swornImprovementTotal = 0; $swornOverallTotal = 0; $i = 1; $flag = 0; $counter = 0; if (count($landList)) { foreach ($landList as $key => $land) { if ($i < 5) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); } // add pre new hehe if ($landActualUsesCode == "RES" || $landActualUsesCode == "COM" || $landActualUsesCode == "IND" || $landActualUsesCode == "MI" || $landActualUsesCode == "TI" || $landActualUsesCode == "SP") { $tempname = $landActualUsesDescription; $counter += 1; } // end of add hehe $totalMarketValue += toFloat($land->getAdjustedMarketValue()); $totalAssessedValue += toFloat($land->getAssessedValue()); $nLandTotalAssessedValue += toFloat($land->getAssessedValue()); $nLandTotalAdjustedMarketValue += toFloat($land->getAdjustedMarketValue()); $swornLandTotal += toFloat($land->getAdjustedMarketValue()); $swornOverallTotal += toFloat($land->getAdjustedMarketValue()); // $this->formArray["propertyKind".($i)] = "Land"; // $this->formArray["propertyActualUse".($i)] = $landActualUsesDescription; // $this->formArray["propertyMarketValue".($i)] = $land->getAdjustedMarketValue(); // $this->formArray["propertyAssessmentLevel".($i)] = $land->getAssessmentLevel(); // $this->formArray["propertyAssessedValue".($i)] = $land->getAssessedValue(); // $totalMarketValue+=toFloat($land->getAdjustedMarketValue()); // $totalAssessedValue+=toFloat($land->getAssessedValue()); //$i++; } } //} // display the summary of lands value if ($counter > 0) { $this->formArray["propertyActualUse" . $i] = $tempname; } else { $this->formArray["propertyActualUse" . $i] = "Agricultural"; } $this->formArray["propertyKind" . $i] = "Land"; // $this->formArray["propertyActualUse".($i)] = "Agricultural"; $this->formArray["propertyMarketValue" . $i] = $nLandTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $land->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nLandTotalAssessedValue; $i++; // end of summary of lands } if (count($plantsTreesList)) { foreach ($plantsTreesList as $key => $plantsTrees) { if ($i < 5) { // productClass $plantsTreesClasses = new PlantsTreesClasses(); if (is_numeric($plantsTrees->getProductClass())) { $plantsTreesClasses->selectRecord($plantsTrees->getProductClass()); $plantsTreesClassesDescription = $plantsTreesClasses->getDescription(); $plantsTreesClassesCode = $plantsTreesClasses->getCode(); } else { $plantsTreesClassesDescription = $plantsTrees->getProductClass(); $plantsTreesClassesCode = $plantsTrees->getProductClass(); } // actualUse $plantsTreesActualUses = new PlantsTreesActualUses(); if (is_numeric($plantsTrees->getActualUse())) { $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse()); $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription(); $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode(); } else { $plantsTreesActualUsesDescription = $plantsTrees->getActualUse(); $plantsTreesActualUsesCode = $plantsTrees->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "PlantsTrees"; //$this->formArray["propertyActualUse".($i+1)] =$plantsTreesActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] =$plantsTrees->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $plantsTrees->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $plantsTrees->getAssessedValue(); $totalMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $totalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $nPlantsTotalAdjustedMarketValue += toFloat($plantsTrees->getAdjustedMarketValue()); $swornLandTotal += toFloat($plantsTrees->getAdjustedMarketValue()); $swornOverallTotal += toFloat($plantsTrees->getAdjustedMarketValue()); //$i++; } } $this->formArray["propertyKind" . $i] = "PlantTrees"; $this->formArray["propertyActualUse" . $i] = $plantsTreesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nPlantsTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $plantsTrees->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nPlantsTotalAssessedValue; $i++; // additional new line for total of LAND AND PLANT TREES // $nSwornLandTotal =$nPlantsTotalAdjustedMarketValue + $nLandTotalAdjustedMarketValue; // $this->formArray["swornLandTotal"] =$nSwornLandTotal; //number_format($nSwornLandTotal,2); // END } if (count($improvementsBuildingsList)) { foreach ($improvementsBuildingsList as $key => $improvementsBuildings) { if ($i < 5) { // buildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); if (is_numeric($improvementsBuildings->getBuildingClassification())) { $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification()); $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription(); $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode(); } else { $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification(); } // actualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); if (is_numeric($improvementsBuildings->getActualUse())) { $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse()); $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription(); $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode(); } else { $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "ImprovementsBuildings"; //$this->formArray["propertyActualUse".($i+1)] = $improvementsBuildingsActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] = $improvementsBuildings->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $improvementsBuildings->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $improvementsBuildings->getAssessedValue(); $totalMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $nBuildingsTotalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $nBuildingsTotalAdjustedMarketValue += toFloat($improvementsBuildings->getAdjustedMarketValue()); $swornImprovementTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); $swornOverallTotal += toFloat($improvementsBuildings->getAdjustedMarketValue()); // $i++; } } $this->formArray["propertyKind" . $i] = "ImprovementsBuildings"; $this->formArray["propertyActualUse" . $i] = $improvementsBuildingsActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nBuildingsTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $improvementsBuildings->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nBuildingsTotalAssessedValue; $i++; } if (count($machineriesList)) { foreach ($machineriesList as $key => $machineries) { if ($i < 5) { // kind $machineriesClasses = new MachineriesClasses(); if (is_numeric($machineries->getKind())) { $machineriesClasses->selectRecord($machineries->getKind()); $machineriesClassesDescription = $machineriesClasses->getDescription(); $machineriesClassesCode = $machineriesClasses->getCode(); } else { $machineriesClassesDescription = $machineries->getKind(); $machineriesClassesCode = $machineries->getActualUse(); } // actualUse $machineriesActualUses = new MachineriesActualUses(); if (is_numeric($machineries->getActualUse())) { $machineriesActualUses->selectRecord($machineries->getActualUse()); $machineriesActualUsesDescription = $machineriesActualUses->getDescription(); $machineriesActualUsesCode = $machineriesActualUses->getCode(); } else { $machineriesActualUsesDescription = $machineries->getActualUse(); $machineriesActualUsesCode = $machineries->getActualUse(); } //$this->formArray["propertyKind".($i+1)] = "Machineries"; //$this->formArray["propertyActualUse".($i+1)] = $machineriesActualUsesDescription; //$this->formArray["propertyMarketValue".($i+1)] = $machineries->getAdjustedMarketValue(); //$this->formArray["propertyAssessmentLevel".($i+1)] = $machineries->getAssessmentLevel(); //$this->formArray["propertyAssessedValue".($i+1)] = $machineries->getAssessedValue(); $totalMarketValue += toFloat($machineries->getAdjustedMarketValue()); $totalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAssessedValue += toFloat($machineries->getAssessedValue()); $nMachineriesTotalAdjustedMarketValue += toFloat($machineries->getAdjustedMarketValue()); $swornImprovementTotal += toFloat($machineries->getAdjustedMarketValue()); $swornOverallTotal += toFloat($machineries->getAdjustedMarketValue()); // $i++; } } $this->formArray["propertyKind" . $i] = "Machineries"; $this->formArray["propertyActualUse" . $i] = $machineriesActualUsesDescription; $this->formArray["propertyMarketValue" . $i] = $nMachineriesTotalAdjustedMarketValue; $this->formArray["propertyAssessmentLevel" . $i] = $machineries->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . $i] = $nMachineriesTotalAssessedValue; $i++; } // add pre hehe for sworn statement total and machineries $this->formArray["swornLandTotal"] = $swornLandTotal; $this->formArray["swornImprovementTotal"] = $swornImprovementTotal; $this->formArray["swornOverallTotal"] = $swornOverallTotal; // $nSwornImprovementTotal =$nMachineriesTotalAdjustedMarketValue + $nBuildingsTotalAdjustedMarketValue; // $this->formArray["swornImprovementTotal"] =$nSwornImprovementTotal; $grandTotalArea = $findingsTotalArea + $bfindingsFloorArea; // $this->formArray["swornOverallTotal"] =$nSwornOverallTotal; // end $this->formArray["totalMarketValue"] = $totalMarketValue; $this->formArray["totalAssessedValue"] = $totalAssessedValue; $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue); }
<?php //require_once("lib/ebpls.lib.php"); //require_once("lib/ebpls.utils.php"); //$dbLink = get_db_connection(); global $ThUserData; require "includes/variables.php"; require "includes/num2words.php"; include "lib/multidbconnection.php"; $dbLink = Open($dbtype, $connecttype, $dbhost, $dbuser, $dbpass, $dbname); //get lgu name $getlgu = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", ""); $getlgu = FetchRow($dbtype, $getlgu); $getchek = SelectMultiTable($dbtype, $dbLink, "temppayment a, {$owner} d", "a.*, concat(d.owner_last_name,', ', d.owner_first_name,\r\n ' ', d.owner_middle_name)", "where a.owner_id={$owner_id} and\r\n\t\t\ta.permit_type='{$permit_type}' and permit_status='{$stat}' \r\n\t\t\tand a.owner_id=d.owner_id and a.or_no='{$or_no}'"); $getit = FetchRow($dbtype, $getchek); $amt2words = makewords($getit[1]); $pos1 = strpos($amt2words, " And "); $slen = strlen($amt2words); // - $pos1; $amt2words1 = substr($amt2words, 0, $pos1); $amt2words2 = substr($amt2words, $pos1); //get bus nature $datengay = date('Y'); $getbus = SelectMultiTable($dbtype, $dbLink, "ebpls_fees_paid", "fee_desc, fee_amount, multi_by", "where owner_id={$owner_id} and\r\n permit_type='{$permit_type}' and permit_status='{$stat}' and input_date like '{$datengay}%' and active='1'"); define('FPDF_FONTPATH', 'font/'); require 'ebpls-php-lib/html2pdf_lib/fpdf.php'; $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial', '', 10); $pdf->Cell(50, 48, 'Control #' . $getit[8], '0', '2', 'R'); $pdf->Cell(50, 7, $tdate, '0', '2', 'R');
function displayAssessedValues($landList, $plantsTreesList, $improvementsBuildingsList, $machineriesList) { $totalMarketValue = 0; $totalAssessedValue = 0; $i = 0; if (count($landList)) { foreach ($landList as $key => $land) { if ($i < 4) { // classification $landClasses = new LandClasses(); if (is_numeric($land->getClassification())) { $landClasses->selectRecord($land->getClassification()); $landClassesDescription = $landClasses->getDescription(); $landClassesCode = $landClasses->getCode(); } else { $landClassesDescription = $land->getClassification(); $landClassesCode = $land->getClassification(); } // subClass $landSubclasses = new LandSubclasses(); if (is_numeric($land->getSubClass())) { $landSubclasses->selectRecord($land->getSubClass()); $landSubclassesDescription = $landSubclasses->getDescription(); $landSubclassesCode = $landSubclasses->getCode(); } else { $landSubclassesDescription = $land->getSubClass(); $landSubclassesCode = $land->getSubClass(); } // actualUse $landActualUses = new LandActualUses(); if (is_numeric($land->getActualUse())) { $landActualUses->selectRecord($land->getActualUse()); $landActualUsesDescription = $landActualUses->getDescription(); $landActualUsesCode = $landActualUses->getCode(); } else { $landActualUsesDescription = $land->getActualUse(); $landActualUsesCode = $land->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "Land"; $this->formArray["propertyActualUse" . ($i + 1)] = $landActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $land->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $land->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $land->getAssessedValue(); $totalMarketValue += toFloat($land->getMarketValue()); $totalAssessedValue += toFloat($land->getAssessedValue()); $i++; } } } if (count($plantsTreesList)) { foreach ($plantsTreesList as $key => $plantsTrees) { if ($i < 4) { // productClass $plantsTreesClasses = new PlantsTreesClasses(); if (is_numeric($plantsTrees->getProductClass())) { $plantsTreesClasses->selectRecord($plantsTrees->getProductClass()); $plantsTreesClassesDescription = $plantsTreesClasses->getDescription(); $plantsTreesClassesCode = $plantsTreesClasses->getCode(); } else { $plantsTreesClassesDescription = $plantsTrees->getProductClass(); $plantsTreesClassesCode = $plantsTrees->getProductClass(); } // actualUse $plantsTreesActualUses = new PlantsTreesActualUses(); if (is_numeric($plantsTrees->getActualUse())) { $plantsTreesActualUses->selectRecord($plantsTrees->getActualUse()); $plantsTreesActualUsesDescription = $plantsTreesActualUses->getDescription(); $plantsTreesActualUsesCode = $plantsTreesActualUses->getCode(); } else { $plantsTreesActualUsesDescription = $plantsTrees->getActualUse(); $plantsTreesActualUsesCode = $plantsTrees->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "PlantsTrees"; $this->formArray["propertyActualUse" . ($i + 1)] = $plantsTreesActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $plantsTrees->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $plantsTrees->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $plantsTrees->getAssessedValue(); $totalMarketValue += toFloat($plantsTrees->getMarketValue()); $totalAssessedValue += toFloat($plantsTrees->getAssessedValue()); $i++; } } } if (count($improvementsBuildingsList)) { foreach ($improvementsBuildingsList as $key => $improvementsBuildings) { if ($i < 4) { // buildingClassification $improvementsBuildingsClasses = new ImprovementsBuildingsClasses(); if (is_numeric($improvementsBuildings->getBuildingClassification())) { $improvementsBuildingsClasses->selectRecord($improvementsBuildings->getBuildingClassification()); $improvementsBuildingsClassesDescription = $improvementsBuildingsClasses->getDescription(); $improvementsBuildingsClassesCode = $improvementsBuildingsClasses->getCode(); } else { $improvementsBuildingsClassesDescription = $improvementsBuildings->getBuildingClassification(); $improvementsBuildingsClassesCode = $improvementsBuildings->getBuildingClassification(); } // actualUse $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses(); if (is_numeric($improvementsBuildings->getActualUse())) { $improvementsBuildingsActualUses->selectRecord($improvementsBuildings->getActualUse()); $improvementsBuildingsActualUsesDescription = $improvementsBuildingsActualUses->getDescription(); $improvementsBuildingsActualUsesCode = $improvementsBuildingsActualUses->getCode(); } else { $improvementsBuildingsActualUsesDescription = $improvementsBuildings->getActualUse(); $improvementsBuildingsActualUsesCode = $improvementsBuildings->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "ImprovementsBuildings"; $this->formArray["propertyActualUse" . ($i + 1)] = $improvementsBuildingsActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $improvementsBuildings->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $improvementsBuildings->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $improvementsBuildings->getAssessedValue(); $totalMarketValue += toFloat($improvementsBuildings->getMarketValue()); $totalAssessedValue += toFloat($improvementsBuildings->getAssessedValue()); $i++; } } } if (count($machineriesList)) { foreach ($machineriesList as $key => $machineries) { if ($i < 4) { // kind $machineriesClasses = new MachineriesClasses(); if (is_numeric($machineries->getKind())) { $machineriesClasses->selectRecord($machineries->getKind()); $machineriesClassesDescription = $machineriesClasses->getDescription(); $machineriesClassesCode = $machineriesClasses->getCode(); } else { $machineriesClassesDescription = $machineries->getKind(); $machineriesClassesCode = $machineries->getActualUse(); } // actualUse $machineriesActualUses = new MachineriesActualUses(); if (is_numeric($machineries->getActualUse())) { $machineriesActualUses->selectRecord($machineries->getActualUse()); $machineriesActualUsesDescription = $machineriesActualUses->getDescription(); $machineriesActualUsesCode = $machineriesActualUses->getCode(); } else { $machineriesActualUsesDescription = $machineries->getActualUse(); $machineriesActualUsesCode = $machineries->getActualUse(); } $this->formArray["propertyKind" . ($i + 1)] = "Machineries"; $this->formArray["propertyActualUse" . ($i + 1)] = $machineriesActualUsesDescription; $this->formArray["propertyMarketValue" . ($i + 1)] = $machineries->getMarketValue(); $this->formArray["propertyAssessmentLevel" . ($i + 1)] = $machineries->getAssessmentLevel(); $this->formArray["propertyAssessedValue" . ($i + 1)] = $machineries->getAssessedValue(); $totalMarketValue += toFloat($machineries->getMarketValue()); $totalAssessedValue += toFloat($machineries->getAssessedValue()); $i++; } } } $this->formArray["totalMarketValue"] = $totalMarketValue; $this->formArray["totalAssessedValue"] = $totalAssessedValue; $this->formArray["totalAssessedValueInWords"] = makewords($totalAssessedValue); }
$pdf->Cell(75, 5, number_format($getDet[0], 2), '0', '1', 'R'); $iTotAmount = $iTotAmount + $getDet[0]; //totalamount $nc++; } } $getsib = @mysql_query("select * from ebpls_payment_details where or_no = '{$cn}' and payment_details != ''"); while ($GetSIB = @mysql_fetch_assoc($getsib)) { $pdf->Cell(70, 5, $GetSIB['payment_details'], '0', '0'); //desc $pdf->SetX(10); $pdf->Cell(75, 5, number_format($GetSIB['amount'], 2), '0', '1', 'R'); $iTotAmount = $iTotAmount + $GetSIB['amount']; //totalamount $nc++; } while ($nc < 11) { //spaces $pdf->Cell(75, 5, '', '0', '0'); $pdf->SetX(10); $pdf->Cell(75, 5, '', '0', '1', 'R'); $nc++; } $pdf->SetFont('Arial', 'B', 10); $pdf->Cell(75, 5, number_format($iTotAmount, 2), '0', '2', 'R'); // grand amount $pdf->SetFont('Arial', '', 10); $amt2words = makewords($iTotAmount); $pdf->MultiCell(75, 5, $amt2words, '0'); //amt in words $pdf->Output();
$getlgu = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", ""); $getlgu = FetchRow($dbtype, $getlgu); if ($cmd == 'CASHVIEW') { $cmd = 'CASH'; } elseif ($cmd == 'CHECKVIEW' || $cmd == 'CHECKSTATUS') { $cmd = 'CHECK'; } if ($cmd == 'CASH') { $getchek = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_or b,\n ebpls_transaction_payment_or_details c, ebpls_owner d", "'','','', b.total_amount_due,\n b.ts_create, b.payment_code,\n concat(d.owner_last_name,', ', d.owner_first_name,\n ' ', d.owner_middle_name), b.or_no", "where b.or_no=c.or_no and\n c.or_entry_type='{$cmd}' and c.trans_id={$owner_id} \n\t\t\tand d.owner_id = c.trans_id and c.payment_id={$business_id} \n\t\t\tand b.or_no='{$or_no}'"); } else { $getchek = SelectMultiTable($dbtype, $dbLink, "ebpls_transaction_payment_check a, \n\t\t\tebpls_transaction_payment_or b,\n ebpls_transaction_payment_or_details c, ebpls_owner d", "a.check_no, a.check_issue_date, a.check_name, a.check_amount,\n b.ts_create, b.payment_code,\n\t\t\tconcat(d.owner_last_name,', ', d.owner_first_name,\n\t\t\t' ', d.owner_middle_name), b.or_no", "where a.or_no=b.or_no and a.or_no=c.or_no and b.or_no=c.or_no and\n c.or_entry_type='{$cmd}' and c.trans_id={$owner_id} and \n\t\t\td.owner_id = c.trans_id \n and c.payment_id={$business_id} and a.or_no='{$or_no}'"); } $getit = FetchRow($dbtype, $getchek); $amt2words = makewords($getit[3]); if ($getit[3] == 0) { $amt2words = makewords($amtpay); $getit[3] = number_format($amtpay, 2); } //$pos1 = strpos($amt2words, " And "); $slen = strlen($amt2words); // - $pos1; $amt2words1 = substr($amt2words, 0, 42); $amt2words2 = substr($amt2words, 42); //get bus nature //bus name $getbn = mysql_query("select * from ebpls_business_enterprise where owner_id='{$owner_id}'\n\t\t\t\t\t\tand businesS_id='{$business_id}'"); $getbh = mysql_fetch_assoc($getbn); $busname = $getbh[business_name]; /*if ($paymde=='Per Line') { $getbus = SelectMultiTable($dbtype,$dbLink,"tempbusnature a ,ebpls_transaction_payment_or b,
function generateReceipts($taxType, $collectionArrayList, $headerReceiptID) { if (is_array($collectionArrayList)) { $i = 0; $j = 0; $this->receiptPageNumber = 1; foreach ($collectionArrayList as $collection) { $i++; $j++; if ($i <= 1) { switch ($taxType) { case "basic": $this->setvar("receiptType", "[ X ] BASIC TAX (" . $this->receiptPageNumber . ") [ ] SPECIAL EDUCATION FUND"); break; case "sef": $this->setvar("receiptType", "[ ] BASIC TAX [ X ] SPECIAL EDUCATION FUND (" . $this->receiptPageNumber . ")"); break; case "idle": $this->setvar("receiptType", "[ ] BASIC TAX [ ] SPECIAL EDUCATION FUND [ X ] IDLE TAX (" . $this->receiptPageNumber . ")"); break; } } $paymentID = $collection->getPaymentID(); $payment = $this->getPaymentDetails($paymentID); if (is_object($payment)) { $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); $this->setvar("ownerName" . $i, $this->tpl->get_var("receivedFrom")); 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); } $this->setvar("total", $this->totalAmountPaid, true); $this->setvar("amountPaid", $this->totalAmountPaid, true); $totalInWords = makewords($this->totalAmountPaid); if (strlen($totalInWords) < 62) { $this->setvar("y1TotalInWords", "235"); } else { $this->setvar("y1TotalInWords", "244"); } $this->setvar("totalInWords", $totalInWords); if ($i == 6 || $j == count($collectionArrayList)) { // new page $this->tpl->set_var("pageNumber", $this->pageNumber); $this->tpl->set_var("receiptPageNumber", $this->receiptPageNumber); $this->tpl->parse("ReceiptPageBlock", "ReceiptPage", true); $this->pageNumber++; $this->receiptPageNumber++; $this->clearLine(); $this->displayReceiptHeader($taxType, $headerReceiptID); $i = 0; } } } }