Class: NfseGyn::MockGerarNfseResponse

Inherits:
GerarNfse::Response show all
Defined in:
lib/nfse_gyn/mock_gerar_nfse_response.rb

Instance Method Summary collapse

Methods inherited from GerarNfse::Response

#body, #error?, #errors

Methods inherited from Response

#class_name, #error?, #error_message, #link, #municipal_registration, #number, #output, #successful?, #verification_code

Constructor Details

#initialize(request) ⇒ MockGerarNfseResponse

Returns a new instance of MockGerarNfseResponse.



3
4
5
6
# File 'lib/nfse_gyn/mock_gerar_nfse_response.rb', line 3

def initialize(request)
  super(nil)
  @request = request
end

Instance Method Details

#contentObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/nfse_gyn/mock_gerar_nfse_response.rb', line 8

def content
  {
    'ListaNfse' => {
      'CompNfse' => {
        'Nfse' => {
          'InfNfse' => {
            'Numero' => '370',
            'CodigoVerificacao' => 'MB94-C3ZA',
            'DataEmissao' => @request[:data_emissao],
            'OutrasInformacoes' => 'OUTRAS INFORMACOES SOBRE O SERVICO.',
            'ValoresNfse' => {
              'BaseCalculo' => '0',
              'Aliquota' => '5',
              'ValorIss' => '0'
            }, 'DeclaracaoPrestacaoServico' => {
              'IdentificacaoRps' => {
                'Numero' => '14',
                'Serie' => 'UNICA',
                'Tipo' => '1'
              },
              'DataEmissao' => @request[:data_emissao],
              'Competencia' => @request[:data_emissao],
              'Servico' => {
                'Valores' => {
                  'ValorServicos' => @request[:total],
                  'ValorDeducoes' => '0',
                  'ValorPis' => '0.00',
                  'ValorCofins' => '0.00',
                  'ValorInss' => '0.00',
                  'ValorIr' => '0.00',
                  'ValorCsll' => '0.00',
                  'ValorIss' => '0',
                  'Aliquota' => '5',
                  'DescontoIncondicionado' => '0.00'
                },
                'IssRetido' => '2',
                'CodigoTributacaoMunicipio' => '791120000',
                'Discriminacao' => @request[:description],
                'CodigoMunicipio' => '0025300',
                'ExigibilidadeISS' => '1',
                'MunicipioIncidencia' => '0025300'
              }, 'Prestador' => {
                'IdentificacaoPrestador' => {
                  'CpfCnpj' => {
                    'Cnpj' => NfseGyn.configuration.cnpj
                  }, 'InscricaoMunicipal' => NfseGyn.configuration.inscricao_municipal
                }
              }, 'Tomador' => {
                'IdentificacaoTomador' => {
                  'CpfCnpj' => {
                    (@request[:customer][:document_type]).to_s => (@request[:customer][:document_number]).to_s
                  }
                },
                'RazaoSocial' => @request[:customer][:name],
                'Endereco' => {
                  'Endereco' => 'RUA DAS AMENDOEIRAS',
                  'Numero' => '30',
                  'Complemento' => 'LOTE 4',
                  'Bairro' => 'CENTRO',
                  'CodigoMunicipio' => '0025300',
                  'Uf' => 'GO',
                  'Cep' => '74823350'
                }
              }, 'OptanteSimplesNacional' => '2'
            }
          }
        }
      }
    }, 'ListaMensagemRetorno' => {
      'MensagemRetorno' => {
        'Codigo' => 'L000',
        'Mensagem' => 'NORMAL'
      }
    }
  }
end