示例#1
0
 public static function parseSaveDataHsp($key)
 {
     if (isset($key)) {
         $value = "hsp_current_plan";
         $tempHsp = new DefineHsp();
         $tempHsp->setConfigValue($key, $value);
         $k1 = $tempHsp->getConfigValue($key);
         $hspArr = $tempHsp->fetchHsp($key);
     } else {
         $hspArr = NULL;
     }
     return $hspArr;
 }
 public static function parseSaveData($postArr)
 {
     $hspPaymentRequest = new HspPaymentRequest();
     if (!empty($postArr['txtId'])) {
         $hspPaymentRequest->setId($postArr['txtId']);
     }
     if (!empty($postArr['txtEmployeeId'])) {
         $hspPaymentRequest->setEmployeeId($postArr['txtEmployeeId']);
     }
     if (!empty($postArr['cmbPlanName'])) {
         $hspPlanName = $postArr['cmbPlanName'];
     } else {
         if (!empty($postArr['hidPlanName'])) {
             $hspPlanName = $postArr['hidPlanName'];
         }
     }
     $hspPaymentRequest->setHspId(DefineHsp::getHspPlanId($hspPlanName));
     if (!empty($postArr['txtDateIncurred'])) {
         $hspPaymentRequest->setDateIncurred($postArr['txtDateIncurred']);
     }
     if (!empty($postArr['txtProviderName'])) {
         $hspPaymentRequest->setProviderName($postArr['txtProviderName']);
     }
     if (!empty($postArr['txtPersonIncurringExpense'])) {
         $hspPaymentRequest->setPersonIncurringExpense($postArr['txtPersonIncurringExpense']);
     }
     if (!empty($postArr['txtExpenseDescription'])) {
         $hspPaymentRequest->setExpenseDescription($postArr['txtExpenseDescription']);
     }
     if (!empty($postArr['txtExpenseAmount'])) {
         $hspPaymentRequest->setExpenseAmount($postArr['txtExpenseAmount']);
     }
     if (!empty($postArr['txtPaymentMadeTo'])) {
         $hspPaymentRequest->setPaymentMadeTo($postArr['txtPaymentMadeTo']);
     }
     if (!empty($postArr['txtThirdPartyAccountNumber'])) {
         $hspPaymentRequest->setThirdPartyAccountNumber($postArr['txtThirdPartyAccountNumber']);
     }
     if (!empty($postArr['txtMailAddress'])) {
         $hspPaymentRequest->setMailAddress($postArr['txtMailAddress']);
     }
     if (!empty($postArr['txtComments'])) {
         $hspPaymentRequest->setComments($postArr['txtComments']);
     }
     if (!empty($postArr['txtDatePaid'])) {
         $hspPaymentRequest->setDatePaid($postArr['txtDatePaid']);
     }
     if (!empty($postArr['txtCheckNumber'])) {
         $hspPaymentRequest->setCheckNumber($postArr['txtCheckNumber']);
     }
     if (!empty($postArr['checkPaperworkSubmitted'])) {
         $hspPaymentRequest->setPaperWorkSubmitted($postArr['checkPaperworkSubmitted']);
     }
     if (!empty($postArr['txtHrNotes'])) {
         $hspPaymentRequest->setHrNotes($postArr['txtHrNotes']);
     }
     return $hspPaymentRequest;
 }
示例#3
0
 public function testfetchHsp()
 {
     $definedHsp = DefineHsp::fetchHsp();
     $expected = '0';
     $this->assertEquals($expected, $definedHsp);
 }
示例#4
0
 /**
  * This function get a database resource as the input and creates a HSP objects array
  * containing the data of the resource.
  */
 private static function _buildSummaryObjects($result)
 {
     $dbConnection = new DMLFunctions();
     $hspObjArr = null;
     while ($row = $dbConnection->dbObject->getArray($result)) {
         $hspObj = new Hsp();
         $empName = EmpInfo::getFullName($row[1]);
         if (isset($empName)) {
             // For excluding deleted employees
             $hspObj->setSummaryId($row[0]);
             $hspObj->setEmployeeId($row[1]);
             $hspObj->setHspPlanId($row[2]);
             $hspObj->setHspPlanName(DefineHsp::getHspPlanName($row[2]));
             $hspObj->setEmployeeName($empName);
             $hspObj->setHspPlanYear($row[3]);
             $hspObj->setHspPlanStatus($row[4]);
             $hspObj->setAnnualLimit($row[5]);
             $hspObj->setEmployerAmount($row[6]);
             $hspObj->setEmployeeAmount($row[7]);
             $hspObj->setTotalAccrued($row[8]);
             $hspObj->setTotalUsed($row[9]);
             $currentHspPlan = Config::getHspCurrentPlan();
             if ($currentHspPlan == 3 || $currentHspPlan == 4 || $currentHspPlan == 5) {
                 // If FSA is avaialbe in current plan
                 if ($row[2] == 3) {
                     $hspObj->setFsaBalance(self::_fetchLastYearFsaBalance($row[1], $row[3] - 1));
                 } else {
                     $hspObj->setFsaBalance("NA");
                 }
             }
             $hspObjArr[] = $hspObj;
         }
     }
     return $hspObjArr;
 }
示例#5
0
 public static function viewHspRequestView($id, $edit = false)
 {
     $year = date('Y');
     $authorizeObj = new authorize($_SESSION['empID'], $_SESSION['isAdmin']);
     $path = "/templates/benefits/editHspPaymentRequest.php";
     $request = HspPaymentRequest::getHspRequest($id);
     $empID = $_SESSION['empID'];
     $planId = $request->getHspId();
     $planName = DefineHsp::getHspPlanName($planId);
     $tmpOb[0] = $year;
     $tmpOb[1] = null;
     if ($edit) {
         $tmpOb[2] = 1;
     } else {
         $tmpOb[2] = 2;
     }
     $tmpOb[3] = $request;
     $tmpOb[4] = $authorizeObj;
     $tmpOb[5] = $_SESSION['empID'];
     $tmpOb[6] = $id;
     $tmpOb[9] = $planName;
     $template = new TemplateMerger($tmpOb, $path);
     $template->display();
 }