Class: FE::Document::Exoneration
- Inherits:
-
Object
- Object
- FE::Document::Exoneration
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/facturacr/document/exoneration.rb
Constant Summary collapse
- DOCUMENT_TYPES =
{ "01" => "Compras Autorizadas", "02" => "Ventas exentas a diplomáticos", "03" => "Orden de Compra (Instituciones Públicas y otros organismos)", "04" => "Exenciones Dirección General de Hacienda", "05" => "Zonas Francas", "99" => "Otros" }
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#document_number ⇒ Object
Returns the value of attribute document_number.
-
#document_type ⇒ Object
Returns the value of attribute document_type.
-
#institution ⇒ Object
Returns the value of attribute institution.
-
#percentage ⇒ Object
Returns the value of attribute percentage.
-
#total_tax ⇒ Object
Returns the value of attribute total_tax.
Instance Method Summary collapse
- #build_xml(node) ⇒ Object
-
#initialize(args = {}) ⇒ Exoneration
constructor
A new instance of Exoneration.
Constructor Details
#initialize(args = {}) ⇒ Exoneration
Returns a new instance of Exoneration.
24 25 26 27 28 29 30 31 |
# File 'lib/facturacr/document/exoneration.rb', line 24 def initialize(args={}) @document_type = args[:document_type] @document_number = args[:document_number] @institution = args[:institution] @date = args[:date].xmlschema @total_tax = args[:total_tax] @percentage = args[:percentage] end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
15 16 17 |
# File 'lib/facturacr/document/exoneration.rb', line 15 def date @date end |
#document_number ⇒ Object
Returns the value of attribute document_number.
15 16 17 |
# File 'lib/facturacr/document/exoneration.rb', line 15 def document_number @document_number end |
#document_type ⇒ Object
Returns the value of attribute document_type.
15 16 17 |
# File 'lib/facturacr/document/exoneration.rb', line 15 def document_type @document_type end |
#institution ⇒ Object
Returns the value of attribute institution.
15 16 17 |
# File 'lib/facturacr/document/exoneration.rb', line 15 def institution @institution end |
#percentage ⇒ Object
Returns the value of attribute percentage.
15 16 17 |
# File 'lib/facturacr/document/exoneration.rb', line 15 def percentage @percentage end |
#total_tax ⇒ Object
Returns the value of attribute total_tax.
15 16 17 |
# File 'lib/facturacr/document/exoneration.rb', line 15 def total_tax @total_tax end |
Instance Method Details
#build_xml(node) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/facturacr/document/exoneration.rb', line 33 def build_xml(node) raise "Invalid Record: #{errors.}" unless valid? node = Nokogiri::XML::Builder.new if node.nil? node.Exoneracion do |xml| xml.TipoDocument @document_type xml.NumeroDocumento @document_number xml.NombreInstitucion @institution xml.FechaEmision @date xml.MontoImpuesto @total_tax xml.PorcentajeCompra @percentage end end |