function Main() { $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(); $td = new TD(); $rptop->parseDomDocument($domDoc); 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_a($value, Assessor)) { $this->tpl->set_var("cityAssessorID", $value->getAssessorID()); $this->tpl->set_var("cityAssessorName", $value->getFullName()); $this->formArray["cityAssessorName"] = $value->getFullName(); } else { $this->tpl->set_var($key, ""); } break; case "cityTreasurer": if (is_a($value, Assessor)) { $this->tpl->set_var("cityTreasurerID", $value->getAssessorID()); $this->tpl->set_var("cityTreasurerName", $value->getFullName()); $this->formArray["cityTreasurerName"] = $value->getFullName(); } else { $this->tpl->set_var($key, ""); } break; case "tdArray": //$this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); //$this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $tdCtr = 0; //echo("count=".count($value)."<br>"); 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) { $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(), 2, ".", ""); $propertyType = $td->getPropertyType(); $afsID = $td->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $PropertyIndexNumber = $afs->getPropertyIndexNumber(); $idleStatus = $td->getIdleStatus(); $formAssessedValue = number_format($td->getAssessedValue(), 2); if ($propertyType == "Land") { $formValues['assessedValueLand'] = $formAssessedValue; $formValues['assessedValueOthers'] = ""; } else { $formValues['assessedValueLand'] = ""; $formValues['assessedValueOthers'] = $formAssessedValue; } $formValues['assessedValue'] = $formAssessedValue; $formValues['propertyType'] = $propertyType; $taxDue = new Dues($tvalue->getTdID(), $this->formArray['taxableYear']); $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->setIdleStatus($idleStatus); if ($taxDue->getIdleStatus()) { $taxDue->setIdle($assessedValue); } else { $taxDue->setIdle(0); } $taxDue->store(); $dueValues['basic'] = number_format($taxDue->getBasic(), 2); $dueValues['sef'] = number_format($taxDue->getSEF(), 2); $dueValues['total'] = number_format($taxDue->getBasic() + $taxDue->getSEF(), 2); $totalValues['totBasic'] += $taxDue->getBasic(); $totalValues['totSEF'] += $taxDue->getSEF(); $totalValues['totTotal'] += $taxDue->getBasic() + $taxDue->getSEF(); $totalValues['totAssessedValue'] += $assessedValue; $this->tpl->set_var($dueValues); $tdValues['assessedValue'] = number_format($assessedValue, 2); $tdValues['tdNumber'] = $tvalue->getTaxDeclarationNumber(); $tdValues['propertyIndexNumber'] = $PropertyIndexNumber; $this->tpl->set_var($tdValues); $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("TDListBlock", "TDList", true); $tdCtr++; } } else { $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; default: $this->formArray[$key] = $value; } } } } $this->setForm(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->setPageDetailPerms(); $totalValues['totBasic'] = number_format($totalValues['totBasic'], 2); $totalValues['totSEF'] = number_format($totalValues['totSEF'], 2); $totalValues['totTotal'] = number_format($totalValues['totTotal'], 2); $totalValues['totAssessedValue'] = number_format($totalValues['totAssessedValue'], 2); $this->tpl->set_var($totalValues); $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"); }
function setDetails() { global $sess; $this->tpl->set_var($_GET); $this->tpl->set_var($_POST); # set the RPTOP to get the owner's object and information # get it from POST if possible, otherwise from GET $rptopID = isset($_POST['rptopID']) ? $_POST['rptopID'] : $_GET['rptopID']; $rptop = new RPTOP(); $rptop->selectRecord($rptopID); $dateDue = $rptop->getTaxableYear() . "-01-01"; # must be a usable format $formValues['taxableYear'] = $rptop->getTaxableYear(); $formValues['rptopNum'] = $rptop->getRptopNumber(); # set the specific TD (although this is in the RPTOP), hard to search for it. # get the tdID from POST or GET to initialize the TD $tdID = isset($_POST['tdID']) ? $_POST['tdID'] : $_GET['tdID']; $td = new TD(); $td->selectRecord($tdID); $tdNum = $td->getTaxDeclarationNumber(); $formValues['tdNum'] = $tdNum; # we define the property from the TD $propertyType = $td->getPropertyType(); $propertyID = $td->getPropertyID(); switch ($propertyType) { case "Land": $property = new Land(); break; case "PlantsTrees": $property = new PlantsTrees(); break; case "ImprovementsBuildings": $property = new ImprovementsBuildings(); break; case "Machineries": $property = new Machineries(); break; default: echo "cannot be! {$propertyType}"; break; } if (is_object($property)) { $property->selectRecord($propertyID); $assessedValue = number_format($property->getAssessedValue(), 2, ".", ""); $formValues['assessedValue'] = number_format($property->getAssessedValue(), 2); } $formValues['propertyType'] = $propertyType; # set the owner's List # we define the owner from the RPTOP $this->tpl->set_block('step3', 'Owner', 'Owners'); $owner = $rptop->getOwner(); $personArray = $owner->getPersonArray(); if (is_array($personArray)) { foreach ($personArray as $person) { $ownerValues['ownerName'] = $person->getLastName() . ", " . $person->getFirstName() . " " . $person->getMiddleName(); $addressArray = $person->getAddressArray(); $address = $addressArray[0]; $ownerValues['ownerAddress'] = $address->getNumber() . " " . $address->getStreet() . "<br>" . $address->getBarangay() . ", " . $address->getMunicipalityCity() . "<br>" . $address->getProvince(); $this->tpl->set_var($ownerValues); $this->tpl->parse('Owners', 'Owner', 'true'); } } $companyArray = $owner->getCompanyArray(); if (is_array($companyArray)) { foreach ($companyArray as $company) { $ownerValues['ownerName'] = $company->getCompanyName(); $addressArray = $company->getAddressArray(); $address = $addressArray[0]; $ownerValues['ownerAddress'] = $address->getNumber() . " " . $address->getStreet() . "<br>" . $address->getBarangay() . ", " . $address->getMunicipalityCity() . "<br> " . $address->getProvince(); $this->tpl->set_var($ownerValues); $this->tpl->parse('Owners', 'Owner', 'true'); } } # tax dues are defined from TDNumber and taxableYear # compute for taxes $taxDue = new Dues(); if ($taxDue->create($tdNum, $dateDue) == false) { $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->setDueDate($dateDue); $taxDue->setUpdateDate(); } $paymentPeriod = "Annual"; if (isset($_POST['paymentPeriod'])) { $paymentPeriod = $_POST['paymentPeriod']; } switch ($paymentPeriod) { case 'Annual': $this->tpl->set_var("checkedAnnual", "checked"); break; case 'Q1': $this->tpl->set_var("checkedQ1", "checked"); break; case 'Q2': $this->tpl->set_var("checkedQ2", "checked"); break; case 'Q3': $this->tpl->set_var("checkedQ3", "checked"); break; case 'Q4': $this->tpl->set_var("checkedQ4", "checked"); break; default: break; } $this->tpl->set_var($formValues); ## Compute taxes and set the page values $basic = $taxDue->getBasic($paymentPeriod); $sef = $taxDue->getSEF($paymentPeriod); $interest = $taxDue->computePenalty($paymentPeriod); $taxValues['basic'] = number_format($basic, 2); $taxValues['sef'] = number_format($sef, 2); $taxValues['pd1185'] = number_format(0.0, 2); $taxValues['subTotal'] = number_format($basic + $sef, 2); $taxValues['periodTotal'] = number_format($basic + $sef, 2); $taxValues['discount'] = "0.0%"; $taxValues['interest'] = number_format($interest * 100.0, 1) . "%"; $taxValues['totBasic'] = number_format($basic * (1 + $interest), 2); $taxValues['totSEF'] = number_format($sef * (1 + $interest), 2); $taxValues['totPD1185'] = number_format(0, 2); $taxValues['totSubTotal'] = number_format(($basic + $sef) * (1 + $interest), 2); $taxValues['grandTotal'] = number_format(($basic + $sef) * (1 + $interest), 2); # further breakdown of basic tax for RPT Receipt $taxValues['gf'] = number_format($basic * 0.7, 2); // 70% of basic $taxValues['ib'] = number_format($basic * 0.15, 2); // 15% of basic $taxValues['cb'] = number_format($basic * 0.15, 2); // 15% of basic for a total if 100% $taxValues['totGF'] = number_format($basic * 0.7 * (1 + $interest), 2); $taxValues['totIB'] = number_format($basic * 0.15 * (1 + $interest), 2); $taxValues['totCB'] = number_format($basic * 0.15 * (1 + $interest), 2); $this->tpl->set_var($taxValues); if (!isset($_POST['printReceipt_x'])) { $this->tpl->set_var("Session", $sess->url("")); } }
function Main() { $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); 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_a($value, Assessor)) { $this->tpl->set_var("cityAssessorID", $value->getAssessorID()); $this->tpl->set_var("cityAssessorName", $value->getFullName()); $this->formArray["cityAssessorName"] = $value->getFullName(); } else { $this->tpl->set_var($key, ""); } break; case "cityTreasurer": if (is_a($value, Assessor)) { $this->tpl->set_var("cityTreasurerID", $value->getAssessorID()); $this->tpl->set_var("cityTreasurerName", $value->getFullName()); $this->formArray["cityTreasurerName"] = $value->getFullName(); } else { $this->tpl->set_var($key, ""); } break; case "tdArray": $this->tpl->set_block("rptsTemplate", "defaultTDList", "defaultTDListBlock"); $this->tpl->set_block("rptsTemplate", "toggleTDList", "toggleTDListBlock"); $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $tdCtr = 0; $totalBalance = 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) { $propertyType = $tvalue->getPropertyType(); $propertyID = $tvalue->getPropertyID(); switch ($propertyType) { case "Land": $land = new Land(); $land->selectRecord($propertyID); $assessedValue = $land->getAssessedValue(); $propertyIdentityNumber = $land->getPropertyIndexNumber(); break; case "PlantsTrees": $plantsTrees = new PlantsTrees(); $plantsTrees->selectRecord($propertyID); $assessedValue = $plantsTrees->getAssessedValue(); $PropertyIndexNumber = $plantsTrees->getPropertyIndexNumber(); break; case "ImprovementsBuildings": $improvementsBuildings = new ImprovementsBuildings(); $improvementsBuildings->selectRecord($propertyID); $assessedValue = $improvementsBuildings->getAssessedValue(); $PropertyIndexNumber = $improvementsBuildings->getPropertyIndexNumber(); break; case "Machineries": $machineries = new Machineries(); $machineries->selectRecord($propertyID); $assessedValue = $machineries->getAssessedValue(); $PropertyIndexNumber = $machineries->getPropertyIndexNumber(); break; default: break; } # set or get the due for this TD $taxDue = new Dues(); $taxDue->create($tvalue->getTaxDeclarationNumber(), "Jan 1, " . $rptop->getRptopdate()); $taxDue->setBasic($assessedValue); $taxDue->setSEF($assessedValue); $taxDue->store(); $dueValues['basic'] = number_format($taxDue->getBasic(), 2); $dueValues['penalty'] = number_format($taxDue->getPenalty(), 2); $dueValues['sef'] = number_format($taxDue->getSEF(), 2); $dueValues['total'] = number_format($taxDue->getBasic() + $taxDue->getSEF() + $taxDue->getPenalty(), 2); $this->tpl->set_var($dueValues); $paidValues['paidBasic'] = number_format($taxDue->getPaidBasic(), 2); $paidValues['paidPenalty'] = number_format($taxDue->getPaidPenalty(), 2); $paidValues['paidSEF'] = number_format($taxDue->getPaidSEF(), 2); $paidValues['paidTotal'] = number_format($taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF(), 2); $this->tpl->set_var($paidValues); $balance = $taxDue->getBasic() + $taxDue->getSEF() + $taxDue->getPenalty() - ($taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF()); $totalBalance += $balance; $this->tpl->set_var(balance, number_format($balance, 2)); $totalValues['totAssessedValue'] += $assessedValue; $totalValues['totBasic'] += $taxDue->getBasic(); $totalValues['totPenalty'] += $taxDue->getPenalty(); $totalValues['totSEF'] += $taxDue->getSEF(); $totalValues['totTotal'] += $taxDue->getBasic() + $taxDue->getPenalty() + $taxDue->getSEF(); $totalValues['totPaidBasic'] += $taxDue->getPaidBasic(); $totalValues['totPaidPenalty'] += $taxDue->getPaidPenalty(); $totalValues['totPaidSEF'] += $taxDue->getPaidSEF(); $totalValues['totPaidTotal'] += $taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF(); $tdValues['assessedValue'] = number_format($assessedValue, 2); $tdValues['tdNumber'] = $tvalue->getTaxDeclarationNumber(); $tdValues['propertyIndexNumber'] = $PropertyIndexNumber; $this->tpl->set_var($tdValues); $this->tpl->set_var("ctr", $tdCtr); $this->tpl->parse("TDListBlock", "TDList", true); $tdCtr++; } } else { $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("tdCtr", $tdCtr); break; default: $this->formArray[$key] = $value; } } } } $this->setForm(); $this->tpl->set_var(totBalance, number_format($totalBalance, 2)); $this->tpl->set_var(amountDue, number_format($totalValues['totTotal'] - $totalValues['totPaidTotal'], 2)); $totalValues['totAssessedValue'] = number_format($totalValues['totAssessedValue'], 2); $totalValues['totBasic'] = number_format($totalValues['totBasic'], 2); $totalValues['totPenalty'] = number_format($totalValues['totPenalty'], 2); $totalValues['totSEF'] = number_format($totalValues['totSEF'], 2); $totalValues['totTotal'] = number_format($totalValues['totTotal'], 2); $totPaidalValues['totPaidBasic'] = number_format($totPaidalValues['totPaidBasic'], 2); $totPaidalValues['totPaidPenalty'] = number_format($totPaidalValues['totPaidPenalty'], 2); $totPaidalValues['totPaidSEF'] = number_format($totPaidalValues['totPaidSEF'], 2); $totPaidalValues['totPaidTotal'] = number_format($totPaidalValues['totPaidTotal'], 2); $this->tpl->set_var($totalValues); $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"); }
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"); $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("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("basicTax",$tvalue->getBasicTax()); //$this->tpl->set_var("sefTax",$tvalue->getSefTax()); //$this->tpl->set_var("total",$tvalue->getTotal()); $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object"); if (!($xmlStr = $AFSDetails->getAFSForList($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); $this->formArray["propertyIndexNumber"] = $afs->getPropertyIndexNumber(); $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, '.', ',')); // get BASIC and SEF $taxesDue = new Dues($tvalue->getTdID(), $rptop->getTaxableYear(), $afs->getTotalAssessedValue()); $basicTax = number_format($taxesDue->getBasic(), 2); $sefTax = number_format($taxesDue->getSEF(), 2); $total = number_format($taxesDue->getBasic() + $taxesDue->getSEF(), 2); $this->tpl->set_var("basicTax", $basicTax); $this->tpl->set_var("sefTax", $sefTax); $this->tpl->set_var("total", $total); } } $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("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; } } $this->setForm(); $this->setPageDetailPerms(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $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"); }
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(); } } #test values //$this->formArray['ownerID']=5; #echo("ownerID=".$this->formArray['ownerID']."<br>"); // $this->displayOwnerList($this->formArray['ownerID']); #test values //$this->formArray["rptopID"]=15; 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]; $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['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); } /*$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]; $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['personID']; $db->query($sql);*/ $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(); // $this->tpl->set_var(kind,$propertyType); // $this->tpl->set_var(currentTDNo,$TaxDeclarationNumber); /* $dues = new Dues(); $dues->create($td->getTdID(), "","","","2003"); $this->tpl->set_var(basic,$dues->getBasic()); $totBasic += $dues->getBasic(); $this->tpl->set_var(sef,$dues->getSEF()); $totSEF += $dues->getSEF(); $this->tpl->set_var(total,$dues->getSEF()+$dues->getBasic()); $totTaxDue += $dues->getSEF()+$dues->getBasic();*/ $afsID = $td->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $od = new OD(); $od->selectRecord($afs->getOdID()); $addr = $od->getLocationAddress(); if (count($addr)) { $location = $addr->getFullAddress(); // $this->tpl->set_var(location,$addr->getFullAddress()); $munCityID = $addr->getMunicipalityCityID(); // if($munCityID == $this->formArray['municipalityCityID']) // $this->tpl->set_var(municipality,$addr->getMunicipalityCity()); } if (count($afs->landArray)) { foreach ($afs->landArray as $afsKey => $afsValue) { $actualUse = $afsValue->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); //$this->tpl->set_var("class",$landActualUses->getCode()); $Code = $landActualUses->getCode(); } } if (count($afs->improvementsBuildingsArray)) { foreach ($afs->improvementsBuildingsArray as $afsKey => $afsValue) { $actualUse = $afsValue->getActualUse(); $improvementsBuildingsActualUses = new improvementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); //$this->tpl->set_var("class",$improvementsBuildingsActualUses->getCode()); $Code = $improvementsBuildingsActualUses->getCode(); } } //echo $afs->get // echo $munCityID ."==". $this->formArray['municipalityCityID']."<br>"; if ($munCityID == $this->formArray['municipalityCityID']) { $this->tpl->set_var(location, $location); $this->tpl->set_var("class", $Code); $this->tpl->set_var(kind, $propertyType); $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(); $basic = number_format($dues->getBasic(), "2", ".", ""); $this->tpl->set_var(basic, $basic); $totBasic += $basic; $sef = number_format($dues->getSEF(), "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"; } $this->tpl->set_var(pin, $pIndexNo); //echo $afs->getTotalMarketValue(); /* if(count($afs->landArray)){ foreach($afs->landArray as $afsKey => $afsValue){ $this->tpl->set_var(pin,$afsValue->getPropertyIndexNumber()); } } */ $this->tpl->parse("RowBlk", "ROW", true); } //else{ // $this->tpl->set_var("RowBlk",""); // } } #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($totTaxDue, 2)); } } } // $this->tpl->parse("RowBlk","ROW",true); } } // $owner /* $RPTOPDetails = new SoapObject(NCCBIZ."RPTOPDetails.php", "urn:Object"); if (!$xmlStr = $RPTOPDetails->getRPTOP($this->formArray["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); $status_report = ""; foreach($rptop as $key => $value){ $this->formArray['payableYear'] = $rptop->getTaxableYear(); $rptopID = $rptop->getRptopID(); if($key=="tdArray"){ $tdCtr = 0; if (count($value)){ $this->tpl->set_block("rptsTemplate","ROW","RowBlk"); foreach($value as $tkey => $tvalue){ $td->selectRecord($tvalue->getTdID()); $assessedValue = number_format($td->getAssessedValue(),2,".",""); $propertyType = $td->getPropertyType(); $TaxDeclarationNumber = $td->getTaxDeclarationNumber(); //$tdCtr++; $this->tpl->set_var(kind,$propertyType); $this->tpl->set_var(currentTDNo,$TaxDeclarationNumber); /* $dues = new Dues(); $dues->create($td->getTdID(), "","","","2003"); $this->tpl->set_var(basic,$dues->getBasic()); $totBasic += $dues->getBasic(); $this->tpl->set_var(sef,$dues->getSEF()); $totSEF += $dues->getSEF(); $this->tpl->set_var(total,$dues->getSEF()+$dues->getBasic()); $totTaxDue += $dues->getSEF()+$dues->getBasic();*/ /* $afsID = $td->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $od = new OD(); $od->selectRecord($afs->getOdID()); $addr = $od->getLocationAddress(); if(count($addr)){ $this->tpl->set_var(location,$addr->getFullAddress()); $munCityID = $addr->getMunicipalityCityID(); if($munCityID == $this->formArray['municipalityCityID']) $this->tpl->set_var(municipality,$addr->getMunicipalityCity()); } if(count($afs->landArray)){ foreach($afs->landArray as $afsKey => $afsValue){ $actualUse = $afsValue->getActualUse(); $landActualUses = new LandActualUses(); $landActualUses->selectRecord($actualUse); $this->tpl->set_var("class",$landActualUses->getCode()); } } if(count($afs->improvementsBuildingsArray)){ foreach($afs->improvementsBuildingsArray as $afsKey => $afsValue){ $actualUse = $afsValue->getActualUse(); $improvementsBuildingsActualUses = new improvementsBuildingsActualUses(); $improvementsBuildingsActualUses->selectRecord($actualUse); $this->tpl->set_var("class",$improvementsBuildingsActualUses->getCode()); } } //echo $afs->get if($munCityID == $this->formArray['municipalityCityID']){ $dues = new Dues(); $dues->create($td->getTdID(), "","","","2003"); $this->tpl->set_var(basic,number_format($dues->getBasic(),"2",".","")); $totBasic += $dues->getBasic(); $this->tpl->set_var(sef,number_format($dues->getSEF(),"2",".","")); $totSEF += $dues->getSEF(); $this->tpl->set_var(total,number_format($dues->getSEF()+$dues->getBasic(),"2",".","")); $pIndexNo = $afs->getPropertyIndexNumber(); if($pIndexNo==""){ $pIndexNo = "No value specified"; } $this->tpl->set_var(pin,$pIndexNo); $this->tpl->set_var(marketValue,$afs->getTotalMarketValue()); $totMarketValue += $afs->getTotalMarketValue(); $this->tpl->set_var(assessedValue,$afs->getTotalAssessedValue()); $totAssessedValue += $afs->getTotalAssessedValue(); //echo $afs->getTotalMarketValue(); /* if(count($afs->landArray)){ foreach($afs->landArray as $afsKey => $afsValue){ $this->tpl->set_var(pin,$afsValue->getPropertyIndexNumber()); } } */ /* $this->tpl->parse("RowBlk","ROW",true); }else{ $this->tpl->set_var("RowBlk",""); } }#end foreach($value) }#end if coun value // $this->tpl->set_block("rptsTemplate","STAT",sBlk); // $this->tpl->set_var(status_report,$status_report); // $this->tpl->parse(sBlk,"STAT",true); $this->tpl->set_var(totalMarketValue,$totMarketValue); $this->tpl->set_var(totalAssessedValue,$totAssessedValue); $this->tpl->set_var(totalBasic,$totBasic); $this->tpl->set_var(totalSEF,$totSEF); $this->tpl->set_var(totalTaxDue,$totTaxDue); } } } }*/ $this->setForm(); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); }
function Main() { global $sess; $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); 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 "taxableYear": $this->tpl->set_var("taxableYear", $value); $dueDate = $value; break; case "tdArray": $this->tpl->set_block("rptsTemplate", "TDList", "TDListBlock"); $this->tpl->set_block("rptsTemplate", "JSTDList", "JSTDListBlock"); $this->tpl->set_block("rptsTemplate", "BacktaxTDTable", "BacktaxTDTableBlock"); $this->unpaidTDCount = 0; if (count($value)) { $this->tpl->set_block("rptsTemplate", "TDDBEmpty", "TDDBEmptyBlock"); $this->tpl->set_var("TDDBEmptyBlock", ""); foreach ($value as $tkey => $tvalue) { $propertyType = $tvalue->getPropertyType(); $propertyID = $tvalue->getPropertyID(); $afsID = $tvalue->getAfsID(); $afs = new AFS(); $afs->selectRecord($afsID); $listValues['propertyIndexNumber'] = $afs->getPropertyIndexNumber(); $assessedValue = $tvalue->getAssessedValue(); #echo("assessedValue=$assessedValue<br7>"); $listValues['taxBeginsWithTheYear'] = $tvalue->getTaxBeginsWithTheYear(); $listValues['tdNum'] = $tvalue->getTaxDeclarationNumber(); $tdID = $tvalue->getTdID(); $listValues['tdID'] = $tdID; #echo("tdID=$tdID, dueDate=$dueDate<br>"); $dues = new Dues($tdID, $dueDate); if (!$dues->create($tdID, $dueDate, $assessedValue)) { $dues->setBasic($assessedValue); $dues->setSEF($assessedValue); # check if land is idle, if yes, set assessed value # getIdleStatus -- temporary function if ($dues->getIdleStatus() == 1) { #echo("idle<br>"); $dues->setIdle($assessedValue); } } // Refresh for amnesty and paymentPeriod if ($this->formArray["formAction"] == "refresh") { $amnesty = $this->formArray[amnesty]; $dues->setAmnesty($amnesty); $paymentPeriod = $this->formArray[paymentPeriod]; $dues->setPaymentMode($paymentPeriod); } if ($dues->getAmnesty() == "Yes") { $dues->resetPenalty(); $dues->computePenalty($paymentPeriod, "now"); } $paymentPeriod = $dues->getPaymentMode(); $amnesty = $dues->getAmnesty(); $dues->store(); switch ($paymentPeriod) { case 'Quarter': $this->tpl->set_var("selectedQuarter", "selected"); $this->tpl->set_var("paymentPeriod", $paymentPeriod); $this->tpl->set_var("installmentNumber", ceil(date("n") / 3)); $this->tpl->set_var("netDueFullAmount", number_format($dues->getTotalDue("Annual"), 2)); break; default: #Annual $this->tpl->set_block("rptsTemplate", "QuarterNetDue", "QuarterNetDueBlock"); $this->tpl->set_var("QuarterNetDueBlock", ""); $this->tpl->set_var("selectedAnnual", "selected"); $this->tpl->set_var("paymentPeriod", $paymentPeriod); break; } //$totalDue = $dues->getTotalDue($paymentPeriod); $totalDue = $dues->getTotalDue($paymentPeriod); $basic = $dues->getBasic($paymentPeriod); $sef = $dues->getSEF($paymentPeriod); $penalty = $dues->getPenalty($paymentPeriod); $discount = $dues->getDiscount(); $totalPaid = $dues->getPaidBasic($paymentPeriod) + $dues->getPaidPenalty($paymentPeriod) + $dues->getPaidSEF($paymentPeriod); $listValues['taxDue'] = $totalDue; $listValues['basic'] = number_format($basic, 2); $listValues['sef'] = number_format($sef, 2); $listValues['penalty'] = number_format($penalty, 2); $listValues['discount'] = number_format($discount, 2); $listValues['totalPaid'] = number_format($totalPaid, 2); $listValues['strTaxDue'] = number_format($totalDue, 2); //$basic = $dues->getBasic($paymentPeriod); #echo("basic=$basic<br>"); //$sef = $dues->getSEF($paymentPeriod); #echo("sef=$sef<br>"); if (!$this->isPriorTDPaid($tdID)) { $backtaxes = true; $paidStatus = "<input type=\"checkbox\" name=\"tdID[" . $tdID . "]\" value=\"" . $tdID . "\" onclick=\"javascript: toggle(this, '" . $tdID . "'); updateTotalTaxDue(this," . $tdID . ");\" disabled>"; } else { $backtaxes = false; $paidStatus = $totalDue <= 0 ? $basic <= 0 ? "N.A." : "PAID" : "<input type=\"checkbox\" name=\"tdID[" . $tdID . "]\" value=\"" . $tdID . "\" onclick=\"javascript: toggle(this, '" . $tdID . "'); updateTotalTaxDue(this," . $tdID . ");\">"; } $listValues['paidStatus'] = $paidStatus; $listValues['tdBgcolor'] = '#f6f6f6'; $this->tpl->set_var($listValues); $this->tpl->parse("TDListBlock", "TDList", true); if ($backtaxes) { $oldestUnpaidTD = $this->unpaidTDArray[count($this->unpaidTDArray) - 1]; $this->displayBacktaxTD($oldestUnpaidTD->getTdID()); $this->displayPriorTDs($tdID); unset($this->unpaidTDArray); } else { $this->displayBacktaxTD($tdID); $this->tpl->set_var("JSTDListBlock", ""); } //$this->tpl->parse("BacktaxTDTableBlock", "BacktaxTDTable", true); } } else { $this->tpl->set_block("rptsTemplate", "CheckAll", "CheckAllBlock"); $this->tpl->set_var("CheckAllBlock", ""); $this->tpl->set_var("TDListBlock", ""); } $this->tpl->set_var("rptopID", $rptopID); break; default: $this->formArray[$key] = $value; } } } } $this->setForm(); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->setPageDetailPerms(); $this->tpl->set_var(amnestyChecked, $amnesty == "Yes" ? " checked" : ""); $this->tpl->set_var("Session", $sess->url("") . $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"); }