Exemple #1
0
 function generateTDHistory($tdID)
 {
     $td = new TD();
     $td->selectRecord($tdID);
     $afsID = $td->getAfsID();
     //		echo("afsID=$afsID<br>");
     $afs = new AFS();
     $afs->selectRecord($afsID);
     $odID = $afs->getOdID();
     //	echo("odID=$odID<br>");
     $condition = sprintf(" WHERE presentODID='%s' ", fixQuotes($odID));
     $odHistoryRecords = new ODHistoryRecords();
     $odHistoryRecords->selectRecords($condition);
     if (count($odHistoryRecords->arrayList) > 0) {
         //	echo("count>0<br>");
         foreach ($odHistoryRecords->arrayList as $key => $odHistory) {
             $previousODID = $odHistory->getPreviousODID();
             $presentODID = $odHistory->getPresentODID();
             $previousAFS = new AFS();
             $previousAFS->selectRecord($afsID = "", $limit = "", $previousODID);
             $previousAFSID = $previousAFS->getAfsID();
             $previousTD = new TD();
             $previousTD->selectRecord($tdID = "", $previousAFSID);
             $previousTDID = $previousTD->getTdID();
             $this->tdHistory[] = $previousTD;
             $this->generateTDHistory($previousTDID);
         }
     } else {
         //echo("count==0<br>");
         return false;
     }
 }
Exemple #2
0
 function Main()
 {
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->formArray["mergeBasketArray"] = explode(",", $this->formArray["mergeBasketCSV"]);
     if (is_array($this->formArray["mergeBasketArray"])) {
         $this->tpl->set_block("rptsTemplate", "NoODList", "NoODListBlock");
         $this->tpl->set_var("NoODListBlock", "");
         $this->tpl->set_block("rptsTemplate", "ODList", "ODListBlock");
         $this->tpl->set_var("totalInMergeBasket", count($this->formArray["mergeBasketArray"]));
         foreach ($this->formArray["mergeBasketArray"] as $odID) {
             $od = new OD();
             $od->selectRecord($odID);
             $owner = $od->owner;
             $ownerStr = "";
             if (is_array($owner->personArray)) {
                 foreach ($owner->personArray as $pKey => $pValue) {
                     $ownerArray[] = $pValue->getFullName();
                 }
             }
             if (is_array($owner->companyArray)) {
                 foreach ($owner->companyArray as $cKey => $cValue) {
                     $ownerArray[] = $cValue->getCompanyName();
                 }
             }
             if (is_object($od->locationAddress)) {
                 $this->tpl->set_var("locationAddress", $od->locationAddress->getFullAddress());
             } else {
                 $this->tpl->set_var("locationAddress", "");
             }
             $this->tpl->set_var("landArea", number_format($od->getLandArea(), 2, '.', ','));
             $this->tpl->set_var("odID", $od->getOdID());
             if (is_array($ownerArray)) {
                 $this->tpl->set_var("ownerName", implode(",", $ownerArray));
             } else {
                 $this->tpl->set_var("ownerName", "");
             }
             $afs = new AFS();
             $afs->selectRecord("", "", $odID, "");
             if (is_object($afs)) {
                 if ($afs->getPropertyIndexNumber() != "") {
                     $propertyIndexNumber = $afs->getPropertyIndexNumber();
                 } else {
                     $propertyIndexNumber = "";
                 }
             }
             $this->tpl->set_var("propertyIndexNumber", $propertyIndexNumber);
             $this->tpl->parse("ODListBlock", "ODList", true);
             unset($ownerArray);
         }
     } else {
         $this->tpl->set_block("rptsTemplate", "ShowODList", "ShowODListBlock");
         $this->tpl->set_var("ShowODListBlock", "");
         $this->tpl->set_var("totalInMergeBasket", 0);
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemple #3
0
 function getAFS($afsID)
 {
     $afs = new AFS();
     $afs->selectRecord($afsID);
     if (!($domDoc = $afs->getDomDocument())) {
         return false;
     } else {
         $xmlStr = $domDoc->dump_mem(true);
         return $xmlStr;
     }
 }
Exemple #4
0
 function getOdIDFromTdID($tdID)
 {
     $ret = false;
     $td = new TD();
     if ($td->selectRecord($tdID)) {
         $afsID = $td->getAfsID();
         if ($afs = new AFS()) {
             $afs->selectRecord($afsID);
             $odID = $afs->getOdID();
             $ret = $odID;
         }
     }
     return $ret;
 }
 function getAFSDetails($odID)
 {
     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
     $this->formArray["afsID"] = $AFSEncode->getAFSID($odID);
     if ($this->formArray["afsID"]) {
         $afs = new AFS();
         if ($afs->selectRecord($this->formArray["afsID"])) {
             return $afs;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Exemple #6
0
 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");
 }
Exemple #7
0
 function RunGeneralRevision($odID, $userID = "", $transactionCode = "GR")
 {
     $newOdID = $this->CreateNewRPU_AFS_TD($odID, $userID, $transactionCode);
     // archive old OD
     $oldOD = new OD();
     $oldOD->selectRecord($odID);
     $oldOD->archive = "true";
     $oldOD->modifiedBy = $userID;
     $oldOD->updateRecord();
     // using archiveRecord 'might' be faster
     //$oldOD->archiveRecord($odID,"true",$userID);
     // update new OD/AFS
     $newAFS = new AFS();
     $newAFS->selectRecord($afsID = "", $limit = "", $newOdID);
     $newAFS->modifiedBy = $userID;
     $newAFS->effectivity = date("Y") + 1;
     $newAFS->updateRecord();
     return $newOdID;
 }
Exemple #8
0
    echo "{$key} = {$value}<br>\n";
}
echo "TD2 values<br>\n";
foreach ($td2 as $key => $value) {
    echo "{$key} = {$value}<br>\n";
}
$propertyType = $td1->propertyType;
$property1 = new Land();
$property1->selectRecord($td1->propertyID);
echo "property1 values<br>\n";
foreach ($property1 as $key => $value) {
    echo "{$key} = {$value}<br>\n";
}
$afsID = $property1->getAfsID();
$afs = new AFS();
$afs->selectRecord($afsID);
echo "AFS values<br>\n";
foreach ($afs as $key => $value) {
    echo "{$key} = {$value}<br>\n";
}
$tdNum = $td1->getTaxDeclarationNumber();
$taxDue = new Dues();
$taxDue->create($tdNum, "2002-01-01");
echo "taxDue values<br>\n";
foreach ($taxDue as $key => $value) {
    echo "{$key} = {$value}<br>\n";
}
$dueDate = $taxDue->getDueDate();
$dueTime = strtotime($dueDate);
echo "TaxDue date {$dueDate} and time {$dueTime} <br>\n";
echo "End test <br>\n";
 function getTDArrayFromCompany($companyID)
 {
     $this->setDB();
     $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerCompany " . " WHERE " . " Owner.ownerID = OwnerCompany.ownerID AND " . " OwnerCompany.companyID = '%s' ", $companyID);
     $this->db->query($sql);
     while ($this->db->next_record()) {
         $od = new OD();
         if ($od->selectRecord($this->db->f("odID"))) {
             $this->ODArray[] = $od;
             $afs = new AFS();
             if ($afs->selectRecord("", "", $od->getOdID(), "")) {
                 $td = new TD();
                 if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) {
                     $tdArray[] = $td;
                 }
             }
         }
     }
     if (!is_array($tdArray)) {
         $tdArray = false;
     }
     return $tdArray;
 }
Exemple #10
0
 function getTDIDArrayFromParentTDID($presentTDID)
 {
     $presentTD = new TD();
     $presentTD->selectRecord($presentTDID);
     $presentAfsID = $presentTD->getAfsID();
     $presentAFS = new AFS();
     $presentAFS->selectRecord($presentAFSID);
     $presentODID = $presentAFS->getOdID();
     $odHistoryRecords = new ODHistoryRecords();
     $odHistoryRecords->selectPrecOD($presentODID);
     if (is_array($odHistoryRecords->arrayList)) {
         foreach ($odHistoryRecords as $odID) {
             $afs = new AFS();
             $afs->selectRecord("", "", $odID);
             $afsID = $afs->getAfsID();
             $td = new TD();
             $td->selectRecord("", $afsID);
             $tdID = $td->getTdID();
             $tdIDArray[] = $tdID;
         }
         if (is_array($tdIDArray)) {
             return $tdIDArray;
         }
     }
     return false;
 }
Exemple #11
0
 function searchRecords($searchKey, $fields, $limit = "")
 {
     $condition = "where (";
     foreach ($fields as $key => $value) {
         if ($key == 0) {
             $condition = $condition . $value . " like '%" . $searchKey . "%'";
         } else {
             $condition = $condition . " or " . $value . " like '%" . $searchKey . "%' ";
         }
     }
     // figure out $sql FOR AFS;
     // $sql for OD
     $sql = "SELECT " . LOCATION_TABLE . ".odID as odID\r\n                  FROM " . LOCATION_TABLE . "\r\n                  LEFT JOIN " . LOCATIONADDRESS_TABLE . "\r\n                  ON " . LOCATION_TABLE . ".locationAddressID=" . LOCATIONADDRESS_TABLE . ".locationAddressID\r\n                  LEFT JOIN " . BARANGAY_TABLE . "\r\n                  ON " . BARANGAY_TABLE . ".barangayID=" . LOCATIONADDRESS_TABLE . ".barangayID ";
     $sql = $sql . $condition . ") " . $limit;
     $this->setDB();
     $this->db->query($sql);
     while ($this->db->next_record()) {
         $afs = new AFS();
         $afs->selectRecord($this->db->f("afsID"));
         $this->arrayList[] = $od;
     }
     if (count($this->arrayList) > 0) {
         $this->setDomDocument();
         return true;
     } else {
         return false;
     }
 }
 function displayPostingSummary($afs)
 {
     // previous
     $presentODID = $afs->odID;
     $condition = sprintf("WHERE presentODID='%s'", fixQuotes($presentODID));
     $odHistoryRecords = new ODHistoryRecords();
     if ($odHistoryRecords->selectRecords($condition)) {
         $odHistory = $odHistoryRecords->arrayList[0];
         $previousODID = $odHistory->previousODID;
         $previousAFS = new AFS();
         if ($previousAFS->selectRecord("", "", $previousODID, "")) {
             $this->formArray["previous1"] = $previousAFS->propertyIndexNumber;
             $this->formArray["previous2"] = $previousAFS->arpNumber;
             $this->formArray["prevPIN"] = $previousAFS->propertyIndexNumber;
             $this->formArray["prevTD"] = $previousAFS->arpNumber;
         }
     }
     // present
     $this->formArray["present1"] = $afs->propertyIndexNumber;
     $this->formArray["present2"] = $afs->arpNumber;
     $this->formArray["presPIN"] = $afs->propertyIndexNumber;
     $this->formArray["presTD"] = $afs->arpNumber;
 }
Exemple #13
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "remove":
             if (count($this->formArray["landID"])) {
                 //print_r($this->formArray["landID"]);
                 $LandList = new SoapObject(NCCBIZ . "LandList.php", "urn:Object");
                 if (!($deletedRows = $LandList->removeLand($this->formArray["landID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["plantsTreesID"])) {
                 //print_r($this->formArray["plantsTreesID"]);
                 $PlantsTreesList = new SoapObject(NCCBIZ . "PlantsTreesList.php", "urn:Object");
                 if (!($deletedRows = $PlantsTreesList->removePlantsTrees($this->formArray["plantsTreesID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["machineriesID"])) {
                 //print_r($this->formArray["machineriesID"]);
                 $MachineriesList = new SoapObject(NCCBIZ . "MachineriesList.php", "urn:Object");
                 if (!($deletedRows = $MachineriesList->removeMachineries($this->formArray["machineriesID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["improvementsBuildingsID"])) {
                 //print_r($this->formArray["improvementsBuildingsID"]);
                 $ImprovementsBuildingsList = new SoapObject(NCCBIZ . "ImprovementsBuildingsList.php", "urn:Object");
                 if (!($deletedRows = $ImprovementsBuildingsList->removeImprovementsBuildings($this->formArray["improvementsBuildingsID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             if (count($this->formArray["storeyID"])) {
                 //print_r($this->formArray["storeyID"]);
                 $StoreyList = new SoapObject(NCCBIZ . "StoreyList.php", "urn:Object");
                 if (!($deletedRows = $StoreyList->removeStorey($this->formArray["storeyID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             header("location: AFSDetails.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
     if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
         $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);
             //print_r($afs);
             foreach ($afs as $key => $value) {
                 $this->formArray[$key] = $value;
                 $this->formArray["totalMarketValue"] = 0;
                 $this->formArray["totalAssessedValue"] = 0;
             }
             // RPU Identification Numbers
             $this->displayRPUIdentification($afs);
             $landList = $afs->getLandArray();
             $plantsTreesList = $afs->getPlantsTreesArray();
             $improvementsBuildingsList = $afs->getImprovementsBuildingsArray();
             $machineriesList = $afs->getMachineriesArray();
             if (count($landList)) {
                 $hideTD = false;
                 $this->formArray["propertyType"] = "Land";
                 $this->displayLandPlantsTrees($landList, $plantsTreesList);
                 $this->hideProperty('ImprovementsBuildings', 'improvementsBuildings');
                 $this->hideProperty('Machineries', 'machineries');
             } else {
                 if (count($plantsTreesList)) {
                     $hideTD = false;
                     $this->formArray["propertyType"] = "Land";
                     $this->displayLandPlantsTrees($landList, $plantsTreesList);
                     $this->hideProperty('ImprovementsBuildings', 'improvementsBuildings');
                     $this->hideProperty('Machineries', 'machineries');
                 } else {
                     if (count($improvementsBuildingsList)) {
                         $hideTD = false;
                         $this->formArray["propertyType"] = "ImprovementsBuildings";
                         $this->displayImprovementsBuildings($improvementsBuildingsList);
                         $this->hideProperty('Land', 'land');
                         $this->hideProperty('PlantsTrees', 'plantsTrees');
                         $this->hideProperty('Machineries', 'machineries');
                     } else {
                         if (count($machineriesList)) {
                             $hideTD = false;
                             $this->formArray["propertyType"] = "Machineries";
                             $this->displayMachineries($machineriesList);
                             $this->hideProperty('Land', 'land');
                             $this->hideProperty('PlantsTrees', 'plantsTrees');
                             $this->hideProperty('ImprovementsBuildings', 'improvementsBuildings');
                         } else {
                             $hideTD = true;
                             $this->displayLandPlantsTrees($landList, $plantsTreesList);
                             $this->displayImprovementsBuildingsMachineries($improvementsBuildingsList, $machineriesList);
                             $this->formArray["landTotalMarketValue"] = 0;
                             $this->formArray["landTotalAssessedValue"] = 0;
                             $this->formArray["plantTotalMarketValue"] = 0;
                             $this->formArray["plantTotalAssessedValue"] = 0;
                             $this->formArray["bldgTotalMarketValue"] = 0;
                             $this->formArray["bldgTotalAssessedValue"] = 0;
                             $this->formArray["machTotalMarketValue"] = 0;
                             $this->formArray["machTotalAssessedValue"] = 0;
                         }
                     }
                 }
             }
             if ($hideTD == false) {
                 // Display TD
                 $this->displayTD($afs->afsID);
             } else {
                 // Hide TD
                 $this->tpl->set_block("rptsTemplate", "DeclarationOfProperty", "DeclarationOfPropertyBlock");
                 $this->tpl->set_var("DeclarationOfPropertyBlock", "");
             }
             $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
             if (!($xmlStr = $ODDetails->getOD($this->formArray["odID"]))) {
                 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 {
                     $od = new OD();
                     $od->parseDomDocument($domDoc);
                     foreach ($od as $key => $value) {
                         if ($key == "locationAddress" && is_object($value)) {
                             foreach ($value as $lkey => $lvalue) {
                                 $this->formArray[$lkey] = $lvalue;
                             }
                         } else {
                             $this->formArray[$key] = $value;
                         }
                     }
                     $ODEncode = new SoapObject(NCCBIZ . "ODEncode.php", "urn:Object");
                     $this->formArray["ownerID"] = $ODEncode->getOwnerID($this->formArray["odID"]);
                     $OwnerList = new SoapObject(NCCBIZ . "OwnerList.php", "urn:Object");
                     if (!($xmlStr = $OwnerList->getOwnerList($this->formArray["ownerID"]))) {
                         //exit(print_r($OwnerList));
                         $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);
                         }
                     }
                 }
             }
         }
     }
     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
     $afs = new AFS();
     $afs->selectRecord($this->formArray["afsID"]);
     $afs->setAfsID($this->formArray["afsID"]);
     $afs->setLandTotalMarketValue($this->formArray["landTotalMarketValue"]);
     $afs->setLandTotalAssessedValue($this->formArray["landTotalAssessedValue"]);
     $afs->setPlantTotalMarketValue($this->formArray["plantTotalMarketValue"]);
     $afs->setPlantTotalPlantAssessedValue($this->formArray["plantTotalAssessedValue"]);
     $afs->setBldgTotalMarketValue($this->formArray["bldgTotalMarketValue"]);
     $afs->setBldgTotalAssessedValue($this->formArray["bldgTotalAssessedValue"]);
     $afs->setMachTotalMarketValue($this->formArray["machTotalMarketValue"]);
     $afs->setMachTotalAssessedValue($this->formArray["machTotalAssessedValue"]);
     $afs->setTotalMarketValue($this->formArray["totalMarketValue"]);
     $afs->setTotalAssessedValue($this->formArray["totalAssessedValue"]);
     $afs->setDomDocument();
     $doc = $afs->getDomDocument();
     $xmlStr = $doc->dump_mem(true);
     //print_r($AFSEncode);
     //echo $xmlStr;
     if (!($ret = $AFSEncode->updateAFS($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("afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
Exemple #14
0
 function Main()
 {
     $this->formArray['currentDate'] = date("F d, Y");
     $MunicipalityCityDetails = new SoapObject(NCCBIZ . "MunicipalityCityDetails.php", "urn:Object");
     #test values
     //$this->formArray['municipalityCityID']=1;
     if (!($xmlStr = $MunicipalityCityDetails->getMunicipalityCityDetails($this->formArray['municipalityCityID']))) {
         #echo($xmlStr);
         exit("xml failed for municipality");
         //header("Location: ".$this->sess->url("ViewSOA.php")."&status=2");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             echo "error xmlDoc";
         } else {
             $MunicipalityCity = new MunicipalityCity();
             $MunicipalityCity->parseDomDocument($domDoc);
             $this->formArray['municipality'] = $MunicipalityCity->getDescription();
         }
     }
     if ($this->formArray['personID'] != "") {
         $person = new Person();
         $person->selectRecord($this->formArray['personID']);
         $this->tpl->set_var(ownerName, $person->getFullName());
         $this->tpl->set_var(ownerNo, $person->getTin());
         $address = $person->addressArray[0];
         if (is_object($address)) {
             $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         } else {
             $this->tpl->set_var(ownerAddress, "");
         }
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['personID'];
         $db->query($sql);
     } else {
         $company = new Company();
         $company->selectRecord($this->formArray['companyID']);
         $this->tpl->set_var(ownerName, $company->getCompanyName());
         $this->tpl->set_var(ownerNo, $company->getCompanyID());
         $address = $company->addressArray[0];
         $this->tpl->set_var(ownerAddress, $address->getNumber() . " " . $address->getStreet() . " " . $address->getBarangay() . " " . $address->getDistrict() . " " . $address->getMunicipalitycity() . " " . $address->getProvince());
         $db = new DB_RPTS();
         $sql = "SELECT rptopID FROM Owner inner join OwnerPerson on Owner.ownerID=OwnerPerson.ownerID WHERE Owner.rptopID <> '' AND OwnerPerson.personID=" . $this->formArray['companyID'];
         $db->query($sql);
     }
     $ypos = 325;
     $this->tpl->set_block("rptsTemplate", "ROW", "RowBlk");
     for ($i = 0; $db->next_record(); $i++) {
         $rptopID = $db->f("rptopID");
         $RPTOPDetails = new SoapObject(NCCBIZ . "RPTOPDetails.php", "urn:Object");
         if (!($xmlStr = $RPTOPDetails->getRPTOP($rptopID))) {
             //	exit("xml failed for RPTOP");
             header("Location: " . $this->sess->url("ViewSOA.php") . "&status=1");
         } else {
             //echo $xmlStr;
             if (!($domDoc = domxml_open_mem($xmlStr))) {
                 $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                 $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
             } else {
                 $rptop = new RPTOP();
                 $td = new TD();
                 $rptop->parseDomDocument($domDoc);
                 foreach ($rptop as $key => $value) {
                     $this->formArray['payableYear'] = $rptop->getTaxableYear();
                     $rptopID = $rptop->getRptopID();
                     if ($key == "tdArray") {
                         $tdCtr = 0;
                         if (count($value)) {
                             foreach ($value as $tkey => $tvalue) {
                                 $td->selectRecord($tvalue->getTdID());
                                 $assessedValue = number_format($td->getAssessedValue(), 2, ".", "");
                                 $propertyType = $td->getPropertyType();
                                 $TaxDeclarationNumber = $td->getTaxDeclarationNumber();
                                 $afsID = $td->getAfsID();
                                 $afs = new AFS();
                                 $afs->selectRecord($afsID);
                                 $od = new OD();
                                 $od->selectRecord($afs->getOdID());
                                 $addr = $od->getLocationAddress();
                                 if (count($addr)) {
                                     $location = strtoupper($addr->getNumber() . " " . substr($addr->getBarangay(), 0, 4) . " " . substr($addr->getMunicipalityCity(), 0, 3) . " " . substr($addr->getProvince(), 0, 3));
                                     $munCityID = $addr->getMunicipalityCityID();
                                 }
                                 if (count($afs->landArray)) {
                                     foreach ($afs->landArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $landActualUses = new LandActualUses();
                                         $landActualUses->selectRecord($actualUse);
                                         $Code = $landActualUses->getCode();
                                     }
                                 }
                                 if (count($afs->improvementsBuildingsArray)) {
                                     foreach ($afs->improvementsBuildingsArray as $afsKey => $afsValue) {
                                         $actualUse = $afsValue->getActualUse();
                                         $improvementsBuildingsActualUses = new improvementsBuildingsActualUses();
                                         $improvementsBuildingsActualUses->selectRecord($actualUse);
                                         $Code = $improvementsBuildingsActualUses->getCode();
                                     }
                                 }
                                 if ($munCityID == $this->formArray['municipalityCityID']) {
                                     $this->tpl->set_var(location, $location);
                                     $this->tpl->set_var("class", $Code);
                                     $this->tpl->set_var(kind, strtoupper(substr($propertyType, 0, 4)));
                                     $this->tpl->set_var(currentTDNo, $TaxDeclarationNumber);
                                     $this->tpl->set_var(municipality, $addr->getMunicipalityCity());
                                     //$dues = new Dues();
                                     //$dues->create($td->getTdID(),"2003");
                                     //$totTaxDue += $dues->getSEF()+$dues->getBasic();
                                     $dues = new Dues($tvalue->getTdID(), $rptop->getTaxableYear(), $assessedValue);
                                     $paymentPeriod = $dues->getPaymentMode();
                                     $totalTaxDue = $dues->getPaidBasic($paymentPeriod) + $dues->getPaidSEF($paymentPeriod) + $dues->getPaidIdle($paymentPeriod);
                                     if ($dues->getAmnesty()) {
                                         $dues->setPctPenalty(0.0);
                                     } else {
                                         $totalTaxDue += $dues->getPenalty($paymentPeriod);
                                     }
                                     if ($dues->getIsDiscount()) {
                                         $taxDue->setDiscount($totalTaxDue);
                                         $totalTaxDue -= $dues->getDiscount();
                                     }
                                     $interest = $dues->getPctPenalty();
                                     if ($interest > 0 && $paymentPeriod != "Annual") {
                                         $paymentPeriod = "Annual";
                                     }
                                     $basic = number_format($dues->getPaidBasic(), "2", ".", "");
                                     $this->tpl->set_var(basic, $basic);
                                     $totBasic += $basic;
                                     $sef = number_format($dues->getPaidSEF(), "2", ".", "");
                                     $this->tpl->set_var(sef, $sef);
                                     $totSEF += number_format($sef, "2", ".", "");
                                     $this->tpl->set_var(total, number_format($sef + $basic, "2", ".", ""));
                                     $this->tpl->set_var(marketValue, number_format($afs->getTotalMarketValue(), 2));
                                     $totMarketValue += $afs->getTotalMarketValue();
                                     $this->tpl->set_var(assessedValue, number_format($afs->getTotalAssessedValue(), 2));
                                     $totAssessedValue += $afs->getTotalAssessedValue();
                                     $pIndexNo = $afs->getPropertyIndexNumber();
                                     if ($pIndexNo == "") {
                                         $pIndexNo = "No value specified";
                                     }
                                     $ypos = $ypos - 10;
                                     $this->tpl->set_var(ypos, $ypos);
                                     $this->tpl->set_var(pin, $pIndexNo);
                                     $this->tpl->parse("RowBlk", "ROW", true);
                                 }
                             }
                             #end foreach($value)
                         }
                         #end if coun value
                         $this->tpl->set_var(totalMarketValue, number_format($totMarketValue, 2));
                         $this->tpl->set_var(totalAssessedValue, number_format($totAssessedValue, 2));
                         $this->tpl->set_var(totalBasic, number_format($totBasic, 2));
                         $this->tpl->set_var(totalSEF, number_format($totSEF, 2));
                         $this->tpl->set_var(totalTaxDue, number_format($totalTaxDue, 2));
                     }
                 }
             }
         }
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url(""));
     /*		$this->tpl->parse("templatePage", "rptsTemplate");
     		$this->tpl->finish("templatePage");
     		$this->tpl->p("templatePage");
     */
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $rptrpdf = new PDFWriter();
     $rptrpdf->setOutputXML($this->tpl->get('templatePage'), "string");
     $rptrpdf->writePDF("viewSOA.pdf");
 }
Exemple #15
0
 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");
 }
Exemple #16
0
 function CreateNewRPU_AFS_TDGenRevBrgy($odID, $userID = "", $transactionCode = "", $copyOwner = true, $copyAFS = true, $copyTD = true)
 {
     $link = mysql_connect(MYSQLDBHOST, MYSQLDBUSER, MYSQLDBPWD);
     mysql_select_db(MYSQLDBNAME, $link);
     $sql = "select Person.firstName, Person.lastName from Person, Owner, OwnerPerson " . "where Person.personID = OwnerPerson.personID and OwnerPerson.ownerID = Owner.ownerID and Owner.odID = " . $odID;
     $rs = mysql_query($sql, $link);
     $prevowners = '';
     while ($row = mysql_fetch_assoc($rs)) {
         $prevowners .= $row['firstName'] . ' ' . $row['lastName'] . ', ';
     }
     $prevowners = substr($prevowners, 0, strlen($prevowners) - 2);
     $sql = "select AFS.totalAssessedValue from AFS where AFS.odID = " . $odID;
     $rs = mysql_query($sql, $link);
     $prevassdval = 0;
     if ($row = mysql_fetch_assoc($rs)) {
         $prevassdval = $row['totalAssessedValue'];
     }
     $od = new OD();
     $od->selectRecord($odID);
     unset($od->oldODArray);
     $od->setTransactionCode($transactionCode);
     $od->setOldODArray($odID);
     // create new OD
     $ownerID = $od->owner->getOwnerID();
     $newOdID = $od->insertRecord();
     $newOwnerID = $od->newOwnerID;
     $od->setDomDocument();
     // associate existing Owner to new OD
     $owner = new Owner();
     $owner->selectRecord($ownerID);
     if (count($owner->personArray)) {
         foreach ($owner->personArray as $personKey => $personValue) {
             if ($copyOwner) {
                 $owner->insertOwnerPerson($newOwnerID, $personValue->getPersonID());
             }
         }
     }
     if (count($owner->companyArray)) {
         foreach ($owner->companyArray as $companyKey => $companyValue) {
             if ($copyOwner) {
                 $owner->insertOwnerCompany($newOwnerID, $companyValue->getCompanyID());
             }
         }
     }
     // create new AFS and associate existing properties to new AFS
     $afs = new AFS();
     $afsID = $afs->checkAfsID($odID);
     $afs->selectRecord($afsID);
     $afs->setOdID($newOdID);
     $afs->effectivity = date("Y") + 1;
     // new arpNumber is blank
     //$afs->arpNumber = "";
     // retain PIN except for Consolidation and Subdivision
     //if($transactionCode=="SD" || $transactionCode=="CS"){
     $afs->propertyIndexNumber = "";
     //}
     $afs->setDomDocument();
     $newAFSID = $afs->insertRecord();
     $afs->arpNumber = '(' . $newAFSID . ')';
     $afs->updateRecord();
     if ($copyAFS) {
         if ($copyTD) {
             $td = new TD();
             $td->taxDeclarationNumber = $afs->arpNumber;
             $td->afsID = $newAFSID;
             $td->previousOwner = $prevowners;
             $td->previousAssessedValue = $prevassdval;
             $td->setDomDocument();
             $newTDID = $td->insertRecord();
         }
         if (count($afs->landArray)) {
             foreach ($afs->landArray as $landKey => $landValue) {
                 $landValue->setPropertyID("");
                 $landValue->setAfsID($newAFSID);
                 $landValue->propertyAdministrator->setPersonID("");
                 // set unitValue from SubClass
                 $landSubclasses = new LandSubclasses();
                 $landSubclasses->selectRecord(intVal($landValue->subClass));
                 $landValue->setUnitValue($landSubclasses->getValue());
                 // set assessmentLevel from ActualUse
                 $landActualUses = new LandActualUses();
                 $landActualUses->selectRecord(intVal($landValue->actualUse));
                 $landValue->setAssessmentLevel($landActualUses->getValue());
                 $landValue->calculateMarketValue();
                 $landValue->calculateValueAdjustment();
                 $landValue->calculateAdjustedMarketValue();
                 $landValue->calculateAssessedValue();
                 $landValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $landValue->appraisedByDate = "";
                 $landValue->recommendingApprovalDate = "";
                 $landValue->approvedByDate = "";
                 $newP = $landValue->insertRecord();
             }
         }
         if (count($afs->plantsTreesArray)) {
             foreach ($afs->plantsTreesArray as $plantsTreesKey => $plantsTreesValue) {
                 $plantsTreesValue->setPropertyID("");
                 $plantsTreesValue->setAfsID($newAFSID);
                 $plantsTreesValue->propertyAdministrator->setPersonID("");
                 // set unitPrice from ProductClass
                 $plantsTreesClasses = new PlantsTreesClasses();
                 $plantsTreesClasses->selectRecord(intVal($plantsTreesValue->productClass));
                 $plantsTreesValue->setUnitPrice($plantsTreesClasses->getValue());
                 // set assessmentLevel from ActualUse
                 $plantsTreesActualUses = new PlantsTreesActualUses();
                 $plantsTreesActualUses->selectRecord(intVal($plantsTreesValue->actualUse));
                 $plantsTreesValue->setAssessmentLevel($plantsTreesActualUses->getValue());
                 $plantsTreesValue->calculateMarketValue();
                 $plantsTreesValue->calculateValueAdjustment();
                 $plantsTreesValue->calculateAdjustedMarketValue();
                 $plantsTreesValue->calculateAssessedValue();
                 $plantsTreesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $plantsTreesValue->appraisedByDate = "";
                 $plantsTreesValue->recommendingApprovalDate = "";
                 $plantsTreesValue->approvedByDate = "";
                 $newP = $plantsTreesValue->insertRecord();
             }
         }
         if (count($afs->improvementsBuildingsArray)) {
             foreach ($afs->improvementsBuildingsArray as $improvementsBuildingsKey => $improvementsBuildingsValue) {
                 $improvementsBuildingsValue->setPropertyID("");
                 $improvementsBuildingsValue->setAfsID($newAFSID);
                 $improvementsBuildingsValue->propertyAdministrator->setPersonID("");
                 // set unitValue from BuildingClassification
                 $improvementsBuildingsClasses = new ImprovementsBuildingsClasses();
                 $improvementsBuildingsClasses->selectRecord(intVal($improvementsBuildingsValue->buildingClassification));
                 $improvementsBuildingsValue->setUnitValue($improvementsBuildingsClasses->getValue());
                 // set assessmentLevel from ActualUse
                 $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses();
                 $improvementsBuildingsActualUses->selectRecord(intVal($improvementsBuildingsValue->actualUse));
                 $improvementsBuildingsValue->setAssessmentLevel($improvementsBuildingsActualUses->getValue());
                 $improvementsBuildingsValue->calculateMarketValue();
                 $improvementsBuildingsValue->calculateAccumulatedDepreciation();
                 $improvementsBuildingsValue->calculatedDepreciatedMarketValue();
                 $improvementsBuildingsValue->calculateAdjustedMarketValue();
                 $improvementsBuildingsValue->calculateAssessedValue();
                 $improvementsBuildingsValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $improvementsBuildingsValue->appraisedByDate = "";
                 $improvementsBuildingsValue->recommendingApprovalDate = "";
                 $improvementsBuildingsValue->approvedByDate = "";
                 $newP = $improvementsBuildingsValue->insertRecord();
             }
         }
         if (count($afs->machineriesArray)) {
             foreach ($afs->machineriesArray as $machineriesKey => $machineriesValue) {
                 $machineriesValue->setPropertyID("");
                 $machineriesValue->setAfsID($newAFSID);
                 $machineriesValue->propertyAdministrator->setPersonID("");
                 // set assessmentLevel from ActualUse
                 $machineriesActualUses = new MachineriesActualUses();
                 $machineriesActualUses->selectRecord(intVal($machineriesValue->actualUse));
                 $machineriesValue->setAssessmentLevel($machineriesActualUses->getValue());
                 $machineriesValue->calculateMarketValue();
                 $machineriesValue->calculateDepreciatedMarketValue();
                 $machineriesValue->calculateAdjustedMarketValue();
                 $machineriesValue->calculateAssessedValue();
                 $machineriesValue->memoranda = GENERALREVISION_DEFAULT_MEMORANDA;
                 $machineriesValue->appraisedByDate = "";
                 $machineriesValue->recommendingApprovalDate = "";
                 $machineriesValue->approvedByDate = "";
                 $newP = $machineriesValue->insertRecord();
             }
         }
     }
     $sql = "update AFS set archive = 'true' where AFS.odID = " . $odID;
     mysql_query($sql, $link);
     $sql = "update OD set archive = 'true' where OD.odID = " . $odID;
     mysql_query($sql, $link);
     $sql = "update TD set archive = 'true' where TD.afsID = " . $afsID;
     mysql_query($sql, $link);
     mysql_close($link);
     return $newOdID;
     echo "OD - " . $odID . "->" . $newOdID . "<br>";
     echo "Owner - " . $ownerID . "->" . $newOwnerID . "<br>";
     echo "AFS - " . $afsID . "->" . $newAFSID . "<br>" . $newP;
 }
 function displayLandPINDetails()
 {
     // attempt to capture AFS with associated landPIN
     $afs = new AFS();
     if ($afs->selectRecord("", "", "", "WHERE " . AFS_TABLE . ".propertyIndexNumber = '" . fixQuotes($this->formArray["landPIN"]) . "'")) {
         // attempt to capture first landOwner name
         $od = new OD();
         if ($od->selectRecord($afs->getOdID())) {
             if (is_object($od->owner)) {
                 if (is_array($od->owner->personArray)) {
                     $personArray = $od->owner->personArray;
                     $landOwnerPerson = $personArray[0];
                     $this->formArray["landOwner"] = $landOwnerPerson->getFullName();
                 } else {
                     if (is_array($od->owner->companyArray)) {
                         $companyArray = $od->owner->companyArray;
                         $landOwnerCompany = $companyArray[0];
                         $this->formArray["landOwner"] = $landOwnerCompany->getCompanyName();
                     }
                 }
             }
         }
         // capture landArpNumber
         $this->formArray["landArpNumber"] = $afs->getArpNumber();
         // capture first land details
         if (is_array($afs->landArray)) {
             $landArray = $afs->landArray;
             $land = $landArray[0];
             $this->formArray["landSurveyNumber"] = $land->getSurveyNumber();
             $this->formArray["landArea"] = $land->getArea() . " " . $land->getUnit();
         }
     } else {
         $this->formArray["landOwner"] = "";
         $this->formArray["landSurveyNumber"] = "";
         $this->formArray["landArpNumber"] = "";
         $this->formArray["landArea"] = "";
     }
 }
Exemple #18
0
 function getTDListOf($id, $type, $year)
 {
     echo "<br><br>" . $year . "-" . $id;
     $owner = new Owner();
     //echo("\$ownerIDArray = \$owner->selectOwner".$type."(".$id.");");
     eval("\$ownerIDArray = \$owner->selectOwner" . $type . "(" . $id . ");");
     echo "<br>ownerIDArray - ";
     print_r($ownerIDArray);
     if ($ownerIDArray) {
         $odArray = "";
         foreach ($ownerIDArray as $key => $value) {
             eval("\$odID = \$owner->selectOD" . $type . "({$value});");
             if ($odID) {
                 $odArray[] = $odID;
             }
         }
         echo "<br>odArray - ";
         print_r($odArray);
         unset($owner);
         if ($odArray) {
             $afsArray = "";
             foreach ($odArray as $key => $value) {
                 $afs = new AFS();
                 $odHistoryRecords = new OdHistoryRecords();
                 $afsID = $afs->checkAFSYear($value, $year);
                 $afs->selectRecord("", "", $value);
                 //print_r($value);
                 $odHistoryArr = $odHistoryRecords->selectSuccOD($value, $year);
                 if ($odHistoryArr) {
                     $latestAfs = true;
                     foreach ($odHistoryArr as $k => $v) {
                         if ($afs->checkAFSYear($v, $year)) {
                             $latestAfs = false;
                         }
                         echo "<br>latestAfs = " . $latestAfs . "<br>odID = " . $v . "<br>year" . $year . " - " . $afs->getEffectivity();
                     }
                     if ($latestAfs) {
                         $afsIDArray[] = $afsID;
                     }
                 } else {
                     if ($afsID != "") {
                         $afsIDArray[] = $afsID;
                     }
                 }
                 //if ($latesAfs) $afsIDArray[] = $afsID;
             }
             echo "<br>afsIDArray - ";
             print_r($afsIDArray);
             unset($afs);
             if ($afsIDArray) {
                 $tdRecords = new TDRecords();
                 $tdIDArray = "";
                 foreach ($afsIDArray as $tkey => $tvalue) {
                     $td = new TD();
                     //echo $tvalue;
                     if ($td->selectRecord("", $tvalue)) {
                         //echo $td->getTdID();
                         $tdIDArray[] = $td->getTdID();
                     }
                     unset($td);
                     /*
                     						$afs = new AFS;
                     						$afs->selectRecord($tvalue);
                     						//print_r($afs);
                     						//echo "<br>";
                     						$landArray = $afs->getLandArray();
                     						$plantsTreesArray = $afs->getPlantsTreesArray();
                     						$improvementsBuildingsArray = $afs->getImprovementsBuildingsArray();
                     						$machineriesArray = $afs->getMachineriesArray();
                     						unset($afs);
                     						if ($landArray){
                     							foreach($landArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"Land",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($plantsTreesArray){
                     							foreach($plantsTreesArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"PlantsTrees",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($improvementsBuildingsArray){
                     							foreach($improvementsBuildingsArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"ImprovementsBuildings",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}
                     						if ($machineriesArray){
                     							foreach($machineriesArray as $lkey => $lvalue){
                     								//echo($lvalue->getPropertyID()."<br>");
                     								$td = new TD;
                     								if ($td->selectRecord("",$lvalue->getPropertyID(),"Machineries",$year)){
                     									$tdRecords->setArrayList($td);
                     									$tdIDArray[] = $td->getTdID();
                     								}
                     								unset($td);
                     							}
                     						}*/
                 }
                 //print_r($tdIDArray);
                 $ret = $tdIDArray;
                 //print_r($tdRecords->getArrayList());
                 /*if ($tdRecords->getArrayList()){
                 			$tdRecords->setDomDocument();
                 			if(!$domDoc = $tdRecords->getDomDocument()){
                 				return $ret = false;
                 			}
                 			else {
                 				$xmlStr = $domDoc->dump_mem(true);
                 				return $ret = $xmlStr;
                 			}
                 		}
                 		else $ret = false;*/
             } else {
                 $ret = false;
             }
         } else {
             $ret = false;
         }
     } else {
         $ret = false;
     }
     return $ret;
 }
Exemple #19
0
 function setDetails()
 {
     global $sess;
     # 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'];
     //$rptopID = 14;
     $rptop = new RPTOP();
     $rptop->selectRecord($rptopID);
     $amountPaid = str_replace(",", "", $_POST['amountPaid']);
     $dateDue = $rptop->getTaxableYear();
     # must be a usable format
     $formValues['datePaid'] = date("F j, Y");
     $pORDate = $_POST['prevORDate'];
     if ($pORDate) {
         list($pmonth, $pday, $pyear) = explode("-", $pORDate);
         $formValues['porMonth'] = date("F", mktime(0, 0, 0, $pmonth + 1, 0, 0));
         $formValues['porYear'] = $pyear;
         $formValues['porDay'] = $pday;
     } else {
         $formValues['porMonth'] = "";
         $formValues['porYear'] = "";
         $formValues['porDay'] = "";
     }
     $formValues['orYear'] = substr($rptop->getTaxableYear(), 2);
     $formValues['orMonth'] = date("F");
     $formValues['orDay'] = date("j");
     $formValues['taxableYear'] = $rptop->getTaxableYear();
     $formValues['rptopNum'] = $rptop->getRptopNumber();
     $formValues['prevORNum'] = $_POST['prevORNum'];
     $formValues['orNum'] = $_POST['receiptNo'];
     $formValues['kindOfPayment'] = $_POST['kindOfPayment'];
     $formValues['checkNumber'] = $_POST['checkNum'];
     $formValues['checkDate'] = $_POST['checkDate'];
     # 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'];
     //$tdID = array(2,1);
     //$ownerID=5;
     $td = new TD();
     $ctr = 0;
     # $this->tpl->set_block('step3','PrintTDID','PrintTDIDs');
     //$this->tpl->set_block('step3','TDID','TDIDs');
     $this->tpl->set_block('receipt', 'Property', 'Properties');
     $this->tpl->set_block('Property', 'Owner', 'Owners');
     $n = 165;
     if (is_array($tdID)) {
         foreach ($tdID as $key => $id) {
             # set/pass tdIDs to form
             $this->tpl->set_var(tdID, $id);
             $this->tpl->parse('TDIDs', 'TDID', 'true');
             $td->selectRecord($id);
             $tdNum = $td->getTaxDeclarationNumber();
             $afs = new AFS();
             $formValues['tdNum'] = $tdNum;
             $afs->selectRecord($td->getAfsID());
             $od = new OD();
             $od->selectRecord($afs->getOdID());
             $addr = $od->getLocationAddress();
             # get municipality/province and city(same for all tds)
             //$lotAddress = new LocationAddress;
             //$lotAddress->selectRecordFromTdID($id);
             //$formValues['province'] = $lotAddress->getProvince();
             //$formValues['city'] = $lotAddress->getMunicipalityCity();
             $formValues['city'] = $addr->getMunicipalityCity();
             $formValues['province'] = $addr->getProvince();
             $formValues['municipalityCityID'] = $addr->getMunicipalityCityID();
             # get location/ block and lot number OR Barangay
             #$formValues['lotAddress'] = $lotAddress->getFullAddress();
             $formValues['lotAddress'] = $addr->getNumber . " " . $addr->getStreet();
             if ($formValues['lotAddress'] == "") {
                 $formValues['lotAddress'] = $addr->getBarangay();
             }
             $propertyType = $td->getPropertyType();
             $propertyID = $td->getPropertyID();
             $assessedValue = number_format($td->getAssessedValue(), 2, ".", "");
             $formAssessedValue = number_format($td->getAssessedValue(), 2);
             # separate assessed value of land and others(plantsTrees, improvementsBuildings, machineries)
             if ($propertyType == "Land") {
                 $formValues['assessedValueLand'] = $formAssessedValue;
                 $formValues['assessedValueOthers'] = "";
             } else {
                 $formValues['assessedValueLand'] = "";
                 $formValues['assessedValueOthers'] = $formAssessedValue;
             }
             $formValues['assessedValue'] = $formAssessedValue;
             $formValues['propertyType'] = $propertyType;
             # set the owner's List
             # we define the owner from the RPTOP
             $ownerSwitch = true;
             if ($ctr > 0) {
                 $ownerValues['ownerName'] = "";
                 $ownerValues['ownerAddress'] = "";
                 $this->tpl->set_var($ownerValues);
                 $this->tpl->parse(Owners, Owner, false);
             } else {
                 $owner = $rptop->getOwner();
                 $personArray = $owner->getPersonArray();
                 if (is_array($personArray)) {
                     foreach ($personArray as $person) {
                         $ownerValues['ownerKey'] = "personID";
                         $ownerValues['ownerScript'] = "PersonDetails.php";
                         $ownerValues['ownerID'] = $person->getPersonID();
                         $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['cownerKey'] = "companyID";
                         $ownerValues['cownerScript'] = "CompanyDetails.php";
                         $ownerValues['cownerID'] = $company->getCompanyID();
                         $ownerValues['cownerName'] = $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');
                     }
                 }
                 if (is_array($personArray)) {
                     if (count($personArray) > 1) {
                         $receivedFrom = $personArray[0]->getFirstName() . " " . $personArray[0]->getMiddleName() . " " . $personArray[0]->getLastName() . " et al.";
                     } else {
                         $receivedFrom = $personArray[0]->getFirstName() . " " . $personArray[0]->getMiddleName() . " " . $personArray[0]->getLastName();
                     }
                 } else {
                     if (is_array($companyArray)) {
                         if (count($companyArray) > 1) {
                             $receivedFrom = $companyArray[0]->getCompanyName() . " et al.";
                         } else {
                             $receivedFrom = $companyArray[0]->getCompanyName();
                         }
                     }
                 }
                 $formValues['receivedFrom'] = $receivedFrom;
             }
             //end if ($ctr > 0)
             # tax dues are defined from TDNumber and taxableYear
             # compute for taxes; to create dues obj pass tdID and due date (where due date is beginning of taxable year) -- 14 Aug 2003
             //     $taxDue = new Dues($id,$dateDue,$assessedValue);
             $taxDue = new Dues();
             /*		    if(!$taxDue->create($id,$dateDue)){
                    		    $taxDue->setBasic($assessedValue);
                        		$taxDue->setSEF($assessedValue);
             				# check if land is idle, if yes, set assessed value
             				if($taxDue->getIdleStatus() == 1){
             					$taxDue->setIdle($assessedValue);
             					$idleStatus = 1;
             				}else{
             					$taxDue->setIdle(0);
             					$idleStatus = 0;
             				}
                     	}
             */
             $dateDue = $td->getTaxBeginsWithTheYear();
             $taxDue = new Dues($id, $dateDue);
             if (!$taxDue->create($id, $dateDue)) {
                 $taxDue->setBasic($assessedValue);
                 $taxDue->setSEF($assessedValue);
                 $taxDue->setIsDiscount(0);
                 # check if land is idle, if yes, set assessed value
                 # getIdleStatus -- temporary function
                 if ($taxDue->getIdleStatus() == 1) {
                     #echo("idle<br>");
                     $taxDue->setIdle($assessedValue);
                 }
             } else {
                 $taxDue->setIsDiscount($dateDue == date("Y") && date("n") <= $taxDue->discountPeriod && $taxDue->getPaymentMode() == "Annual");
             }
             $paymentPeriod = $_POST['paymentPeriod'];
             # set amnesty to object
             //$amnesty = $_POST['amnesty'];
             //$taxDue->setAmnesty($amnesty=="Yes");
             //	$taxDue->store();
             $totalTaxDue = $taxDue->getTotalDue($paymentPeriod);
             $totalAmount = $taxDue->getTotalDue($paymentPeriod);
             //    $paymentPeriod= "Annual";
             /*    	    if(isset($_POST['paymentPeriod'])){
                     	    $paymentPeriod = $_POST['paymentPeriod'];
             				
                     	}*/
             $formValues['paymentPeriod'] = $paymentPeriod;
             $this->tpl->set_var($formValues);
             ## Compute taxes and set the page values
             //$totalTaxDue = $taxDue->getTotalDue($paymentPeriod);
             $interest = $taxDue->getPctPenalty();
             if ($interest > 0 && $paymentPeriod != "Annual") {
                 $paymentPeriod = "Annual";
             }
             $basic = $taxDue->getBalanceBasic($paymentPeriod);
             $sef = $taxDue->getBalanceSEF($paymentPeriod);
             $idle = $taxDue->getBalanceIdle($paymentPeriod);
             $discount = $taxDue->getDiscount($basic + $sef);
             $penalty = $taxDue->getBalancePenalty($paymentPeriod);
             $taxValues['idleStatus'] = $idleStatus == 0 ? "" : "(I)";
             $taxValues['basic'] = number_format($basic, 2);
             $taxValues['sef'] = number_format($sef, 2);
             $taxValues['pd1185'] = number_format(0.0, 2);
             $taxValues['subTotal'] = number_format($totalTaxDue, 2);
             $taxValues['periodTotal'] = number_format($basic + $sef + $idle, 2);
             $taxValues['interest'] = number_format($interest * 100.0, 1) . "%";
             $taxValues['penalty'] = number_format($interest * 100, 0);
             $taxValues['discount'] = number_format($discount * 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(round($totalTaxDue, 2), 2);
             $taxValues['grandTotal'] = number_format($totalTaxDue, 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);
             if ($paymentPeriod == "Annual") {
                 $this->tpl->set_var("fullPmt", $taxValues['subTotal']);
                 $this->tpl->set_var("partialPmt", "");
                 # get full payment total
                 $fullPmtTotal += str_replace(",", "", $taxValues['subTotal']);
                 $this->tpl->set_var("fullPmtTotal", number_format($fullPmtTotal, 2));
             } else {
                 $this->tpl->set_var("partialPmt", $taxValues['subTotal']);
                 $this->tpl->set_var("num", ceil(date("n") / 3));
                 $this->tpl->set_var("fullPmt", "");
                 # get partial payment total
                 $partialPmtTotal += str_replace(",", "", $taxValues['subTotal']);
                 $this->tpl->set_var("partialPmtTotal", number_format($partialPmtTotal, 2));
             }
             $this->tpl->set_var($taxValues);
             $this->tpl->parse('Properties', 'Property', 'true');
             $ctr++;
             # get totals for penalty and grand total
             # $penaltyTotal += ($basic*$interest); -- removed bec penalty in percent
             $total += $totalTaxDue;
             # $this->tpl->set_var("penaltyTotal", number_format($penaltyTotal,2));
         }
     }
     # end foreach
     if ($total > $totalTaxDue) {
         $totalTaxDue = $total;
     }
     // if backtaxTDCheckbox is checked
     if ($_POST['backtaxTDCheckbox'] && $_POST['backtaxTDCheckbox'] != "") {
         $totalTaxDue += $this->displayBacktaxTD($ownerSwitch);
         $fullPmtTotal = $totalTaxDue;
         $this->tpl->set_var("fullPmtTotal", number_format($fullPmtTotal, 2));
     }
     # if amnesty checked/unchecked form will submit, set kind of payment and other details
     /*switch($formValues['kindOfPayment']){
     			case 'check':
     				$this->tpl->set_var("selectedCheck","selected");
     				$this->tpl->set_var("disabledOn","");
     				$this->tpl->set_var("checkNum",$formValues['checkNum']);
     				$this->tpl->set_var("checkDate",$formValues['checkDate']);
     				break;
     			case 'treasury note':
     				$this->tpl->set_var("selectedTNote","selected");
     				$this->tpl->set_var("disabledOn","disabled");
     				$this->tpl->set_var("checkNum","");
     				$this->tpl->set_var("checkDate","");
     				break;
     			case 'cash':
     			default:
     				$this->tpl->set_var("selectedCash","selected");
     				$this->tpl->set_var("disabledOn","disabled");
     				$this->tpl->set_var("checkNum","");
     				$this->tpl->set_var("checkDate","");								
     				break;
     		}*/
     # get totals in words
     $amountPaid = $amountPaid ? number_format($amountPaid, 2) : number_format($total, 2);
     $this->tpl->set_var("total", number_format($total, 2));
     $this->tpl->set_var("amountPaid", $amountPaid);
     $this->tpl->set_var("balance", $total - $amountPaid);
     $numToWords = new NumbersToWords();
     $totalInWords = $numToWords->num_to_string(number_format(str_replace(",", "", $amountPaid), 2));
     $this->tpl->set_var("totalInWords", $totalInWords);
     //$this->tpl->set_var("amnestyChecked", ($formValues['amnesty']=="Yes") ? " checked" : "");
     //if(!isset($_POST['printReceipt_x']))
     //  	$this->tpl->set_var("Session", $sess->url(""));
 }
Exemple #20
0
 function displayBuildingPINDetails()
 {
     // attempt to capture AFS with associated landPIN
     $afs = new AFS();
     if ($afs->selectRecord("", "", "", "WHERE " . AFS_TABLE . ".propertyIndexNumber = '" . fixQuotes($this->formArray["buildingPIN"]) . "'")) {
         // attempt to capture first buildingOwner name
         $od = new OD();
         if ($od->selectRecord($afs->getOdID())) {
             if (is_object($od->owner)) {
                 if (is_array($od->owner->personArray)) {
                     $personArray = $od->owner->personArray;
                     $buildingOwnerPerson = $personArray[0];
                     $this->formArray["buildingOwner"] = $buildingOwnerPerson->getFullName();
                 } else {
                     if (is_array($od->owner->companyArray)) {
                         $companyArray = $od->owner->companyArray;
                         $buildingOwnerCompany = $companyArray[0];
                         $this->formArray["buildingOwner"] = $buildingOwnerpany->getCompanyName();
                     }
                 }
             }
         }
     } else {
         $this->formArray["buildingPIN"] = "";
         $this->formArray["buildingOwner"] = "";
     }
 }
 function displayRecords()
 {
     $this->selectRecords();
     $this->tpl->set_block("rptsTemplate", "OwnerPersonList", "OwnerPersonListBlock");
     $this->tpl->set_block("OwnerPersonList", "ODList", "ODListBlock");
     foreach ($this->arrayList as $person) {
         $this->tpl->set_var("personID", $person->getPersonID());
         $this->tpl->set_var("lastName", $person->getLastName());
         $this->tpl->set_var("firstName", $person->getFirstName());
         $this->tpl->set_var("middleName", $person->getMiddleName());
         $this->tpl->set_var("gender", $person->getGender());
         $this->tpl->set_var("birthday", $person->getBirthday());
         $this->tpl->set_var("maritalStatus", $person->getMaritalStatus());
         $this->tpl->set_var("tin", $person->getTin());
         $this->tpl->set_var("telephone", $person->getTelephone());
         $this->tpl->set_var("mobileNumber", $person->getMobileNumber());
         $this->tpl->set_var("email", $person->getEmail());
         if (is_array($person->addressArray)) {
             $address = $person->addressArray[0];
             $this->tpl->set_var("address", $address->getFullAddress());
         }
         // capture OD, AFS, and TD info
         $this->setDB();
         $sql = sprintf("SELECT DISTINCT(Owner.odID) as odID" . " FROM Owner,OwnerPerson " . " WHERE " . " Owner.ownerID = OwnerPerson.ownerID AND " . " OwnerPerson.personID = '%s' ", $person->getPersonID());
         $this->db->query($sql);
         while ($this->db->next_record()) {
             $od = new OD();
             if ($od->selectRecord($this->db->f("odID"))) {
                 $this->ODArray[] = $od;
                 $this->tpl->set_var("odID", $od->getOdID());
                 if (is_object($od->locationAddress)) {
                     $this->tpl->set_var("locationAddress", $od->locationAddress->getFullAddress());
                 } else {
                     $this->tpl->set_var("locationAddress", "");
                 }
                 $afs = new AFS();
                 if ($afs->selectRecord("", "", $od->getOdID(), "")) {
                     $this->tpl->set_var("afsID", $afs->getAfsID());
                     $this->tpl->set_var("propertyIndexNumber", $afs->getPropertyIndexNumber());
                     $this->tpl->set_var("arpNumber", $afs->getArpNumber());
                     if (is_array($afs->landArray)) {
                         $this->displayLandList($afs->landArray);
                     }
                     if (is_array($afs->plantsTreesArray)) {
                         $this->displayPlantsTreesList($afs->plantsTreesArray);
                     }
                     if (is_array($afs->improvementsBuildingsArray)) {
                         $this->displayImprovementsBuildingsList($afs->improvementsBuildingsArray);
                     }
                     if (is_array($afs->machineriesArray)) {
                         $this->displayMachineriesList($afs->machineriesArray);
                     }
                     $td = new TD();
                     if ($td->selectRecord("", $afs->getAfsID(), "", "", "")) {
                         $this->tpl->set_var("tdID", $td->getTdID());
                         $this->tpl->set_var("taxDeclarationNumber", $td->getTaxDeclarationNumber());
                         $this->tpl->set_var("propertyType", $td->getPropertyType());
                     }
                 }
                 unset($td);
                 unset($afs);
                 unset($od);
                 $this->tpl->parse("ODListBlock", "ODList", true);
             }
         }
         $this->tpl->parse("OwnerPersonListBlock", "OwnerPersonList", true);
         $this->tpl->set_var("ODListBlock", "");
         $this->clearPropertyElements();
         unset($this->ODArray);
         unset($this->AFSArray);
         unset($this->TDArray);
         unset($this->db);
     }
 }
Exemple #22
0
 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();
                                 $assessedValue = $tvalue->getAssessedValue();
                                 $afs = new AFS();
                                 $afs->selectRecord($tvalue->getAfsID());
                                 $propertyIndexNumber = $afs->getPropertyIndexNumber();
                                 /*$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 = new Dues($tvalue->getTdID(), $rptop->getTaxableYear(), $assessedValue);
                                 //$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 = round($taxDue->getBasic(), 2) + round($taxDue->getSEF(), 2) + round($taxDue->getPenalty(), 2) - ($taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF());
                                 $totalBalance += $balance;
                                 $this->tpl->set_var(balance, number_format(abs($balance), 2));
                                 $totalValues['totAssessedValue'] += $assessedValue;
                                 $totalValues['totBasic'] += round($taxDue->getBasic(), 2);
                                 $totalValues['totPenalty'] += round($taxDue->getPenalty(), 2);
                                 $totalValues['totSEF'] += round($taxDue->getSEF(), 2);
                                 $totalValues['totTotal'] += round($taxDue->getBasic(), 2) + round($taxDue->getPenalty(), 2) + round($taxDue->getSEF(), 2);
                                 $totPaidBasic += $taxDue->getPaidBasic();
                                 $totPaidPenalty += $taxDue->getPaidPenalty();
                                 $totPaidSEF += $taxDue->getPaidSEF();
                                 $totPaidTotal += $taxDue->getPaidBasic() + $taxDue->getPaidPenalty() + $taxDue->getPaidSEF();
                                 $totalValues['totPaidBasic'] = number_format($totPaidBasic, 2);
                                 $totalValues['totPaidPenalty'] = number_format($totPaidPenalty, 2);
                                 $totalValues['totPaidSEF'] = number_format($totPaidSEF, 2);
                                 $totalValues['totPaidTotal'] = number_format($totPaidTotal, 2);
                                 $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();
     $this->tpl->set_var(totBalance, number_format(abs($totalBalance), 2));
     $this->tpl->set_var(amountDue, number_format(abs($totalValues['totTotal'] - un_number_format($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");
 }
Exemple #23
0
 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");
 }
Exemple #24
0
 function setOwnerRPTOP($formArray, $ownerName, $rptopNumber)
 {
     if (!is_array($formArray)) {
         return false;
     }
     if (!is_array($ownerName)) {
         return false;
     }
     if ($rptopNumber == "") {
         return false;
     }
     // create new rptop record as $rptop (array)
     $rptop["rptopNumber"] = $rptopNumber;
     $rptop["taxableYear"] = $formArray["taxableYear"];
     $rptop["cityTreasurer"] = $formArray["cityTreasurer"];
     $rptop["cityAssessor"] = $formArray["cityAssessor"];
     $rptop["createdBy"] = $formArray["userID"];
     $rptop["modifiedBy"] = $formArray["userID"];
     $rptop["landTotalMarketValue"] = 0;
     $rptop["landTotalAssessedValue"] = 0;
     $rptop["plantTotalMarketValue"] = 0;
     $rptop["plantTotalAssessedValue"] = 0;
     $rptop["bldgTotalMarketValue"] = 0;
     $rptop["bldgTotalAssessedValue"] = 0;
     $rptop["machTotalMarketValue"] = 0;
     $rptop["machTotalAssessedValue"] = 0;
     $rptop["totalMarketValue"] = 0;
     $rptop["totalAssessedValue"] = 0;
     // get TDIDArray
     $ownerTDIDArray = $this->getTDListOf($ownerName["id"], $ownerName["type"], $formArray["taxableYear"]);
     foreach ($ownerTDIDArray as $ownerTDID) {
         $td = new TD();
         $afsID = $td->checkAfsID($ownerTDID);
         $afs = new AFS();
         $afs->selectRecord($afsID);
         $rptop["landTotalMarketValue"] += $afs->getLandTotalMarketValue();
         $rptop["landTotalAssessedValue"] += $afs->getLandTotalAssessedValue();
         $rptop["plantTotalMarketValue"] += $afs->getPlantTotalMarketValue();
         $rptop["plantTotalAssessedValue"] += $afs->getPlantTotalAssessedValue();
         $rptop["bldgTotalMarketValue"] += $afs->getBldgTotalMarketValue();
         $rptop["bldgTotalAssessedValue"] += $afs->getBldgTotalAssessedValue();
         $rptop["machTotalMarketValue"] += $afs->getMachTotalMarketValue();
         $rptop["machTotalAssessedValue"] += $afs->getMachTotalAssessedValue();
     }
     $rptop["totalMarketValue"] = $rptop["landTotalMarketValue"] + $rptop["plantTotalMarketValue"] + $rptop["bldgTotalMarketValue"] + $rptop["machTotalMarketValue"];
     $rptop["totalAssessedValue"] = $rptop["landTotalAssessedValue"] + $rptop["plantTotalAssessedValue"] + $rptop["bldgTotalAssessedValue"] + $rptop["machTotalAssessedValue"];
     // insert into RPTOP TABLE
     if ($rptop["rptopID"] = $this->insertRPTOPRecord($rptop)) {
         // insert into RPTOPTD TABLE
         foreach ($ownerTDIDArray as $ownerTDID) {
             if (!($rptoptdID = $this->insertRPTOPTDRecord($rptop["rptopID"], $ownerTDID))) {
                 // error inserting to RPTOPTD (shouldnt reach here)
             }
         }
         // insert into OWNER TABLE
         if ($ownerID = $this->insertOwnerRecord($rptop["rptopID"])) {
             // insert either into OWNER_PERSON or OWNER_COMPANY TABLE
             switch ($ownerName["type"]) {
                 case "Person":
                     if (!($ownerPersonID = $this->insertOwnerPerson($ownerID, $ownerName["id"]))) {
                         // error inserting to OwnerPerson table (shouldnt reach here)
                     }
                     break;
                 case "Company":
                     if (!($ownerCompanyID = $this->insertOwnerCompany($ownerID, $ownerName["id"]))) {
                         // error inserting to OwnerCompany table (shouldnt reach here)
                     }
                     break;
             }
         }
         return $rptop["rptopID"];
     } else {
         return false;
     }
     return true;
 }
Exemple #25
0
 function getOdID($tdID)
 {
     $afsID = $this->getAfsID($tdID);
     $afs = new AFS();
     $afs->selectRecord($afsID);
     $odID = $afsID->odID;
     return $odID;
 }
 function getPropertyClassificationFromTD($tdID)
 {
     $td = new TD($this->dbName);
     if ($td->selectRecord($tdID)) {
         $afsID = $td->getAfsID();
         $afs = new AFS($this->dbName);
         if ($afs->selectRecord($afsID)) {
             if (is_array($afs->landArray)) {
                 foreach ($afs->landArray as $land) {
                     $landActualUsesID = $land->getActualUse();
                     $landActualUses = new LandActualUses($this->dbName);
                     if ($landActualUses->selectRecord($landActualUsesID)) {
                         return $landActualUses->getReportCode();
                     }
                 }
             } else {
                 if (is_array($afs->plantsTreesArray)) {
                     foreach ($afs->plantsTreesArray as $plantsTrees) {
                         $plantsTreesActualUsesID = $plantsTrees->getActualUse();
                         $plantsTreesActualUses = new PlantsTreesActualUses($this->dbName);
                         if ($plantsTreesActualUses->selectRecord($plantsTreesActualUsesID)) {
                             return $plantsTreesActualUses->getReportCode();
                         }
                     }
                 } else {
                     if (is_array($afs->improvementsBuildingsArray)) {
                         foreach ($afs->improvementsBuildingsArray as $improvementsBuildings) {
                             $improvementsBuildingsActualUsesID = $improvementsBuildings->getActualUse();
                             $improvementsBuildingsActualUses = new ImprovementsBuildingsActualUses($this->dbName);
                             if ($improvementsBuildingsActualUses->selectRecord($improvementsBuildingsActualUsesID)) {
                                 return $improvementsBuildingsActualUses->getReportCode();
                             }
                         }
                     } else {
                         if (is_array($afs->machineriesArray)) {
                             foreach ($afs->machineriesArray as $machineries) {
                                 $machineriesActualUsesID = $machineries->getActualUse();
                                 $machineriesActualUses = new MachineriesActualUses($this->dbName);
                                 if ($machineriesActualUses->selectRecord($machineriesActualUsesID)) {
                                     return $machineriesActualUses->getReportCode();
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return false;
 }