Ejemplo n.º 1
0
     $pptsvlf->getByPayPeriodIdAndUserId($pay_period_obj->getId(), $user_id);
     if ($pptsvlf->getRecordCount() > 0) {
         $pptsv_obj = $pptsvlf->getCurrent();
         $time_sheet_verify = array('id' => $pptsv_obj->getId(), 'status_id' => $pptsv_obj->getStatus(), 'status' => Option::getByKey($pptsv_obj->getStatus(), $pptsv_obj->getOptions('status')), 'pay_period_id' => $pptsv_obj->getPayPeriod(), 'user_id' => $pptsv_obj->getUser(), 'created_date' => $pptsv_obj->getCreatedDate(), 'created_by' => $pptsv_obj->getCreatedBy(), 'updated_date' => $pptsv_obj->getUpdatedDate(), 'updated_by' => $pptsv_obj->getUpdatedBy(), 'deleted_date' => $pptsv_obj->getDeletedDate(), 'deleted_by' => $pptsv_obj->getDeletedBy());
     }
     //Check if previous pay period was verified or not
     $is_previous_time_sheet_verified = FALSE;
     $pplf = new PayPeriodListFactory();
     $pplf->getPreviousPayPeriodById($pay_period_obj->getId());
     if ($pplf->getRecordCount() > 0) {
         $previous_pay_period_obj = $pplf->getCurrent();
         if ($previous_pay_period_obj->getStatus() == 20) {
             $is_previous_time_sheet_verified = TRUE;
         } else {
             $pptsvlf = new PayPeriodTimeSheetVerifyListFactory();
             $pptsvlf->getByPayPeriodIdAndUserId($previous_pay_period_obj->getId(), $user_id);
             if ($pptsvlf->getRecordCount() > 0) {
                 $pptsv_obj = $pptsvlf->getCurrent();
                 if ($pptsv_obj->getAuthorized() == TRUE) {
                     $is_previous_time_sheet_verified = TRUE;
                 }
             }
         }
     } else {
         $is_previous_time_sheet_verified = TRUE;
         //There is no previous pay period
     }
     unset($previous_pay_period_obj, $pptsvlf, $pptsv_obj, $pplf);
 }
 //Get pay period totals
 //Sum all Worked Hours