From eda2992ec72e637175853601cbfdd9b41bbf57c8 Mon Sep 17 00:00:00 2001 From: Pedro Casado Date: Fri, 28 Feb 2020 09:14:35 -0300 Subject: [PATCH] return complete nfse information --- README.md | 55 ++++++++++++++++--- examples/NotaCarioca/GerarNfse.php | 55 ++++++++++++++++--- .../GerarNfseNotaCariocaFactory.php | 8 +-- 3 files changed, 97 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 29e8389..5940b54 100644 --- a/README.md +++ b/README.md @@ -138,16 +138,57 @@ if ($soapHandler->isSuccess($response)) { array (size=1) 'nfse' => - array (size=5) - 'Numero' => string '1' (length=2) - 'CodigoVerificacao' => string 'AMXA-UHBL' (length=9) - 'DataEmissao' => string '2020-02-12T14:31:39' (length=19) + array (size=14) + 'Numero' => string '43' (length=2) + 'CodigoVerificacao' => string 'VZW2-EJIB' (length=9) + 'DataEmissao' => string '2020-02-28T09:09:55' (length=19) 'IdentificacaoRps' => array (size=3) - 'Numero' => string '1' (length=3) - 'Serie' => string 'A' (length=1) + 'Numero' => string '1' (length=1) + 'Serie' => string 'A' (length=2) 'Tipo' => string '1' (length=1) - 'DataEmissaoRps' => string '2020-02-12' (length=10) + 'DataEmissaoRps' => string '2020-02-28' (length=10) + 'NaturezaOperacao' => string '1' (length=1) + 'RegimeEspecialTributacao' => string '3' (length=1) + 'OptanteSimplesNacional' => string '2' (length=1) + 'IncentivadorCultural' => string '2' (length=1) + 'Competencia' => string '2020-02-28T00:00:00' (length=19) + 'Servico' => + array (size=5) + 'Valores' => + array (size=3) + 'ValorServicos' => string '228.6' (length=5) + 'IssRetido' => string '2' (length=1) + 'ValorLiquidoNfse' => string '228.6' (length=5) + 'ItemListaServico' => string '1002' (length=4) + 'CodigoTributacaoMunicipio' => string '100203' (length=6) + 'Discriminacao' => string 'Pedido #1111 - Itens: #123 , #124' (length=33) + 'CodigoMunicipio' => string '3304557' (length=7) + 'PrestadorServico' => + array (size=4) + 'IdentificacaoPrestador' => + array (size=2) + 'Cnpj' => string '11111111111111' (length=14) + 'InscricaoMunicipal' => string '1111111' (length=7) + 'RazaoSocial' => string '11111111' (length=48) + 'Endereco' => + array (size=7) + 'Endereco' => string '11111' (length=39) + 'Numero' => string '1111' (length=3) + 'Complemento' => string '11111' (length=15) + 'Bairro' => string '11111' (length=7) + 'CodigoMunicipio' => string '3304557' (length=7) + 'Uf' => string 'RJ' (length=2) + 'Cep' => string '1111111' (length=8) + 'Contato' => string '' (length=0) + 'TomadorServico' => + array (size=2) + 'IdentificacaoTomador' => string '' (length=0) + 'Endereco' => string '' (length=0) + 'OrgaoGerador' => + array (size=2) + 'CodigoMunicipio' => string '3304557' (length=7) + 'Uf' => string 'RJ' (length=2) */ ``` diff --git a/examples/NotaCarioca/GerarNfse.php b/examples/NotaCarioca/GerarNfse.php index ad0b741..78697e3 100644 --- a/examples/NotaCarioca/GerarNfse.php +++ b/examples/NotaCarioca/GerarNfse.php @@ -116,14 +116,55 @@ array (size=1) 'nfse' => - array (size=5) - 'Numero' => string '1' (length=2) - 'CodigoVerificacao' => string 'AMXA-UHBL' (length=9) - 'DataEmissao' => string '2020-02-12T14:31:39' (length=19) + array (size=14) + 'Numero' => string '43' (length=2) + 'CodigoVerificacao' => string 'VZW2-EJIB' (length=9) + 'DataEmissao' => string '2020-02-28T09:09:55' (length=19) 'IdentificacaoRps' => array (size=3) - 'Numero' => string '1' (length=3) - 'Serie' => string 'A' (length=1) + 'Numero' => string '1' (length=1) + 'Serie' => string 'A' (length=2) 'Tipo' => string '1' (length=1) - 'DataEmissaoRps' => string '2020-02-12' (length=10) + 'DataEmissaoRps' => string '2020-02-28' (length=10) + 'NaturezaOperacao' => string '1' (length=1) + 'RegimeEspecialTributacao' => string '3' (length=1) + 'OptanteSimplesNacional' => string '2' (length=1) + 'IncentivadorCultural' => string '2' (length=1) + 'Competencia' => string '2020-02-28T00:00:00' (length=19) + 'Servico' => + array (size=5) + 'Valores' => + array (size=3) + 'ValorServicos' => string '228.6' (length=5) + 'IssRetido' => string '2' (length=1) + 'ValorLiquidoNfse' => string '228.6' (length=5) + 'ItemListaServico' => string '1002' (length=4) + 'CodigoTributacaoMunicipio' => string '100203' (length=6) + 'Discriminacao' => string 'Pedido #1111 - Itens: #123 , #124' (length=33) + 'CodigoMunicipio' => string '3304557' (length=7) + 'PrestadorServico' => + array (size=4) + 'IdentificacaoPrestador' => + array (size=2) + 'Cnpj' => string '11111111111111' (length=14) + 'InscricaoMunicipal' => string '1111111' (length=7) + 'RazaoSocial' => string '11111111' (length=48) + 'Endereco' => + array (size=7) + 'Endereco' => string '11111' (length=39) + 'Numero' => string '1111' (length=3) + 'Complemento' => string '11111' (length=15) + 'Bairro' => string '11111' (length=7) + 'CodigoMunicipio' => string '3304557' (length=7) + 'Uf' => string 'RJ' (length=2) + 'Cep' => string '1111111' (length=8) + 'Contato' => string '' (length=0) + 'TomadorServico' => + array (size=2) + 'IdentificacaoTomador' => string '' (length=0) + 'Endereco' => string '' (length=0) + 'OrgaoGerador' => + array (size=2) + 'CodigoMunicipio' => string '3304557' (length=7) + 'Uf' => string 'RJ' (length=2) */ diff --git a/src/NotaCarioca/GerarNfseNotaCariocaFactory.php b/src/NotaCarioca/GerarNfseNotaCariocaFactory.php index 0a3f237..c0c15bb 100644 --- a/src/NotaCarioca/GerarNfseNotaCariocaFactory.php +++ b/src/NotaCarioca/GerarNfseNotaCariocaFactory.php @@ -31,13 +31,7 @@ public function formatSuccessResponse(string $responseXml): array { $resultArr = $this->getEncoder()->decode($responseXml, ''); - $responseArr['nfse'] = [ - 'Numero' => $resultArr['CompNfse']['Nfse']['InfNfse']['Numero'], - 'CodigoVerificacao' => $resultArr['CompNfse']['Nfse']['InfNfse']['CodigoVerificacao'], - 'DataEmissao' => $resultArr['CompNfse']['Nfse']['InfNfse']['DataEmissao'], - 'IdentificacaoRps' => $resultArr['CompNfse']['Nfse']['InfNfse']['IdentificacaoRps'], - 'DataEmissaoRps' => $resultArr['CompNfse']['Nfse']['InfNfse']['DataEmissaoRps'], - ]; + $responseArr['nfse'] = $resultArr['CompNfse']['Nfse']['InfNfse']; return $responseArr; }