Class: Nfe::Reader::Ipi
- Inherits:
-
Object
- Object
- Nfe::Reader::Ipi
- Includes:
- AttributeHelper
- Defined in:
- lib/nfe_reader/taxation/ipi.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#cnpj ⇒ Object
readonly
Returns the value of attribute cnpj.
-
#cst ⇒ Object
readonly
Returns the value of attribute cst.
-
#cst_group ⇒ Object
readonly
Returns the value of attribute cst_group.
-
#frame_class ⇒ Object
readonly
Returns the value of attribute frame_class.
-
#frame_code ⇒ Object
readonly
Returns the value of attribute frame_code.
-
#ipi_base ⇒ Object
readonly
Returns the value of attribute ipi_base.
-
#percentage ⇒ Object
readonly
Returns the value of attribute percentage.
-
#seal ⇒ Object
readonly
Returns the value of attribute seal.
-
#seal_amount ⇒ Object
readonly
Returns the value of attribute seal_amount.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#value_unit ⇒ Object
readonly
Returns the value of attribute value_unit.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Ipi
constructor
A new instance of Ipi.
Methods included from AttributeHelper
#attributes, #attributes_to_hash
Constructor Details
#initialize(attrs = {}) ⇒ Ipi
Returns a new instance of Ipi.
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 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 10 def initialize(attrs = {}) # Classe de enquadramento do IPI para Cigarros e Bebidas @frame_class = attrs[:clEnq] # Codigo enquadramento @frame_code = attrs[:cEnq] # CNPJ do produtor @cnpj = attrs[:CNPJProd] # Código do selo de controle @seal = attrs[:cSelo] # Quantidade do selo de controle @seal_amount = attrs[:qSelo] # == Tributação if attrs[:IPITrib] # Código da situação tributária do IPI @cst = attrs[:IPITrib][:CST] # Valor da BC do IPI @ipi_base = attrs[:IPITrib][:vBC] # Quantidade total na unidade padrão para tributação @amount = attrs[:IPITrib][:qUnid] # Valor por Unidade Tributável @value_unit = attrs[:IPITrib][:vUnid] # % do IPI @percentage = attrs[:IPITrib][:pIPI] # Valor do IPI @value = attrs[:IPITrib][:vIPI] end if attrs[:IPINT] # Grupo do CST 01, 02, 03, 04, 51, 52, 53, 54 e 55 @cst_group = attrs[:IPINT][:CST] end end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def amount @amount end |
#cnpj ⇒ Object (readonly)
Returns the value of attribute cnpj.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def cnpj @cnpj end |
#cst ⇒ Object (readonly)
Returns the value of attribute cst.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def cst @cst end |
#cst_group ⇒ Object (readonly)
Returns the value of attribute cst_group.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def cst_group @cst_group end |
#frame_class ⇒ Object (readonly)
Returns the value of attribute frame_class.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def frame_class @frame_class end |
#frame_code ⇒ Object (readonly)
Returns the value of attribute frame_code.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def frame_code @frame_code end |
#ipi_base ⇒ Object (readonly)
Returns the value of attribute ipi_base.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def ipi_base @ipi_base end |
#percentage ⇒ Object (readonly)
Returns the value of attribute percentage.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def percentage @percentage end |
#seal ⇒ Object (readonly)
Returns the value of attribute seal.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def seal @seal end |
#seal_amount ⇒ Object (readonly)
Returns the value of attribute seal_amount.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def seal_amount @seal_amount end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def value @value end |
#value_unit ⇒ Object (readonly)
Returns the value of attribute value_unit.
7 8 9 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 def value_unit @value_unit end |