Class: Nfe::Ipi
- Inherits:
-
Object
- Object
- Nfe::Ipi
- 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.
Constructor Details
#initialize(attrs = {}) ⇒ Ipi
Returns a new instance of Ipi.
7 8 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 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 7 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.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def amount @amount end |
#cnpj ⇒ Object (readonly)
Returns the value of attribute cnpj.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def cnpj @cnpj end |
#cst ⇒ Object (readonly)
Returns the value of attribute cst.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def cst @cst end |
#cst_group ⇒ Object (readonly)
Returns the value of attribute cst_group.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def cst_group @cst_group end |
#frame_class ⇒ Object (readonly)
Returns the value of attribute frame_class.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def frame_class @frame_class end |
#frame_code ⇒ Object (readonly)
Returns the value of attribute frame_code.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def frame_code @frame_code end |
#ipi_base ⇒ Object (readonly)
Returns the value of attribute ipi_base.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def ipi_base @ipi_base end |
#percentage ⇒ Object (readonly)
Returns the value of attribute percentage.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def percentage @percentage end |
#seal ⇒ Object (readonly)
Returns the value of attribute seal.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def seal @seal end |
#seal_amount ⇒ Object (readonly)
Returns the value of attribute seal_amount.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def seal_amount @seal_amount end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def value @value end |
#value_unit ⇒ Object (readonly)
Returns the value of attribute value_unit.
4 5 6 |
# File 'lib/nfe_reader/taxation/ipi.rb', line 4 def value_unit @value_unit end |