예제 #1
0
 public function testDeveGerarOhtmlDoLoteQuandoPossuirGuias()
 {
     $smarty = $this->getMock('\\Smarty');
     $smarty->expects($this->at(0))->method('assign')->with('guiaViaInfo');
     $smarty->expects($this->at(1))->method('assign')->with('barcode');
     $smarty->expects($this->at(2))->method('assign')->with('guia');
     $smarty->expects($this->at(3))->method('fetch')->with('gnre.tpl')->will($this->returnValue('<html></html>'));
     $smartyFactory = $this->getMock('\\Sped\\Gnre\\Render\\SmartyFactory');
     $smartyFactory->expects($this->once())->method('create')->will($this->returnValue($smarty));
     $html = new Html();
     $html->setSmartyFactory($smartyFactory);
     $lote = new \Sped\Gnre\Sefaz\Lote();
     $lote->addGuia(new \Sped\Gnre\Sefaz\Guia());
     $html->create($lote);
     $this->assertNotEmpty($html->getHtml());
 }
예제 #2
0
 /**
  * @return \Sped\Gnre\Sefaz\Lote
  */
 public function getLote()
 {
     $lote = new \Sped\Gnre\Sefaz\Lote();
     for ($i = 0; $i < sizeof($this->dadosArquivo); $i++) {
         $this->index = $i;
         $this->getIdentificador();
         $this->sequencialGuiaErroValidacao = null;
         if ($this->identificador == 0) {
             $this->getTipoIdentificadorDoSolicitante();
             $this->getIdentificadorDoSolicitante();
             $this->getNumeroDoProtocoloDoLote();
             $this->getAmbiente();
         } else {
             if ($this->identificador == 1) {
                 $this->lote['lote'][$i] = new \Sped\Gnre\Sefaz\Guia();
                 $this->getSequencialGuia();
                 $this->getSituacaoGuia();
                 $this->getUfFavorecida();
                 $this->getCodigoReceita();
                 $this->getTipoEmitente();
                 $this->getDocumentoEmitente();
                 $this->getEnderecoEmitente();
                 $this->getMunicipioEmitente();
                 $this->getUFEmitente();
                 $this->getCEPEmitente();
                 $this->getTelefoneEmitente();
                 $this->getTipoDocDestinatario();
                 $this->getDocumentoDestinatario();
                 $this->getMunicipioDestinatario();
                 $this->getProduto();
                 $this->getNumeroDocumentoDeOrigem();
                 $this->getConvenio();
                 $this->getInformacoesComplementares();
                 $this->getDataDeVencimento();
                 $this->getDataLimitePagamento();
                 $this->getPeriodoReferencia();
                 $this->getParcela();
                 $this->getValorPrincipal();
                 $this->getAtualizacaoMonetaria();
                 $this->getJuros();
                 $this->getMulta();
                 $this->getRepresentacaoNumerica();
                 $this->getCodigoBarras();
                 $this->getNumeroDeControle();
                 $this->getIdentificadorGuia();
                 $lote->addGuia($this->lote['lote'][$i]);
             } else {
                 if ($this->identificador == 9) {
                     $this->getNumeroProtocolo();
                     $this->getTotalGuias();
                     $this->getHashDeValidacao();
                 } else {
                     if ($this->identificador == 2) {
                         $this->getSequencialGuiaErroValidacao();
                         $this->getNomeCampo();
                         $this->getCodigoMotivoRejeicao();
                         $this->getDescricaoMotivoRejeicao();
                     }
                 }
             }
         }
     }
     $this->aplicarParser();
     return $lote;
 }
예제 #3
0
    {
    }
    public function getCertificatePemFile()
    {
    }
    public function getEnvironment()
    {
    }
    public function getPrivateKey()
    {
    }
    public function getProxyIp()
    {
    }
    public function getProxyPass()
    {
    }
    public function getProxyPort()
    {
    }
    public function getProxyUser()
    {
    }
}
$xml = file_get_contents('estrutura-lote-completo-gnre.xml');
$minhaConfiguracao = new MySetup();
$guia = new Sped\Gnre\Sefaz\Guia();
$lote = new Sped\Gnre\Sefaz\Lote();
$lote->addGuia($guia);
$webService = new Sped\Gnre\Webservice\Connection($minhaConfiguracao, $lote->getHeaderSoap(), $lote->toXml());
echo $webService->doRequest($lote->soapAction());
예제 #4
0
$guia->c15_convenio = 546456;
$guia->c16_razaoSocialEmitente = 'GNRE PHP EMITENTE';
$guia->c17_inscricaoEstadualEmitente = 56756;
$guia->c18_enderecoEmitente = 'Queens St';
$guia->c19_municipioEmitente = 5300108;
$guia->c20_ufEnderecoEmitente = 'DF';
$guia->c21_cepEmitente = '08215917';
$guia->c22_telefoneEmitente = 1199999999;
$guia->c34_tipoIdentificacaoDestinatario = 1;
$guia->c35_idContribuinteDestinatario = 86268158000162;
$guia->c36_inscricaoEstadualDestinatario = 10809181;
$guia->c37_razaoSocialDestinatario = 'RAZAO SOCIAL GNRE PHP DESTINATARIO';
$guia->c38_municipioDestinatario = 2702306;
$guia->c33_dataPagamento = '2015-11-30';
$guia->retornoInformacoesComplementares = 'teste teste teste';
$guia->retornoAtualizacaoMonetaria = 1.88;
$guia->retornoNumeroDeControle = '0000000000000000';
$guia->retornoCodigoDeBarras = '1118929812912011000000001818181000000001212';
$guia->retornoRepresentacaoNumerica = '11189298129120110000000018181810000000012121201';
$guia->retornoJuros = 2.78;
$guia->retornoMulta = 3.55;
$guia->mes = '05';
$guia->ano = 2015;
$guia->parcela = 2;
$guia->periodo = 2014;
$lote = new Sped\Gnre\Sefaz\Lote();
$lote->addGuia($guia);
$html = new Sped\Gnre\Render\Html();
$html->create($lote);
$pdf = new Sped\Gnre\Render\Pdf();
$pdf->create($html)->stream('gnre.pdf', array('Attachment' => 0));
예제 #5
0
$guia->c14_dataVencimento = '01/05/2015';
$guia->c15_convenio = 546456;
$guia->c16_razaoSocialEmitente = 'GNRE PHP EMITENTE';
$guia->c17_inscricaoEstadualEmitente = 56756;
$guia->c18_enderecoEmitente = 'Queens St';
$guia->c19_municipioEmitente = 5300108;
$guia->c20_ufEnderecoEmitente = 'DF';
$guia->c21_cepEmitente = '08215917';
$guia->c22_telefoneEmitente = 1199999999;
$guia->c34_tipoIdentificacaoDestinatario = 1;
$guia->c35_idContribuinteDestinatario = 86268158000162;
$guia->c36_inscricaoEstadualDestinatario = 10809181;
$guia->c37_razaoSocialDestinatario = 'RAZAO SOCIAL GNRE PHP DESTINATARIO';
$guia->c38_municipioDestinatario = 2702306;
$guia->c33_dataPagamento = '2015-11-30';
$guia->retornoInformacoesComplementares = 'teste teste teste';
$guia->retornoAtualizacaoMonetaria = 1.88;
$guia->retornoNumeroDeControle = '0000000000000000';
$guia->retornoCodigoDeBarras = '1118929812912011000000001818181000000001212';
$guia->retornoRepresentacaoNumerica = '11189298129120110000000018181810000000012121201';
$guia->retornoJuros = 2.78;
$guia->retornoMulta = 3.55;
$guia->mes = '05';
$guia->ano = 2015;
$guia->parcela = 2;
$guia->periodo = 2014;
$guia->c39_camposExtras = array(array('campoExtra' => array('codigo' => 666, 'tipo' => 'TXT', 'valor' => 'GNRE')), array('campoExtra' => array('codigo' => 111, 'tipo' => 'INT', 'valor' => 'GNRE2')));
$lote = new Sped\Gnre\Sefaz\Lote();
$lote->addGuia($guia);
header('Content-Type: text/xml');
print $lote->toXml();