Class: Nfe::Models::Taxes::ICMS
- Inherits:
-
Object
- Object
- Nfe::Models::Taxes::ICMS
- Includes:
- ActiveModel::Model
- Defined in:
- lib/nfe/models/taxes/ICMS.rb
Instance Attribute Summary collapse
-
#cst ⇒ Object
Returns the value of attribute cst.
-
#modBC ⇒ Object
Returns the value of attribute modBC.
-
#modBCST ⇒ Object
Returns the value of attribute modBCST.
-
#motDesICMS ⇒ Object
Returns the value of attribute motDesICMS.
-
#orig ⇒ Object
Returns the value of attribute orig.
-
#pCredSN ⇒ Object
Returns the value of attribute pCredSN.
-
#pICMS ⇒ Object
Returns the value of attribute pICMS.
-
#pICMSST ⇒ Object
Returns the value of attribute pICMSST.
-
#pMVAST ⇒ Object
Returns the value of attribute pMVAST.
-
#pRedBC ⇒ Object
Returns the value of attribute pRedBC.
-
#pRedBCST ⇒ Object
Returns the value of attribute pRedBCST.
-
#vBC ⇒ Object
Returns the value of attribute vBC.
-
#vBCST ⇒ Object
Returns the value of attribute vBCST.
-
#vBCSTRet ⇒ Object
Returns the value of attribute vBCSTRet.
-
#vCredICMSSN ⇒ Object
Returns the value of attribute vCredICMSSN.
-
#vICMS ⇒ Object
Returns the value of attribute vICMS.
-
#vICMSDeson ⇒ Object
Returns the value of attribute vICMSDeson.
-
#vICMSST ⇒ Object
Returns the value of attribute vICMSST.
-
#vICMSSTRet ⇒ Object
Returns the value of attribute vICMSSTRet.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cst ⇒ Object
Returns the value of attribute cst.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def cst @cst end |
#modBC ⇒ Object
Returns the value of attribute modBC.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def modBC @modBC end |
#modBCST ⇒ Object
Returns the value of attribute modBCST.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def modBCST @modBCST end |
#motDesICMS ⇒ Object
Returns the value of attribute motDesICMS.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def motDesICMS @motDesICMS end |
#orig ⇒ Object
Returns the value of attribute orig.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def orig @orig end |
#pCredSN ⇒ Object
Returns the value of attribute pCredSN.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def pCredSN @pCredSN end |
#pICMS ⇒ Object
Returns the value of attribute pICMS.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def pICMS @pICMS end |
#pICMSST ⇒ Object
Returns the value of attribute pICMSST.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def pICMSST @pICMSST end |
#pMVAST ⇒ Object
Returns the value of attribute pMVAST.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def pMVAST @pMVAST end |
#pRedBC ⇒ Object
Returns the value of attribute pRedBC.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def pRedBC @pRedBC end |
#pRedBCST ⇒ Object
Returns the value of attribute pRedBCST.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def pRedBCST @pRedBCST end |
#vBC ⇒ Object
Returns the value of attribute vBC.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vBC @vBC end |
#vBCST ⇒ Object
Returns the value of attribute vBCST.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vBCST @vBCST end |
#vBCSTRet ⇒ Object
Returns the value of attribute vBCSTRet.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vBCSTRet @vBCSTRet end |
#vCredICMSSN ⇒ Object
Returns the value of attribute vCredICMSSN.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vCredICMSSN @vCredICMSSN end |
#vICMS ⇒ Object
Returns the value of attribute vICMS.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vICMS @vICMS end |
#vICMSDeson ⇒ Object
Returns the value of attribute vICMSDeson.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vICMSDeson @vICMSDeson end |
#vICMSST ⇒ Object
Returns the value of attribute vICMSST.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vICMSST @vICMSST end |
#vICMSSTRet ⇒ Object
Returns the value of attribute vICMSSTRet.
19 20 21 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 19 def vICMSSTRet @vICMSSTRet end |
Class Method Details
.attr_icms ⇒ Object
7 8 9 10 11 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 7 def self.attr_icms [:orig, :csosn, :cst, :modBC, :vBC, :pRedBC, :pICMS, :vICMS, :modBCST, :pMVAST, :pRedBCST, :vBCST, :pICMSST, :vICMSST, :pCredSN, :vCredICMSSN, :motDesICMS, :vBCSTRet, :vICMSSTRet, :vICMSDeson] end |
.cst_types ⇒ Object
13 14 15 16 17 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 13 def self.cst_types ["00", "10", "20", "30", "40", "41", "50", "51", "60", "70", "90", "101", "102", "103", "300", "400", "201", "202", "203", "500", "900"] end |
Instance Method Details
#parse!(xml) ⇒ Object
36 37 38 39 40 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 36 def parse!(xml) doc = Nokogiri::XML(xml) reset_values parse_xml(doc) end |
#present? ⇒ Boolean
29 30 31 32 33 34 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 29 def present? [@orig, @cst, @modBC, @vBC, @pRedBC, @pICMS, @vICMS, @modBCST, @pMVAST, @pRedBCST, @vBCST, @pICMSST, @vICMSST, @pCredSN, @vCredICMSSN, @motDesICMS, @vBCSTRet, @vICMSSTRet]. reduce(false) {|memo, obj| memo || obj.present?} end |
#to_xml ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/nfe/models/taxes/ICMS.rb', line 42 def to_xml xml = Builder::XmlMarkup.new to_object_xml(xml) xml.target! end |