Class: BrNfe::Servico::Betha::V1::ConsultaNfse

Inherits:
Gateway show all
Defined in:
lib/br_nfe/servico/betha/v1/consulta_nfse.rb

Instance Attribute Summary collapse

Attributes inherited from BrNfe::Servico::Base

#lote_rps, #numero_lote_rps, #operacao

Attributes inherited from Base

#certificado_password, #certificado_path, #certificado_value, #env

Instance Method Summary collapse

Methods inherited from Gateway

#content_xml, #namespace_identifier, #namespaces, #request, #set_response, #version

Methods inherited from Base

#version

Methods inherited from BrNfe::Servico::Base

#initialize

Methods inherited from Base

#certificado, #certificado=, #certificado_obrigatorio?, #client_wsdl, #env_namespace, #namespace_identifier, #namespaces, #original_response, #response, #wsdl_encoding

Methods included from Helper::HaveEmitente

#emitente, #emitente=

Methods inherited from ActiveModelBase

#assign_attributes, #default_values, #initialize

Constructor Details

This class inherits a constructor from BrNfe::Servico::Base

Instance Attribute Details

#data_finalObject

Returns the value of attribute data_final.



13
14
15
# File 'lib/br_nfe/servico/betha/v1/consulta_nfse.rb', line 13

def data_final
  @data_final
end

#data_inicialObject

Returns the value of attribute data_inicial.



12
13
14
# File 'lib/br_nfe/servico/betha/v1/consulta_nfse.rb', line 12

def data_inicial
  @data_inicial
end

#numero_nfseObject

Returns the value of attribute numero_nfse.



11
12
13
# File 'lib/br_nfe/servico/betha/v1/consulta_nfse.rb', line 11

def numero_nfse
  @numero_nfse
end

Instance Method Details

#method_wsdlObject



27
28
29
# File 'lib/br_nfe/servico/betha/v1/consulta_nfse.rb', line 27

def method_wsdl
	:consultar_nfse
end

#wsdlObject



7
8
9
# File 'lib/br_nfe/servico/betha/v1/consulta_nfse.rb', line 7

def wsdl
	"http://e-gov.betha.com.br/e-nota-contribuinte-#{'test-' if env == :test}ws/consultarNfse?wsdl"
end

#xml_builderObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/br_nfe/servico/betha/v1/consulta_nfse.rb', line 31

def xml_builder
	Nokogiri::XML::Builder.new do |xml|
		xml.Temp {
			
			# Pestador / Emitente
			xml.__send__ :insert, Nokogiri::XML::DocumentFragment.parse( xml_prestador.doc.root.to_s )
			
			xml.NumeroNfse BrNfe::Helper.only_number(numero_nfse).max_size(15) if !numero_nfse.blank?
			xml.PeriodoEmissao {
				xml.DataInicial data_inicial
				xml.DataFinal   data_final
			}
		}
	end.doc.root
end