Class: NfeReader::Document
- Inherits:
-
Object
- Object
- NfeReader::Document
- Includes:
- AttributeHelper
- Defined in:
- lib/nfe_reader/document.rb
Overview
Documento Fiscal Referenciado
Constant Summary
Constants included from AttributeHelper
Instance Attribute Summary collapse
-
#cte_key ⇒ Object
readonly
Returns the value of attribute cte_key.
-
#ecf_model ⇒ Object
readonly
Returns the value of attribute ecf_model.
-
#ecf_number ⇒ Object
readonly
Returns the value of attribute ecf_number.
-
#ecf_operation ⇒ Object
readonly
Returns the value of attribute ecf_operation.
-
#farmer_cnpj ⇒ Object
readonly
Returns the value of attribute farmer_cnpj.
-
#farmer_cpf ⇒ Object
readonly
Returns the value of attribute farmer_cpf.
-
#farmer_ie ⇒ Object
readonly
Returns the value of attribute farmer_ie.
-
#farmer_model ⇒ Object
readonly
Returns the value of attribute farmer_model.
-
#farmer_number ⇒ Object
readonly
Returns the value of attribute farmer_number.
-
#farmer_serie ⇒ Object
readonly
Returns the value of attribute farmer_serie.
-
#farmer_state ⇒ Object
readonly
Returns the value of attribute farmer_state.
-
#farmer_year ⇒ Object
readonly
Returns the value of attribute farmer_year.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#nfe_cnpj ⇒ Object
readonly
Returns the value of attribute nfe_cnpj.
-
#nfe_model ⇒ Object
readonly
Returns the value of attribute nfe_model.
-
#nfe_number ⇒ Object
readonly
Returns the value of attribute nfe_number.
-
#nfe_serie ⇒ Object
readonly
Returns the value of attribute nfe_serie.
-
#nfe_state ⇒ Object
readonly
Returns the value of attribute nfe_state.
-
#nfe_year ⇒ Object
readonly
Returns the value of attribute nfe_year.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Document
constructor
Fields Values mod: refNF: 01 - modelo 01 refNFP: 04 - NF de Produtor, 01 - NF (v2.0) refECF: 2B - Cupom Fiscal emitido por máquina registradora (não ECF), 2C - Cupom Fiscal PDV, 2D - Cupom Fiscal (emitido por ECF) (v2.0).
Methods included from AttributeHelper
#attributes, #attributes_to_hash
Constructor Details
#initialize(attrs = {}) ⇒ Document
Fields Values
mod:
refNF: 01 - modelo 01
refNFP: 04 - NF de Produtor,
01 - NF (v2.0)
refECF: 2B - Cupom Fiscal emitido por máquina registradora (não ECF),
2C - Cupom Fiscal PDV,
2D - Cupom Fiscal (emitido por ECF) (v2.0)
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 |
# File 'lib/nfe_reader/document.rb', line 21 def initialize(attrs = {}) # Chave da NF-e @key = attrs[:refNFe] # Referencia uma NF-e if attrs[:refNF] # Estado @nfe_state = attrs[:refNF][:cUF] # Ano e mes @nfe_year = attrs[:refNF][:AAMM] # CNPJ do emitente @nfe_cnpj = attrs[:refNF][:CNPJ] # Modelo do Documento Fiscal @nfe_model = attrs[:refNF][:mod] # Serie Documento Fiscal @nfe_serie = attrs[:refNF][:serie] # Numero Documento Fiscal @nfe_number = attrs[:refNF][:nNF] end # NF de Produtor Rural if attrs[:refNFP] # Estado @farmer_state = attrs[:refNFP][:cUF] # Ano e mes @farmer_year = attrs[:refNFP][:AAMM] # CNPJ do emitente @farmer_cnpj = attrs[:refNFP][:CNPJ] # CPF do emitente @farmer_cpf = attrs[:refNFP][:CPF] # IE do emitente @farmer_ie = attrs[:refNFP][:IE] # Modelo do Documento Fiscal @farmer_model = attrs[:refNFP][:mod] # Serie Documento Fiscal @farmer_serie = attrs[:refNFP][:serie] # Numero Documento Fiscal @farmer_number = attrs[:refNFP][:nNF] end # CT-e @cte_key = attrs[:refCTe] # Referencia uma ECF if attrs[:refECF] # Modelo do Documento Fiscal @ecf_model = attrs[:refECF][:mod] # Número de ordem sequencial do ECF @ecf_number = attrs[:refECF][:nECF] # Número do Contador de Ordem de Operação @ecf_operation = attrs[:refECF][:nCOO] end end |
Instance Attribute Details
#cte_key ⇒ Object (readonly)
Returns the value of attribute cte_key.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def cte_key @cte_key end |
#ecf_model ⇒ Object (readonly)
Returns the value of attribute ecf_model.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def ecf_model @ecf_model end |
#ecf_number ⇒ Object (readonly)
Returns the value of attribute ecf_number.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def ecf_number @ecf_number end |
#ecf_operation ⇒ Object (readonly)
Returns the value of attribute ecf_operation.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def ecf_operation @ecf_operation end |
#farmer_cnpj ⇒ Object (readonly)
Returns the value of attribute farmer_cnpj.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_cnpj @farmer_cnpj end |
#farmer_cpf ⇒ Object (readonly)
Returns the value of attribute farmer_cpf.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_cpf @farmer_cpf end |
#farmer_ie ⇒ Object (readonly)
Returns the value of attribute farmer_ie.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_ie @farmer_ie end |
#farmer_model ⇒ Object (readonly)
Returns the value of attribute farmer_model.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_model @farmer_model end |
#farmer_number ⇒ Object (readonly)
Returns the value of attribute farmer_number.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_number @farmer_number end |
#farmer_serie ⇒ Object (readonly)
Returns the value of attribute farmer_serie.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_serie @farmer_serie end |
#farmer_state ⇒ Object (readonly)
Returns the value of attribute farmer_state.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_state @farmer_state end |
#farmer_year ⇒ Object (readonly)
Returns the value of attribute farmer_year.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def farmer_year @farmer_year end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def key @key end |
#nfe_cnpj ⇒ Object (readonly)
Returns the value of attribute nfe_cnpj.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def nfe_cnpj @nfe_cnpj end |
#nfe_model ⇒ Object (readonly)
Returns the value of attribute nfe_model.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def nfe_model @nfe_model end |
#nfe_number ⇒ Object (readonly)
Returns the value of attribute nfe_number.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def nfe_number @nfe_number end |
#nfe_serie ⇒ Object (readonly)
Returns the value of attribute nfe_serie.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def nfe_serie @nfe_serie end |
#nfe_state ⇒ Object (readonly)
Returns the value of attribute nfe_state.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def nfe_state @nfe_state end |
#nfe_year ⇒ Object (readonly)
Returns the value of attribute nfe_year.
7 8 9 |
# File 'lib/nfe_reader/document.rb', line 7 def nfe_year @nfe_year end |