Class: Nfe::Importation

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

Overview

Declaração de Importação

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Importation

Returns a new instance of Importation.



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

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.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def addition_descount
  @addition_descount
end

#addition_numberObject (readonly)

Returns the value of attribute addition_number.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def addition_number
  @addition_number
end

#addition_sequenceObject (readonly)

Returns the value of attribute addition_sequence.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def addition_sequence
  @addition_sequence
end

#customs_clearanceObject (readonly)

Returns the value of attribute customs_clearance.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def customs_clearance
  @customs_clearance
end

#dateObject (readonly)

Returns the value of attribute date.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def date
  @date
end

#drawnObject (readonly)

Returns the value of attribute drawn.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def drawn
  @drawn
end

#exporterObject (readonly)

Returns the value of attribute exporter.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def exporter
  @exporter
end

#localObject (readonly)

Returns the value of attribute local.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def local
  @local
end

#manufacturerObject (readonly)

Returns the value of attribute manufacturer.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def manufacturer
  @manufacturer
end

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def number
  @number
end

#stateObject (readonly)

Returns the value of attribute state.



5
6
7
# File 'lib/nfe_reader/product/importation.rb', line 5

def state
  @state
end