<?php
final class DModelwsceopedidowsprocessosvenda extends Model {

  public function getProcessosVenda(){
    //Lista os processos de venda habilitados para o ecommerce
    $this->load->type('tipofuturaserver');

    $sql = "select
          c.ID as id_empresa,
          c.RAZAO_SOCIAL as razao_social,
          cp.ID as id_processo_futura,
          cp.ID_ECOMMERCE as id_processo_ecommerce
          from SYS_CONTROLE_PROCESSO cp
          inner join CADASTRO c on (c.id = cp.FK_EMPRESA) and c.STATUS = ".Type_CadastroStatus::TpCadSt_Ativo.
          " where cp.CHK_ECOMMERCE = 'S' and not cp.ID_ECOMMERCE is null";

          $result = $this->wsceo->getConsulta($sql);

          if ($this->wsceo->getError()) {
              return $this->wsceo->getError();
          }

          return $result;
  }

}