Class: Nfe::Transport
- Inherits:
-
Object
- Object
- Nfe::Transport
- Defined in:
- lib/nfe_reader/transport.rb
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:.
- #set_seals(attrs = {}) ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Transport
Fields Values:
modFrete: 0- Por conta do emitente;
1- Por conta do destinat
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 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 |
# File 'lib/nfe_reader/transport.rb', line 16 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 = set_seals(attrs[:vol][:lacres]) end # Transportadora if attrs[:transporta] @carrier = Nfe::Carrier.new(attrs[:transporta]) end end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def base @base end |
#carrier ⇒ Object (readonly)
Returns the value of attribute carrier.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def carrier @carrier end |
#cfop ⇒ Object (readonly)
Returns the value of attribute cfop.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def cfop @cfop end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def city @city end |
#ferry ⇒ Object (readonly)
Returns the value of attribute ferry.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def ferry @ferry end |
#hauling_palque ⇒ Object (readonly)
Returns the value of attribute hauling_palque.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def hauling_palque @hauling_palque end |
#hauling_rntc ⇒ Object (readonly)
Returns the value of attribute hauling_rntc.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def hauling_rntc @hauling_rntc end |
#hauling_state ⇒ Object (readonly)
Returns the value of attribute hauling_state.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def hauling_state @hauling_state end |
#icms_aliquot ⇒ Object (readonly)
Returns the value of attribute icms_aliquot.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def icms_aliquot @icms_aliquot end |
#icms_value ⇒ Object (readonly)
Returns the value of attribute icms_value.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def icms_value @icms_value end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def kind @kind end |
#seals ⇒ Object (readonly)
Returns the value of attribute seals.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def seals @seals end |
#service_value ⇒ Object (readonly)
Returns the value of attribute service_value.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def service_value @service_value end |
#vehicle_plaque ⇒ Object (readonly)
Returns the value of attribute vehicle_plaque.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def vehicle_plaque @vehicle_plaque end |
#vehicle_rntc ⇒ Object (readonly)
Returns the value of attribute vehicle_rntc.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def vehicle_rntc @vehicle_rntc end |
#vehicle_state ⇒ Object (readonly)
Returns the value of attribute vehicle_state.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def vehicle_state @vehicle_state end |
#volume_amount ⇒ Object (readonly)
Returns the value of attribute volume_amount.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def volume_amount @volume_amount end |
#volume_brand ⇒ Object (readonly)
Returns the value of attribute volume_brand.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def volume_brand @volume_brand end |
#volume_kind ⇒ Object (readonly)
Returns the value of attribute volume_kind.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def volume_kind @volume_kind end |
#volume_number ⇒ Object (readonly)
Returns the value of attribute volume_number.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def volume_number @volume_number end |
#wagon ⇒ Object (readonly)
Returns the value of attribute wagon.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def wagon @wagon end |
#weight_gross ⇒ Object (readonly)
Returns the value of attribute weight_gross.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def weight_gross @weight_gross end |
#weight_net ⇒ Object (readonly)
Returns the value of attribute weight_net.
4 5 6 |
# File 'lib/nfe_reader/transport.rb', line 4 def weight_net @weight_net end |
Instance Method Details
#set_seals(attrs = {}) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/nfe_reader/transport.rb', line 85 def set_seals(attrs = {}) return unless attrs if attrs.is_a? Array seals = attrs.map { |l| l[:nLacre] }.join(', ') else seals = attrs[:nLacre] end seals end |