Class: NfeReader::Transport
- Inherits:
-
Object
- Object
- NfeReader::Transport
- Includes:
- AttributeHelper, CreatorHelper
- Defined in:
- lib/nfe_reader/transport.rb
Constant Summary
Constants included from AttributeHelper
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#carrier ⇒ Object
readonly
Returns the value of attribute carrier.
-
#cfop ⇒ Object
readonly
Returns the value of attribute cfop.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#ferry ⇒ Object
readonly
Returns the value of attribute ferry.
-
#hauling_palque ⇒ Object
readonly
Returns the value of attribute hauling_palque.
-
#hauling_rntc ⇒ Object
readonly
Returns the value of attribute hauling_rntc.
-
#hauling_state ⇒ Object
readonly
Returns the value of attribute hauling_state.
-
#icms_aliquot ⇒ Object
readonly
Returns the value of attribute icms_aliquot.
-
#icms_value ⇒ Object
readonly
Returns the value of attribute icms_value.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#seals ⇒ Object
readonly
Returns the value of attribute seals.
-
#service_value ⇒ Object
readonly
Returns the value of attribute service_value.
-
#vehicle_plaque ⇒ Object
readonly
Returns the value of attribute vehicle_plaque.
-
#vehicle_rntc ⇒ Object
readonly
Returns the value of attribute vehicle_rntc.
-
#vehicle_state ⇒ Object
readonly
Returns the value of attribute vehicle_state.
-
#volume_amount ⇒ Object
readonly
Returns the value of attribute volume_amount.
-
#volume_brand ⇒ Object
readonly
Returns the value of attribute volume_brand.
-
#volume_kind ⇒ Object
readonly
Returns the value of attribute volume_kind.
-
#volume_number ⇒ Object
readonly
Returns the value of attribute volume_number.
-
#wagon ⇒ Object
readonly
Returns the value of attribute wagon.
-
#weight_gross ⇒ Object
readonly
Returns the value of attribute weight_gross.
-
#weight_net ⇒ Object
readonly
Returns the value of attribute weight_net.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Transport
constructor
Fields Values:.
Methods included from CreatorHelper
#create_resource, #create_resources, #to_array
Methods included from AttributeHelper
#attributes, #attributes_to_hash
Constructor Details
#initialize(attrs = {}) ⇒ Transport
Fields Values:
modFrete: 0- Por conta do emitente;
1- Por conta do destinatário/remetente;
2- Por conta de terceiros;
9- Sem frete.
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 84 85 86 |
# File 'lib/nfe_reader/transport.rb', line 19 def initialize(attrs = {}) # Modalidade @kind = attrs[:modFrete] # == Grupo de Retenção do ICMS do transporte if attrs[:retTransp] # Valor do Servico @service_value = attrs[:retTransp][:vServ] # BC da Retenção do ICMS @base = attrs[:retTransp][:vBCRet] # Alíquota da Retenção @icms_aliquot = attrs[:retTransp][:pICMSRet] # Valor do ICMS Retido @icms_value = attrs[:retTransp][:vICMSRet] # CFOP @cfop = attrs[:retTransp][:CFOP] # Municipio gerador de ICMS @city = attrs[:retTransp][:cMunFG] end # == Veiculo if attrs[:veicTransp] # Placa @vehicle_plaque = attrs[:veicTransp][:placa] # Estado @vehicle_state = attrs[:veicTransp][:UF] # Registro Nacional de Transportador de Carga @vehicle_rntc = attrs[:veicTransp][:RNTC] end # == Reboque if attrs[:reboque] # Placa @hauling_palque = attrs[:reboque][:placa] # Estado @hauling_state = attrs[:reboque][:UF] # Registro Nacional de Transportador de Carga @hauling_rntc = attrs[:reboque][:RNTC] end # Vagao @wagon = attrs[:vagao] # Balsa @ferry = attrs[:balsa] # == Volume if attrs[:vol] # Quantidade de volumes @volume_amount = attrs[:vol][:qVol] # Espécie dos volumes @volume_kind = attrs[:vol][:esp] # Marca dos volumes @volume_brand = attrs[:vol][:marca] # Numeração dos volumes @volume_number = attrs[:vol][:nVol] # Peso Liquido @weight_net = attrs[:vol][:pesoL] # Peso Bruto @weight_gross = attrs[:vol][:pesoB] # Lacres @seals = to_array(attrs[:vol][:lacres]).join(', ') end # Transportadora if attrs[:transporta] @carrier = Carrier.new(attrs[:transporta]) end end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def base @base end |
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def carrier @carrier end |
#cfop ⇒ Object (readonly)
Returns the value of attribute cfop.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def cfop @cfop end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def city @city end |
#ferry ⇒ Object (readonly)
Returns the value of attribute ferry.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def ferry @ferry end |
#hauling_palque ⇒ Object (readonly)
Returns the value of attribute hauling_palque.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def hauling_palque @hauling_palque end |
#hauling_rntc ⇒ Object (readonly)
Returns the value of attribute hauling_rntc.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def hauling_rntc @hauling_rntc end |
#hauling_state ⇒ Object (readonly)
Returns the value of attribute hauling_state.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def hauling_state @hauling_state end |
#icms_aliquot ⇒ Object (readonly)
Returns the value of attribute icms_aliquot.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def icms_aliquot @icms_aliquot end |
#icms_value ⇒ Object (readonly)
Returns the value of attribute icms_value.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def icms_value @icms_value end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def kind @kind end |
#seals ⇒ Object (readonly)
Returns the value of attribute seals.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def seals @seals end |
#service_value ⇒ Object (readonly)
Returns the value of attribute service_value.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def service_value @service_value end |
#vehicle_plaque ⇒ Object (readonly)
Returns the value of attribute vehicle_plaque.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def vehicle_plaque @vehicle_plaque end |
#vehicle_rntc ⇒ Object (readonly)
Returns the value of attribute vehicle_rntc.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def vehicle_rntc @vehicle_rntc end |
#vehicle_state ⇒ Object (readonly)
Returns the value of attribute vehicle_state.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def vehicle_state @vehicle_state end |
#volume_amount ⇒ Object (readonly)
Returns the value of attribute volume_amount.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def volume_amount @volume_amount end |
#volume_brand ⇒ Object (readonly)
Returns the value of attribute volume_brand.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def volume_brand @volume_brand end |
#volume_kind ⇒ Object (readonly)
Returns the value of attribute volume_kind.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def volume_kind @volume_kind end |
#volume_number ⇒ Object (readonly)
Returns the value of attribute volume_number.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def volume_number @volume_number end |
#wagon ⇒ Object (readonly)
Returns the value of attribute wagon.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def wagon @wagon end |
#weight_gross ⇒ Object (readonly)
Returns the value of attribute weight_gross.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def weight_gross @weight_gross end |
#weight_net ⇒ Object (readonly)
Returns the value of attribute weight_net.
7 8 9 |
# File 'lib/nfe_reader/transport.rb', line 7 def weight_net @weight_net end |