Пример #1
0
 public function isMoreActionInHeader()
 {
     return !($this->sbr->isEmp() && $this->sbr->data['emp_feedback_id'] > 0) && $this->status == sbr_stages::STATUS_ARBITRAGED && !$this->data[$this->sbr->upfx . 'feedback_id'] || $this->notification['ntype'] == 'sbr_stages.EMP_PAID' && $this->sbr->isEmp() || $this->notification['ntype'] == 'sbr_stages.FRL_PAID' && $this->sbr->isFrl() || $this->notification['ntype'] == 'sbr_stages.DOC_RECEIVED' || $this->notification['ntype'] == 'sbr_stages.FRL_FEEDBACK' && $this->sbr->isFrl() && $this->head_docs || $this->data['lc_state'] == pskb::STATE_TRANS && $this->sbr->isFrl() || $this->data['lc_state'] == pskb::STATE_PASSED && $this->sbr->isFrl() || $this->data['lc_state'] == pskb::STATE_PASSED && $this->sbr->isEmp() && $this->status == self::STATUS_ARBITRAGED && ($this->arbitrage['id'] > 0 && (int) $this->arbitrage['frl_percent'] != 1);
 }
Пример #2
0
 /**
  * Подготавливаем запись LC.
  * Проверяем доступность платежной системы в соответствии с указанными реквизитами.
  * Если реквизитов достаточно, регистрируем их в таблице pskb_lc
  * 
  * @param type $ps          Выбранная платежная система
  * @return type
  */
 public function prepareLC($ps)
 {
     if (!$ps) {
         $this->_setError('Ошибка запроса.');
         return false;
     }
     $reqv_fn = $this->_sbr->isEmp() ? 'getEmpReqvs' : 'getFrlReqvs';
     $user_pfx = 'Perf';
     if ($this->_sbr->isEmp()) {
         $user_pfx = 'Cust';
         $data['ps_emp'] = $ps;
         $data['sum'] = $this->_sbr->getReserveSum(true, pskb::$exrates_map[$ps]);
     } else {
         $data['ps_frl'] = $ps;
         $data['sum'] = $this->_sbr->getReserveSum();
     }
     $data['sbr_id'] = $this->_sbr->data['id'];
     $user = new pskb_user($this->_sbr->{$reqv_fn}(), intval($this->_sbr->isEmp()));
     if ($user->checkPsys($ps, null, true)) {
         if ($this->_sbr->isEmp()) {
             $err_txt = 'перевода';
         } else {
             $err_txt = 'получения';
         }
         $this->_setError("Указанный способ {$err_txt} денег не доступен. Не хватает данных на странице Финансы.");
         return false;
     }
     $data['tag' . $user_pfx] = $user->tag;
     $data['alien' . $user_pfx] = $user->alien;
     $data['name' . $user_pfx] = $user->name;
     $data['num' . $user_pfx] = $user->num;
     $data['ps' . $user_pfx] = $user->ps;
     $data['acc' . $user_pfx] = $user->acc;
     $data['inn' . $user_pfx] = $user->inn;
     //        $data['kpp' . $user_pfx] = $user->kpp;
     $data['nameBank' . $user_pfx] = $user->nameBank;
     $data['cityBank' . $user_pfx] = $user->cityBank;
     $data['cntrBank' . $user_pfx] = $user->cntrBank;
     $data['swift' . $user_pfx] = $user->swift;
     $data['corAccbank' . $user_pfx] = $user->corAccbank;
     $data['email' . $user_pfx] = $user->email;
     $lc = $this->getLC();
     if ($lc['lc_id'] && $lc['state'] == self::STATE_NEW) {
         $this->_setError('Аккредитив уже создан. Ожидается оплата.');
         return false;
     }
     if (!$this->_sbr->isEmp() && !$lc['id']) {
         $res = $this->_db->insert('pskb_lc', $data, 'id');
     } else {
         $res = $this->upLC($data, $this->_sbr->data['id'], 'sbr_id');
     }
     return $res;
 }