/** * Monta a chave de acesso. * @return string */ protected function getID() { $chave = new InfoChNFe(); $chave->cUF = $this->ide->cUF; $chave->dhEmi = $this->ide->dhEmi; $chave->cnpj = $this->emit->CNPJ; $chave->mod = $this->ide->mod; $chave->serie = $this->ide->serie; $chave->nNF = $this->ide->nNF; $chave->tpEmis = $this->ide->tpEmis; $chave->cNF = $this->ide->cNF; $chNFe = $chave->montarChNFe(); // Setando o numero gerado e o codigo verificador gerado. $this->ide->cNF = $chave->cNF; $this->ide->cDV = $chave->cDV; return $chNFe; }
public function consulta($chNFe, $tpAmb) { $info = InfoChNFe::getChNFeInfo($chNFe); $method = Sefaz::getMethodInfo(Sefaz::getAmbiente($tpAmb), $info->cUF, Sefaz::mtConsulta); $mensagem = NFEConsultaMsg::loadDOM($tpAmb, $chNFe); $header = NFEConsultaHeader::loadDOM($info->cUF, $method->version); $body = NFEConsultaBody::loadDOM($mensagem); $this->validar($mensagem, $method->version); return new ConsultaRetorno($this->soap($method, $header, $body)); }
/** * @return InfoChNFe */ public function getChaveInfo($tag, $prefixo) { return InfoChNFe::getIDInfo($this->getChNFeTag($tag, $prefixo)); }