/**
  *
  */
 private function init_combos()
 {
     $constant = new ConstantDataAccess($this->getDbAdapter());
     if (!$this->statusList) {
         $this->statusList = $constant->getComboByName('default_status');
     }
     if (!$this->companyTypes) {
         $this->companyTypes = $constant->getComboByName('company_types');
     }
 }
 private function initCombo()
 {
     $staffDA = new StaffDataAccess($this->getDbAdapter());
     $constantDA = new ConstantDataAccess($this->getDbAdapter());
     $this->staffList = $staffDA->getComboData('staffId', 'staffCode');
     $this->statusList = $constantDA->getComboByName('leave_status');
     unset($this->statusList['R']);
     $result = $constantDA->getConstantByName('leave_type');
     $leaveTypes = json_decode($result->getValue());
     if (!$this->leaveTypeList) {
         $comboList = array();
         foreach ($leaveTypes as $leave) {
             $comboList[$leave->id] = $leave->title;
             $this->annualLeave[$leave->id] = $leave->value;
         }
         $this->leaveTypeList = $comboList;
     }
 }
 private function init_combos()
 {
     if (!$this->currencyList) {
         $currencyDataAccess = new CurrencyDataAccess($this->getDbAdapter());
         $this->currencyList = $currencyDataAccess->getComboData('currencyId', 'code');
     }
     if (!$this->companyList) {
         $companyDataAccess = new CompanyDataAccess($this->getDbAdapter());
         $this->companyList = $companyDataAccess->getComboData('companyId', 'name');
     }
     if (!$this->contactList) {
         $contactDataAccess = new ContactDataAccess($this->getDbAdapter());
         $this->contactList = $contactDataAccess->getComboData('contactId', 'name');
     }
     if (!$this->statusList) {
         $constantDataAccess = new ConstantDataAccess($this->getDbAdapter());
         $this->statusList = $constantDataAccess->getComboByName('default_status');
     }
 }
 private function init_data()
 {
     if (!$this->staffTable) {
         $this->staffTable = new StaffDataAccess($this->getDbAdapter());
     }
     if (!$this->staffId) {
         $staff = $this->getCurrentStaff();
         $this->staffId = boolval($staff) ? $staff->getStaffId() : 0;
     }
     if (!$this->payrollTable) {
         $this->payrollTable = new PayrollDataAccess($this->getDbAdapter());
     }
     if (!$this->calendarTable) {
         $this->calendarTable = new CalendarDataAccess($this->getDbAdapter());
     }
     $constantTable = new ConstantDataAccess($this->getDbAdapter());
     if (!$this->formulaList) {
         $this->formulaList = $constantTable->getComboByName('payroll_formula', 'payroll');
     }
     if (!$this->workingHours) {
         $constant = $constantTable->getConstantByName('work_hour');
         $this->workingHours = $constant->getValue();
     }
     if (!$this->leaveValues) {
         $constant = $constantTable->getConstantByName('leave_type');
         $this->leaveValues = $constant->getValue();
     }
     $constantDataAccess = new ConstantDataAccess($this->getDbAdapter());
     if (!$this->lateList) {
         $lateData = $constantDataAccess->getConstantByName('late_condition', 'payroll');
         $lateList = Json::decode($lateData->getValue());
         usort($lateList, function ($a, $b) {
             if ($a->minute == $b->minute) {
                 return 0;
             }
             return $a->minute > $b->minute ? -1 : 1;
         });
         $this->lateList = $lateList;
     }
 }
 /**
  *
  */
 private function init_data()
 {
     if (!$this->staffTable) {
         $this->staffTable = new StaffDataAccess($this->getDbAdapter());
     }
     if (!$this->staff) {
         $this->staff = $this->getCurrentStaff();
     }
     if (!$this->leaveTable) {
         $this->leaveTable = new LeaveDataAccess($this->getDbAdapter());
     }
     if (!$this->calendarTable) {
         $this->calendarTable = new CalendarDataAccess($this->getDbAdapter());
     }
     $constantTable = new ConstantDataAccess($this->getDbAdapter());
     if (!$this->formulaList) {
         $this->formulaList = $constantTable->getComboByName('payroll_formula', 'payroll');
     }
     if (!$this->workingHours) {
         $constant = $constantTable->getConstantByName('work_hour');
         $this->workingHours = $constant->getValue();
     }
     if (!$this->leaveValues) {
         $constant = $constantTable->getConstantByName('leave_type');
         $this->leaveValues = $constant->getValue();
     }
     if (!$this->lateList) {
         $lateData = $constantTable->getConstantByName('late_condition', 'payroll');
         $lateList = Json::decode($lateData->getValue());
         usort($lateList, function ($a, $b) {
             if ($a->minute == $b->minute) {
                 return 0;
             }
             return $a->minute > $b->minute ? -1 : 1;
         });
         $this->lateList = $lateList;
     }
     if (!$this->leaveTypeList) {
         $result = $constantTable->getConstantByName('leave_type');
         $leaveTypes = json_decode($result->getValue());
         $comboList = array();
         foreach ($leaveTypes as $leave) {
             $comboList[$leave->id] = $leave->title;
         }
         $this->leaveTypeList = $comboList;
     }
 }
 /**
  * @return array
  */
 private function statusCombo()
 {
     $dataAccess = new ConstantDataAccess($this->getDbAdapter());
     return $dataAccess->getComboByName('default_status');
 }
 /**
  * @return array
  */
 private function getTypeList()
 {
     $dataAccess = new ConstantDataAccess($this->getDbAdapter());
     return $dataAccess->getComboByName('generate_types');
 }
 /**
  * @return array
  */
 private function urlTypeCombo()
 {
     $dataAccess = new ConstantDataAccess($this->getDbAdapter());
     return $dataAccess->getComboByName('routing_url_type');
 }
 /**
  * @return mixed
  */
 private function getSkipTypes()
 {
     $dataAccess = new ConstantDataAccess($this->getDbAdapter());
     $result = json_decode($dataAccess->getConstantByName('closing_type_id')->getValue());
     return array_unique(array($result->open, $result->close));
 }
 /**
  * @return array
  */
 private function holidayTypeCombo()
 {
     $dataAccess = new ConstantDataAccess($this->getDbAdapter());
     return $dataAccess->getComboByName('holiday_type');
 }