Class: NfeReader::Importation

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper
Defined in:
lib/nfe_reader/product/importation.rb

Overview

Declaração de Importação

Constant Summary

Constants included from AttributeHelper

AttributeHelper::WITHELIST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributeHelper

#attributes, #attributes_to_hash

Constructor Details

#initialize(attrs = {}) ⇒ Importation

Returns a new instance of Importation.



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
# File 'lib/nfe_reader/product/importation.rb', line 11

def initialize(attrs = {})
  # Número do Documento de Importação
  @number = attrs[:nDI]
  # Data de Registro do documento
  @date = attrs[:dDI]
  # Local de desembaraço
  @local = attrs[:xLocDesemb]
  # Sigla da UF onde ocorreu o Desembaraço Aduaneiro
  @state = attrs[:UFDesemb]
  # Data do Desembaraço Aduaneiro
  @customs_clearance = attrs[:dDesemb]
  # Código do Exportador
  @exporter = attrs[:cExportador]

  # Via de transporte internacional
  @transport = attrs[:tpViaTransp]
  # Valor da AFRMM - Adicional ao Frete para Renovação da Marinha Mercante
  @afrmm = attrs[:vAFRMM]
  # Forma de importação
  @intermediate_kind = attrs[:tpIntermedio]
  # CNPJ do adquirente
  @cnpj = attrs[:CNPJ]
  # Sigla da UF
  @uf_customer = attrs[:UFTerceiro]

  # Adições
  if attrs[:adi]
    # Numero da Adição
    @addition_number = attrs[:adi][:nAdicaonSeqAdic]
    # Numero sequencial do item
    @addition_sequence = attrs[:adi][:nSeqAdic]
    # Código do fabricante estrangeiro
    @manufacturer = attrs[:adi][:cFabricante]
    # Valor do desconto do item
    @addition_descount = attrs[:adi][:vDescDI]
    # Drawback
    @drawn = attrs[:adi][:nDraw]
  end
end

Instance Attribute Details

#addition_descountObject (readonly)

Returns the value of attribute addition_descount.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def addition_descount
  @addition_descount
end

#addition_numberObject (readonly)

Returns the value of attribute addition_number.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def addition_number
  @addition_number
end

#addition_sequenceObject (readonly)

Returns the value of attribute addition_sequence.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def addition_sequence
  @addition_sequence
end

#afrmmObject (readonly)

Returns the value of attribute afrmm.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def afrmm
  @afrmm
end

#cnpjObject (readonly)

Returns the value of attribute cnpj.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def cnpj
  @cnpj
end

#customs_clearanceObject (readonly)

Returns the value of attribute customs_clearance.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def customs_clearance
  @customs_clearance
end

#dateObject (readonly)

Returns the value of attribute date.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def date
  @date
end

#drawnObject (readonly)

Returns the value of attribute drawn.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def drawn
  @drawn
end

#exporterObject (readonly)

Returns the value of attribute exporter.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def exporter
  @exporter
end

#intermediate_kindObject (readonly)

Returns the value of attribute intermediate_kind.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def intermediate_kind
  @intermediate_kind
end

#localObject (readonly)

Returns the value of attribute local.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def local
  @local
end

#manufacturerObject (readonly)

Returns the value of attribute manufacturer.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def manufacturer
  @manufacturer
end

#numberObject (readonly)

Returns the value of attribute number.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def number
  @number
end

#stateObject (readonly)

Returns the value of attribute state.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def state
  @state
end

#transportObject (readonly)

Returns the value of attribute transport.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def transport
  @transport
end

#uf_customerObject (readonly)

Returns the value of attribute uf_customer.



7
8
9
# File 'lib/nfe_reader/product/importation.rb', line 7

def uf_customer
  @uf_customer
end